private void buttonDelete_Click(object sender, EventArgs e) { if (IsNew) { DialogResult = DialogResult.Cancel; return; } try{ ApptFieldDefs.Delete(FieldDef); DialogResult = DialogResult.OK; } catch (ApplicationException ex) { MessageBox.Show(ex.Message); } }
private void buttonDelete_Click(object sender, EventArgs e) { if (IsNew) { DialogResult = DialogResult.Cancel; return; } try{ ApptFieldDefs.Delete(FieldDef); //Throws if in use. FieldDefLinks.DeleteForFieldDefNum(FieldDef.ApptFieldDefNum, FieldDefTypes.Appointment); //Delete any FieldDefLinks to this ApptFieldDef DialogResult = DialogResult.OK; } catch (ApplicationException ex) { MessageBox.Show(ex.Message); } }