예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }