/// <summary> /// Method listing products and getting the maingroup afterwards /// </summary> private void GetProductGroups() { List <Product> listProducts = ProductMethods.ListProducts(); MainGroup = listProducts.Select(x => x.ProductGroup.Substring(0, 2)).OrderBy(x => x).ToList(); MainGroup = MainGroup.Distinct().ToList(); }
public void DeleteProduct() { Product selectedProd = MyFilteredItems.ElementAt(SelectedIndex); DataAccessLayer.ProductDelete(selectedProd); ProductList = ProductMethods.ListProducts(); NotifyPropertyChanged(""); }
public ProductListVM() { ProductList = new List <Product>(); OpenProductEditWindow = new MethodCommand(EditProductWindow); ChangePriceWindow = new MethodCommand(ChangeProductPriceWindow); ProductDelete = new MethodCommand(DeleteProduct); ProductList = ProductMethods.ListProducts(); GetProducts(); }
public ProductEditVM(object selectedProduct) { EditProduct = new MethodCommand(ProductEdit); CastToType(selectedProduct); ListProducts = ProductMethods.ListProducts(); GetProductGroups(); SelectedMainGroup = ProductToEdit.ProductGroup.Substring(0, 2); SelectedSubGroup = ProductToEdit.ProductGroup.Substring(3, 3); }
public ProductVM() { ListProducts = ProductMethods.ListProducts(); SelectedMainGroup = "00"; Product = new Product(); CreateProduct = new MethodCommand(CreateProd); GetProductGroups(); GetSubGroups(); }