Пример #1
0
 private void FormScreenGroup_Load(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         ScreenGroups.Insert(ScreenGroupCur);
     }
     if (PrefC.GetBool(PrefName.PublicHealthScreeningUsePat))
     {
         labelScreener.Visible = false;
         textProvName.Visible  = false;
         labelProv.Visible     = false;
         comboProv.Visible     = false;
         ScreenList            = new OpenDentBusiness.Screen[0];
         FillGridScreenPat();
     }
     else
     {
         ListPats = new List <Patient>();
         FillGrid();
     }
     if (ScreenList.Length > 0)
     {
         OpenDentBusiness.Screen ScreenCur = ScreenList[0];
         ScreenGroupCur.SGDate       = ScreenCur.ScreenDate;
         ScreenGroupCur.ProvName     = ScreenCur.ProvName;
         ScreenGroupCur.ProvNum      = ScreenCur.ProvNum;
         ScreenGroupCur.County       = ScreenCur.County;
         ScreenGroupCur.GradeSchool  = ScreenCur.GradeSchool;
         ScreenGroupCur.PlaceService = ScreenCur.PlaceService;
     }
     textScreenDate.Text  = ScreenGroupCur.SGDate.ToShortDateString();
     textDescription.Text = ScreenGroupCur.Description;
     textProvName.Text    = ScreenGroupCur.ProvName;       //has to be filled before provnum
     for (int i = 0; i < ProviderC.ListShort.Count; i++)
     {
         comboProv.Items.Add(ProviderC.ListShort[i].Abbr);
         if (ScreenGroupCur.ProvNum == ProviderC.ListShort[i].ProvNum)
         {
             comboProv.SelectedIndex = i;
         }
     }
     string[] CountiesListNames = Counties.GetListNames();
     comboCounty.Items.AddRange(CountiesListNames);
     if (ScreenGroupCur.County == null)
     {
         ScreenGroupCur.County = "";                                               //prevents the next line from crashing
     }
     comboCounty.SelectedIndex = comboCounty.Items.IndexOf(ScreenGroupCur.County); //"" etc OK
     for (int i = 0; i < SiteC.List.Length; i++)
     {
         comboGradeSchool.Items.Add(SiteC.List[i].Description);
     }
     if (ScreenGroupCur.GradeSchool == null)
     {
         ScreenGroupCur.GradeSchool = "";                                                         //prevents the next line from crashing
     }
     comboGradeSchool.SelectedIndex = comboGradeSchool.Items.IndexOf(ScreenGroupCur.GradeSchool); //"" etc OK
     comboPlaceService.Items.AddRange(Enum.GetNames(typeof(PlaceOfService)));
     comboPlaceService.SelectedIndex = (int)ScreenGroupCur.PlaceService;
 }
Пример #2
0
 private void FormScreenGroup_Load(object sender, System.EventArgs e)
 {
     Location = new Point(200, 200);
     if (IsNew)
     {
         ScreenGroups.Insert(ScreenGroupCur);
     }
     FillGrid();
     if (Screens.List.Length > 0)
     {
         OpenDentBusiness.Screen ScreenCur = Screens.List[0];
         ScreenGroupCur.SGDate       = ScreenCur.ScreenDate;
         ScreenGroupCur.ProvName     = ScreenCur.ProvName;
         ScreenGroupCur.ProvNum      = ScreenCur.ProvNum;
         ScreenGroupCur.County       = ScreenCur.County;
         ScreenGroupCur.GradeSchool  = ScreenCur.GradeSchool;
         ScreenGroupCur.PlaceService = ScreenCur.PlaceService;
     }
     textScreenDate.Text  = ScreenGroupCur.SGDate.ToShortDateString();
     textDescription.Text = ScreenGroupCur.Description;
     textProvName.Text    = ScreenGroupCur.ProvName;       //has to be filled before provnum
     for (int i = 0; i < Providers.List.Length; i++)
     {
         comboProv.Items.Add(Providers.List[i].Abbr);
         if (ScreenGroupCur.ProvNum == Providers.List[i].ProvNum)
         {
             comboProv.SelectedIndex = i;
         }
     }
     comboCounty.Items.AddRange(Counties.ListNames);
     if (ScreenGroupCur.County == null)
     {
         ScreenGroupCur.County = "";                                               //prevents the next line from crashing
     }
     comboCounty.SelectedIndex = comboCounty.Items.IndexOf(ScreenGroupCur.County); //"" etc OK
     comboGradeSchool.Items.AddRange(Schools.ListNames);
     if (ScreenGroupCur.GradeSchool == null)
     {
         ScreenGroupCur.GradeSchool = "";                                                         //prevents the next line from crashing
     }
     comboGradeSchool.SelectedIndex = comboGradeSchool.Items.IndexOf(ScreenGroupCur.GradeSchool); //"" etc OK
     comboPlaceService.Items.AddRange(Enum.GetNames(typeof(PlaceOfService)));
     comboPlaceService.SelectedIndex = (int)ScreenGroupCur.PlaceService;
 }