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(); }
}