public int DeleteAccounts() { ClearDataGrid(Viewer.DataGridView_Delete); int count = 0; foreach (var resign in DeleteList) { if (Executioner.DeleteAccount(resign, out string erorr)) { resign.Status = RecordStatus.Deleted; Viewer.AddToDeleteGrid(resign, erorr, ActionOkColor); if (!Adapter.UpdateRecord(resign, out var error)) { throw new DbException(error); } count++; } else { resign.Status = RecordStatus.Erorr; Viewer.AddToDeleteGrid(resign, erorr, ActionFailColor); resign.AppendErrorMessage(erorr); if (!Adapter.UpdateRecord(resign, out var error)) { throw new DbException(error); } } } DeleteList.Clear(); return(count); }
public int DisplayTodayDeletes() { ClearDataGrid(Viewer.DataGridView_Delete); DeleteList = Logic.GetTodayDeletes().ToList(); foreach (var delete in DeleteList) { Viewer.AddToDeleteGrid(delete); } return(DeleteList.Count()); }