private void butDelete_Click(object sender, EventArgs e) { if (!MsgBox.Show(this, true, "Delete this prescription template?")) { return; } RxDefs.Delete(RxDefCur); DialogResult = DialogResult.OK; }
private void FormRxDefEdit_FormClosing(object sender, FormClosingEventArgs e) { if (DialogResult == DialogResult.OK) { return; //close as normal } if (IsNew) { RxDefs.Delete(RxDefCur); } }