/// <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();
        }
示例#2
0
        public void DeleteProduct()
        {
            Product selectedProd = MyFilteredItems.ElementAt(SelectedIndex);

            DataAccessLayer.ProductDelete(selectedProd);
            ProductList = ProductMethods.ListProducts();
            NotifyPropertyChanged("");
        }
示例#3
0
 public ProductListVM()
 {
     ProductList           = new List <Product>();
     OpenProductEditWindow = new MethodCommand(EditProductWindow);
     ChangePriceWindow     = new MethodCommand(ChangeProductPriceWindow);
     ProductDelete         = new MethodCommand(DeleteProduct);
     ProductList           = ProductMethods.ListProducts();
     GetProducts();
 }
示例#4
0
 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);
 }
示例#5
0
 public ProductVM()
 {
     ListProducts      = ProductMethods.ListProducts();
     SelectedMainGroup = "00";
     Product           = new Product();
     CreateProduct     = new MethodCommand(CreateProd);
     GetProductGroups();
     GetSubGroups();
 }