private void LoadData() { try { var list = logic.Read(new DistributionBindingModel { EmployeeId = id }); if (list != null) { dataGrid.ItemsSource = list; dataGrid.Columns[1].Visibility = Visibility.Hidden; dataGrid.Columns[3].Visibility = Visibility.Hidden; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void WindowLinkingDistribution_Loaded(object sender, RoutedEventArgs e) { var listVisit = logicVisit.Read(null); if (listVisit != null) { ComboBoxVisit.ItemsSource = listVisit; } var listDistribution = logicDistribution.Read(new DistributionBindingModel { EmployeeId = employeeId }); if (listDistribution != null) { ComboBoxDistribution.ItemsSource = listDistribution; } if (distributionId != null) { ComboBoxDistribution.SelectedItem = SetValueDistribution(distributionId.Value); } }