示例#1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textStart.Visible)
     {
         try{
             SchedCur.StartTime = DateTime.Parse(textStart.Text);
             SchedCur.StopTime  = DateTime.Parse(textStop.Text);
         }
         catch {
             MessageBox.Show(Lan.g(this, "Incorrect time format"));
             return;
         }
     }
     SchedCur.Note = textNote.Text;
     if (SchedCur.SchedType == ScheduleType.Blockout)
     {
         SchedCur.BlockoutType = DefB.Short[(int)DefCat.BlockoutTypes][listType.SelectedIndex].DefNum;
         if (listOp.SelectedIndex == 0)
         {
             SchedCur.Op = 0;
         }
         else
         {
             SchedCur.Op = Operatories.ListShort[listOp.SelectedIndex - 1].OperatoryNum;
         }
     }
     try{
         Schedules.InsertOrUpdate(SchedCur, IsNew);
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }