private void butDelete_Click(object sender, System.EventArgs e) { if (IsNew) { DialogResult = DialogResult.Cancel; } else { try{ Clinics.Delete(ClinicCur); DialogResult = DialogResult.OK; } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void butDelete_Click(object sender, System.EventArgs e) { if (IsNew) { DialogResult = DialogResult.Cancel; return; } if (!MsgBox.Show(this, true, "Delete Clinic?")) { return; } try{ Clinics.Delete(ClinicCur); DialogResult = DialogResult.OK; } catch (Exception ex) { MessageBox.Show(ex.Message); } }