private void WindowSelectionCosmetics_Loaded(object sender, RoutedEventArgs e) { var list = logic.Read(new CosmeticBindingModel { EmployeeId = employeeId }); if (list != null) { ComboBoxCosmeticName.ItemsSource = list; } }
private void WindowSelectionCosmeticsForPurchaseList_Loaded(object sender, RoutedEventArgs e) { var list = logic.Read(new CosmeticBindingModel { EmployeeId = employeeId }); if (list != null) { ComboBoxCosmeticName.ItemsSource = list; } if (id != null) { ComboBoxCosmeticName.SelectedItem = SetValue(id.Value); } }
private void LoadData() { try { var list = logic.Read(new CosmeticBindingModel { EmployeeId = id }); if (list != null) { dataGrid.ItemsSource = list; dataGrid.Columns[0].Visibility = Visibility.Hidden; dataGrid.Columns[1].Visibility = Visibility.Hidden; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void WindowCosmetic_Loaded(object sender, RoutedEventArgs e) { if (id.HasValue) { try { var view = logic.Read(new CosmeticBindingModel { Id = id })?[0]; if (view != null) { TextBoxName.Text = view.CosmeticName; TextBoxPrice.Text = view.Price.ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); } } }