Esempio n. 1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textOpName.Text == "")
     {
         MessageBox.Show(Lan.g(this, "Op Name cannot be blank."));
         return;
     }
     OpCur.OpName   = textOpName.Text;
     OpCur.Abbrev   = textAbbrev.Text;
     OpCur.IsHidden = checkIsHidden.Checked;
     if (comboClinic.SelectedIndex == 0)         //none
     {
         OpCur.ClinicNum = 0;
     }
     else
     {
         OpCur.ClinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum;
     }
     if (comboProvDentist.SelectedIndex == 0)         //none
     {
         OpCur.ProvDentist = 0;
     }
     else
     {
         OpCur.ProvDentist = ProviderC.ListShort[comboProvDentist.SelectedIndex - 1].ProvNum;
     }
     if (comboProvHygienist.SelectedIndex == 0)         //none
     {
         OpCur.ProvHygienist = 0;
     }
     else
     {
         OpCur.ProvHygienist = ProviderC.ListShort[comboProvHygienist.SelectedIndex - 1].ProvNum;
     }
     OpCur.IsHygiene      = checkIsHygiene.Checked;
     OpCur.SetProspective = checkSetProspective.Checked;
     try{
         if (IsNew)
         {
             Operatories.Insert(OpCur);
         }
         else
         {
             Operatories.Update(OpCur);
         }
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }