コード例 #1
0
 private void FormLaboratoryEdit_Load(object sender, System.EventArgs e)
 {
     textDescription.Text   = LabCur.Description;
     textPhone.Text         = LabCur.Phone;
     textWirelessPhone.Text = LabCur.WirelessPhone;
     textAddress.Text       = LabCur.Address;
     textCity.Text          = LabCur.City;
     textState.Text         = LabCur.State;
     textZip.Text           = LabCur.Zip;
     textEmail.Text         = LabCur.Email;
     textNotes.Text         = LabCur.Notes;
     turnaroundList         = LabTurnarounds.GetForLab(LabCur.LaboratoryNum);
     comboSlip.Items.Add(Lan.g(this, "Default"));
     comboSlip.SelectedIndex = 0;
     SlipList = SheetDefs.GetCustomForType(SheetTypeEnum.LabSlip);
     for (int i = 0; i < SlipList.Count; i++)
     {
         comboSlip.Items.Add(SlipList[i].Description);
         if (LabCur.Slip == SlipList[i].SheetDefNum)
         {
             comboSlip.SelectedIndex = i + 1;
         }
     }
     checkIsHidden.Checked = LabCur.IsHidden;
     FillGrid();
 }
コード例 #2
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDescription.Text == "")
     {
         MsgBox.Show(this, "Description cannot be blank.");
         return;
     }
     LabCur.Description = textDescription.Text;
     LabCur.Phone       = textPhone.Text;
     LabCur.Notes       = textNotes.Text;
     try{
         if (IsNew)
         {
             Laboratories.Insert(LabCur);
         }
         else
         {
             Laboratories.Update(LabCur);
         }
         LabTurnarounds.SetForLab(LabCur.LaboratoryNum, turnaroundList);
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }
コード例 #3
0
 private void FormLaboratoryEdit_Load(object sender, System.EventArgs e)
 {
     textDescription.Text = LabCur.Description;
     textPhone.Text       = LabCur.Phone;
     textNotes.Text       = LabCur.Notes;
     turnaroundList       = LabTurnarounds.GetForLab(LabCur.LaboratoryNum);
     FillGrid();
 }
コード例 #4
0
        private void listTurnaround_Click(object sender, EventArgs e)
        {
            if (listTurnaround.SelectedIndex == -1)
            {
                return;
            }
            DateTime duedate = LabTurnarounds.ComputeDueDate
                                   (MiscData.GetNowDateTime().Date, turnaroundList[listTurnaround.SelectedIndex].DaysActual);

            textDateDue.Text             = duedate.ToShortDateString() + " " + duedate.ToShortTimeString();
            listTurnaround.SelectedIndex = -1;
        }
コード例 #5
0
 private void listLab_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listLab.SelectedIndex == -1)
     {
         return;
     }
     turnaroundList = LabTurnarounds.GetForLab(ListLabs[listLab.SelectedIndex].LaboratoryNum);
     listTurnaround.Items.Clear();
     for (int i = 0; i < turnaroundList.Count; i++)
     {
         listTurnaround.Items.Add(turnaroundList[i].Description + ", " + turnaroundList[i].DaysActual.ToString());
     }
 }
コード例 #6
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDescription.Text == "")
     {
         MsgBox.Show(this, "Description cannot be blank.");
         return;
     }
     LabCur.Description   = textDescription.Text;
     LabCur.Phone         = textPhone.Text;
     LabCur.WirelessPhone = textWirelessPhone.Text;
     LabCur.Address       = textAddress.Text;
     LabCur.City          = textCity.Text;
     LabCur.State         = textState.Text;
     LabCur.Zip           = textZip.Text;
     LabCur.Email         = textEmail.Text;
     LabCur.Notes         = textNotes.Text;
     LabCur.Slip          = 0;
     LabCur.IsHidden      = checkIsHidden.Checked;
     if (comboSlip.SelectedIndex > 0)
     {
         LabCur.Slip = SlipList[comboSlip.SelectedIndex - 1].SheetDefNum;
     }
     try{
         if (IsNew)
         {
             Laboratories.Insert(LabCur);
         }
         else
         {
             Laboratories.Update(LabCur);
         }
         LabTurnarounds.SetForLab(LabCur.LaboratoryNum, turnaroundList);
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }