private void AddCategoryClick(object sender, RoutedEventArgs e) { MenuItemEditor win = new MenuItemEditor(); if (win.ShowDialog() == true) { win.Category.CategoryId = this.catRepo.Insert(DataConverter.CategoryConverter(win.Category)); this.avm.CategoryList.Add(win.Category); this.categoryListBox.Items.Refresh(); // MessageBox.Show("Sikeres hozzáadás!"); } }
private void EditCategoryClick(object sender, RoutedEventArgs e) { Window win = new MenuItemEditor(this.avm.SelectedCategory); if (this.avm.SelectedCategory != null) { if (win.ShowDialog() == true) { this.catRepo.Update(DataConverter.CategoryConverter(this.avm.SelectedCategory)); this.categoryListBox.Items.Refresh(); MessageBox.Show("Sikeres módosítás!"); } } }
private void EditProductClick(object sender, RoutedEventArgs e) { MenuItemEditor win = new MenuItemEditor(this.avm.SelectedProduct); if (this.avm.SelectedProduct != null) { if (win.ShowDialog() == true) { this.productRepo.Update(this.converter.ProductConverter(this.avm.SelectedProduct)); this.productListBox.Items.Refresh(); MessageBox.Show("Sikeres módosítás!"); } } }
private void AddProductClick(object sender, RoutedEventArgs e) { MenuItemEditor win = new MenuItemEditor(true); if (win.ShowDialog() == true) { win.Product.Category = this.avm.SelectedCategory; win.Product.TermekId = this.productRepo.Insert(this.converter.ProductConverter(win.Product)); this.avm.FilteredProducts.Add(win.Product); this.avm.ProductList.Add(win.Product); this.productListBox.Items.Refresh(); // MessageBox.Show("Sikeres hozzáadás!"); } }