public static List<Timelapse> GetListForDeletion(string deleted, string status)
{
try
{
string sql = "Select * FROM Timelapses WHERE " + deleted + " AND " + status + " ORDER BY CreatedDT DESC";
var cmd = new SqlCommand { CommandText = sql, CommandType = CommandType.Text };
cmd.Connection = Connection.DbConnection;
Connection.OpenConnection();
var dr = GetListFromDataReader(cmd.ExecuteReader());
Connection.CloseConnection();
return dr;
}
catch (Exception ex)
{
if (Connection.DbConnection.State == ConnectionState.Closed)
Utils.FileLog("TimelapseDao GetList() " + ex.Message);
else
Utils.FileLog(string.Format("TimelapseDao GetList() <br />{1}", ex.Message));
return new List<Timelapse>();
}
finally
{
Connection.CloseConnection();
}
}