private void FormProcBroken_FormClosing(object sender, FormClosingEventArgs e) { if (DialogResult == DialogResult.Cancel && IsNew) { if (Patients.GetPat(_procCur.PatNum).DiscountPlanNum != 0) { Adjustments.DeleteForProcedure(_procCur.ProcNum); //Delete discount plan adjustment } Procedures.Delete(_procCur.ProcNum); IsProcDeleted = true; } }
private void butCancel_Click(object sender, System.EventArgs e) { if (IsNew) { if (Patients.GetPat(_procCur.PatNum).DiscountPlanNum != 0) { Adjustments.DeleteForProcedure(_procCur.ProcNum); //Delete discount plan adjustment } Procedures.Delete(_procCur.ProcNum); } DialogResult = DialogResult.Cancel; }