private void Button_Update_Click(object sender, RoutedEventArgs e) { _context.Taxes.Load(); Product selectedItem = (Product)productDataGrid.SelectedItem; NewProductWindow newProductWindow = new NewProductWindow(selectedItem, this, _context); newProductWindow.ShowDialog(); }
private static void NewProduct(object sender, ExecutedRoutedEventArgs e) { MainWindow mainWindow = (MainWindow)sender; if (_newProductWindow == null) { _newProductWindow = new NewProductWindow(mainWindow); _newProductWindow.Show(); } else { _newProductWindow.Close(); _newProductWindow = new NewProductWindow(mainWindow); _newProductWindow.Show(); } }
private void AddProduct_Click(object sender, RoutedEventArgs e) { if (User.Role.userRole.Equals("Admin") || User.Role.userRole.Equals("Manager")) { NewProductWindow newEmpWindow = new NewProductWindow(); newEmpWindow.CategorieRepository = categorieRepository; newEmpWindow.ManufacturerRepository = manufacturerRepository; newEmpWindow.ProductRepository = productRepository; newEmpWindow.SetManufacturerAndCategorieComboBox(); newEmpWindow.ShowDialog(); ProductsDataGrid.ItemsSource = productRepository.GetAll(); } else { MessageBox.Show("У вас недостатньо прав!"); } }
public ChooseTaxWindow(NewProductWindow newProductWindow, DatabaseContext context) : this(context) { this.newProductWindow = newProductWindow; }