BLL.Dao.TimelapseDao.Delete C# (CSharp) Метод

Delete() публичный статический Метод

public static Delete ( int id ) : bool
id int
Результат bool
        public static bool Delete(int id)
        {
            string query = @"UPDATE [dbo].[Timelapses] " +
                           "SET [IsDeleted] = 1 " +
                           "WHERE (Id = " + id + ")";
            try
            {
                var cmd = new SqlCommand { CommandText = query, CommandType = CommandType.Text };
                Connection.OpenConnection();
                cmd.Connection = Connection.DbConnection;
                bool result = (cmd.ExecuteNonQuery() > 0);
                Connection.CloseConnection();
                cmd.Dispose();
                return result;
            }
            catch (Exception ex)
            {
                Utils.FileLog("TimelapseDao Delete(int id) " + ex.Message);
                return false;
            }
            finally
            { Connection.CloseConnection(); }
        }

Same methods

TimelapseDao::Delete ( string code ) : bool