public int DisableAccounts() { ClearDataGrid(Viewer.DataGridView_Disable); int count = 0; foreach (var resign in DisableList) { if (Executioner.DisableAccount(resign, out string erorr)) { resign.Status = RecordStatus.Disabled; Viewer.AddToDisableGrid(resign, erorr, ActionOkColor); if (!Adapter.UpdateRecord(resign, out var error)) { throw new DbException(error); } count++; } else { resign.Status = RecordStatus.Erorr; Viewer.AddToDisableGrid(resign, erorr, ActionFailColor); resign.AppendErrorMessage(erorr); if (!Adapter.UpdateRecord(resign, out var error)) { throw new DbException(error); } } } DisableList.Clear(); return(count); }
public int DisplayTodayDisables() { ClearDataGrid(Viewer.DataGridView_Disable); DisableList = Logic.GetTodayDisables().ToList(); foreach (var disable in DisableList) { Viewer.AddToDisableGrid(disable); } return(DisableList.Count()); }