private void WindowLinkingMedDrugCourse_Loaded(object sender, RoutedEventArgs e) { var listCourse = logicCourse.Read(new DrugCourseBindingModel { DoctorId = doctorId }); if (listCourse != null) { ComboBoxCourse.ItemsSource = listCourse; } var listMedicine = logicMedicine.Read(null); if (listMedicine != null) { ComboBoxMed.ItemsSource = listMedicine; } }
private void LoadData() { try { var list = logic.Read(new DrugCourseBindingModel { DoctorId = id }); if (list != null) { dataGrid.ItemsSource = list; dataGrid.Columns[1].Visibility = Visibility.Hidden; dataGrid.Columns[4].Visibility = Visibility.Hidden; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); } }