Exemplo n.º 1
0
        void ComputeConsolidateDiagnosis()
        {
            DiagnosisStructure dsL = new DiagnosisStructure();

            foreach (var item in this.leftEye_flp.Controls)
            {
                DiagnosisUC c = item as DiagnosisUC;
                dsL.DiagnosisList.Add(c.GetDiagnosis());
            }
            //ConsolidatedDiagnosisLeft = JsonConvert.SerializeObject(dsL);
            ConsolidatedDiagnosisLeft  = string.Empty;
            ConsolidatedDiagnosisRight = string.Empty;
            for (int i = 0; i < dsL.DiagnosisList.Count; i++)
            {
                ConsolidatedDiagnosisLeft += dsL.DiagnosisList[i] + ",";
            }
            ConsolidatedDiagnosisLeft = ConsolidatedDiagnosisLeft.TrimEnd(',');
            DiagnosisStructure dsR = new DiagnosisStructure();

            foreach (var item in this.rightEye_flp.Controls)
            {
                DiagnosisUC c = item as DiagnosisUC;
                dsR.DiagnosisList.Add(c.GetDiagnosis());
            }
            //ConsolidatedDiagnosisRight = JsonConvert.SerializeObject(dsR);
            for (int i = 0; i < dsR.DiagnosisList.Count; i++)
            {
                ConsolidatedDiagnosisRight += dsR.DiagnosisList[i] + ",";
            }
            ConsolidatedDiagnosisRight = ConsolidatedDiagnosisRight.TrimEnd(',');
        }
Exemplo n.º 2
0
 void d_RemoveDiagnosisEvent(DiagnosisUC val)
 {
     if (val.Parent == this.leftEye_flp)
     {
         this.leftEye_flp.Controls.Remove(val);
     }
     else
     {
         this.rightEye_flp.Controls.Remove(val);
     }
     if (this.rightEye_flp.Controls.Count < 1 && this.leftEye_flp.Controls.Count < 1)
     {
         saveDiagnosis_btn.Enabled  = false;
         clearDiagnosis_btn.Enabled = false;
     }
 }
Exemplo n.º 3
0
 void l_RemoveDiagnosisEvent(DiagnosisUC val)
 {
     this.leftEye_flp.Controls.Remove(val);
 }
Exemplo n.º 4
0
 void r_RemoveDiagnosisEvent(DiagnosisUC val)
 {
     this.rightEye_flp.Controls.Remove(val);
 }
Exemplo n.º 5
0
 void AddDiagnosis(PopulateDiagnosis diagnosisFrom, DiagnosisSide side)
 {
     if (!isFormLoad)
     {
         string diagnosisStr = string.Empty;
         if (side == DiagnosisSide.Left)                    // if side is left, add diagnosis in left side
         {
             if (diagnosisFrom == PopulateDiagnosis.FromUI) //the population is from user
             {
                 if (leftDiagnosis_cbx.SelectedItem == null || leftDiagnosis_cbx.SelectedItem.ToString() == DiagnosisEnum.None.ToString())
                 {
                     if (string.IsNullOrEmpty(leftDiagnosis_cbx.Text))
                     {
                         return;
                     }
                     else
                     {
                         diagnosisClass.diagnosisArr2.Add(leftDiagnosis_cbx.Text);
                     }
                 }
                 //diagnosisStr = leftDiagnosis_cbx.SelectedItem.ToString();
                 diagnosisStr = leftDiagnosis_cbx.Text;
                 saveDiagnosis_btn.Enabled  = true;
                 clearDiagnosis_btn.Enabled = true;
             }
             else // the population is from database
             {
                 diagnosisStr = diagnosis;
             }
         }
         else //add diagnosis in right side
         {
             if (diagnosisFrom == PopulateDiagnosis.FromUI)//the population is from user
             {
                 if (rightDiagnosis_cbx.SelectedItem == null || rightDiagnosis_cbx.SelectedItem.ToString() == DiagnosisEnum.None.ToString())
                 {
                     if (string.IsNullOrEmpty(rightDiagnosis_cbx.Text))
                     {
                         return;
                     }
                     else
                     {
                         diagnosisClass.diagnosisArr2.Add(rightDiagnosis_cbx.Text);
                     }
                 }
                 //diagnosisStr = rightDiagnosis_cbx.SelectedItem.ToString();
                 diagnosisStr = rightDiagnosis_cbx.Text;
                 saveDiagnosis_btn.Enabled  = true;
                 clearDiagnosis_btn.Enabled = true;
             }
             else // the population is from database
             {
                 diagnosisStr = diagnosis;
             }
         }
         if (diagnosisStr != DiagnosisEnum.None.ToString())
         {
             DiagnosisUC d = new DiagnosisUC(diagnosisStr);
             d.RemoveDiagnosisEvent += d_RemoveDiagnosisEvent;
             if (side == DiagnosisSide.Left)
             {
                 if (IsDiagnosisExist(leftEye_flp, diagnosisStr))
                 {
                     this.leftEye_flp.Controls.Add(d);
                 }
             }
             else
             {
                 if (IsDiagnosisExist(rightEye_flp, diagnosisStr))
                 {
                     this.rightEye_flp.Controls.Add(d);
                 }
             }
             cbx1_lbx.Visible = false;
             cbx2_lbx.Visible = false;
         }
     }
 }