private void butCancel_Click(object sender, EventArgs e) { if (_gradingScaleCur.IsNew) { try { GradingScales.Delete(_gradingScaleCur.GradingScaleNum); } catch (Exception ex) { MessageBox.Show(this, ex.Message); return; } } DialogResult = DialogResult.Cancel; }
private void butDelete_Click(object sender, EventArgs e) { if (!MsgBox.Show(this, MsgBoxButtons.YesNo, "This will delete the grading scale. Continue?")) { return; } try { GradingScales.Delete(_gradingScaleCur.GradingScaleNum); DialogResult = DialogResult.OK; } catch (Exception ex) { MessageBox.Show(this, ex.Message); } }