private void butDelete_Click(object sender, EventArgs e) { if (!MsgBox.Show(this, true, "Schedules may be lost. Continue?")) { return; } for (int i = 0; i < Employees.ListLong.Length; i++) { try{ Employees.Delete(Employees.ListLong[i].EmployeeNum); } catch {} } FillGrid(); }
private void butDelete_Click(object sender, EventArgs e) { if (IsNew) { DialogResult = DialogResult.Cancel; return; } //not new: try{ Employees.Delete(EmployeeCur.EmployeeNum); DialogResult = DialogResult.OK; } catch (ApplicationException ex) { MessageBox.Show(ex.Message); } }