示例#1
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;              //delete takes place in FormClosing
     }
     else
     {
         AutomationConditions.DeleteByAutomationNum(AutoCur.AutomationNum);
         Automations.Delete(AutoCur);
         DialogResult = DialogResult.OK;
     }
 }
示例#2
0
 private void FormAutomationEdit_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (DialogResult == DialogResult.OK)
     {
         return;
     }
     //this happens if cancel or if user deletes a new automation
     if (IsNew)
     {
         AutomationConditions.DeleteByAutomationNum(AutoCur.AutomationNum);
         Automations.Delete(AutoCur);
     }
 }
示例#3
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     //if(IsNew){
     //
     //	return;
     //}
     AutomationConditions.DeleteByAutomationNum(AutoCur.AutomationNum);
     Automations.Delete(AutoCur);
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
     }
     else
     {
         DialogResult = DialogResult.OK;
     }
 }