Ejemplo n.º 1
0
        private void StudyingStatusesWindow_Load(object sender, RoutedEventArgs e)
        {
            List <StudentViewModel> list = logicS.Read(new StudentBindingModel
            {
                ProviderId = App.SelectProvider.Id
            });

            if (list != null)
            {
                comboBoxStudentId.ItemsSource  = list;
                comboBoxStudentId.SelectedItem = null;
            }
            comboBoxStudyingBase.Items.Clear();
            foreach (string _base in Enum.GetNames(typeof(StudyingBase)))
            {
                comboBoxStudyingBase.Items.Add(_base);
            }
            comboBoxStudyingForm.Items.Clear();
            foreach (string form in Enum.GetNames(typeof(StudyingForm)))
            {
                comboBoxStudyingForm.Items.Add(form);
            }
            if (id.HasValue)
            {
                StudyingStatusViewModel status = logicSS.Read(new StudyingStatusBindingModel
                {
                    Id = id
                })?[0];

                comboBoxStudentId.SelectedValue   = status.StudentId;
                comboBoxStudyingBase.SelectedItem = status.StudyingBase.ToString();
                comboBoxStudyingForm.SelectedItem = status.StudyingForm.ToString();
                textBoxCourse.Text = status.Course.ToString();
            }
        }
Ejemplo n.º 2
0
 private void LoadData()
 {
     try
     {
         var list = logic.Read(new StudyingStatusBindingModel
         {
             ProviderId = App.SelectProvider.Id
         });
         if (list != null)
         {
             dataGridStudyingStatuses.ItemsSource = list;
         }
     }
     catch (Exception ex)
     {
         logger.Error("Ошибка загрузки данных : " + ex.Message);
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }