private void FormApptViewEdit_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (DialogResult == DialogResult.OK) { return; } if (IsNew) { ApptViewItems.DeleteAllForView(ApptViewCur); ApptViews.Delete(ApptViewCur); } }
private void butDelete_Click(object sender, System.EventArgs e) { //this does mess up the item orders a little, but missing numbers don't actually hurt anything. if (MessageBox.Show(Lan.g(this, "Delete this category?"), "", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } ApptViewItems.DeleteAllForView(ApptViewCur); ApptViews.Delete(ApptViewCur); DialogResult = DialogResult.OK; }