private void ListViewPatientGroup_OnLoaded(object sender, RoutedEventArgs e)
 {
     //throw new NotImplementedException();
     try
     {
         using (var patientGroupDao = new PatientGroupDao())
         {
             Datalist.Clear();
             var condition = new Dictionary <string, object>();
             var list      = patientGroupDao.SelectPatientGroup(condition);
             foreach (var type in list)
             {
                 var patientGroupData = new PatientGroupData
                 {
                     Id          = type.Id,
                     Name        = type.Name,
                     Description = type.Description
                 };
                 Datalist.Add(patientGroupData);
             }
         }
     }
     catch (Exception ex)
     {
         MainWindow.Log.WriteInfoConsole("In CPatient.xaml.cs:ListViewPatientGroup_OnLoaded exception messsage: " + ex.Message);
     }
 }
 private void ComboBoxPatientGroup_OnInitialized(object sender, EventArgs e)
 {
     try
     {
         ComboBoxPatientGroup.Items.Clear();
         using (var patientGroupDao = new PatientGroupDao())
         {
             var condition = new Dictionary <string, object>();
             var list      = patientGroupDao.SelectPatientGroup(condition);
             foreach (var type in list)
             {
                 var patientGroupData = new PatientGroupData
                 {
                     Id          = type.Id,
                     Name        = type.Name,
                     Description = type.Description
                 };
                 ComboBoxPatientGroup.Items.Add(patientGroupData.Name);
             }
         }
     }
     catch (Exception ex)
     {
         MainWindow.Log.WriteInfoConsole("In Init.xaml.cs:ComboBoxPatientGroup_OnInitialized exception messsage: " + ex.Message);
     }
 }
        private void RefreshData()
        {
            try
            {
                using (var patientGroupDao = new PatientGroupDao())
                {
                    Datalist.Clear();

                    var condition = new Dictionary <string, object>();
                    var list      = patientGroupDao.SelectPatientGroup(condition);
                    foreach (var pa in list)
                    {
                        var patientGroupData = new PatientGroupData();
                        patientGroupData.Id          = pa.Id;
                        patientGroupData.Name        = pa.Name;
                        patientGroupData.Description = pa.Description;
                        Datalist.Add(patientGroupData);
                    }
                }
                Basewindow.patientGroupPanel.RefreshPatientGroupCombobox();
                Basewindow.sheduleContent.InitPatientGroupComboBox();
            }
            catch (Exception ex)
            {
                MainWindow.Log.WriteInfoConsole("In CPatientGroup.xaml.cs:RefreshData exception messsage: " + ex.Message);
            }
        }
 public void RefreshPatientGroupCombobox()
 {
     try
     {
         ComboBoxPatientGroup.Items.Clear();
         using (var patientGroupDao = new PatientGroupDao())
         {
             var condition = new Dictionary <string, object>();
             var list      = patientGroupDao.SelectPatientGroup(condition);
             foreach (var type in list)
             {
                 var patientGroupData = new PatientGroupData
                 {
                     Id          = type.Id,
                     Name        = type.Name,
                     Description = type.Description
                 };
                 ComboBoxPatientGroup.Items.Add(patientGroupData.Name);
             }
         }
     }
     catch (Exception ex)
     {
         MainWindow.Log.WriteInfoConsole("In Init.xaml.cs:RefreshPatientGroupCombobox exception messsage: " + ex.Message);
     }
 }
        private void ButtonNew_OnClick(object sender, RoutedEventArgs e)
        {
            isNew = true;

            PatientGroupData patientGroupData = new PatientGroupData();

            patientGroupData.Name        = "";
            patientGroupData.Description = "";
            Datalist.Add(patientGroupData);

            this.ButtonNew.IsEnabled    = false;
            this.ButtonDelete.IsEnabled = false;
            this.ButtonApply.IsEnabled  = true;
            this.ButtonCancel.IsEnabled = true;

            ParSettingGrid.IsEnabled           = false;
            ListViewPatientGroupPara.IsEnabled = false;

            ListViewPatientGroup.SelectedIndex = Datalist.Count - 1;
        }