示例#1
0
        public ViewResult EditCategory(int id)
        {
            StockViewModel model = new StockViewModel
            {
                ProductCategory = this.repository.GetCategoryByID(id)
            };

            return View(model);
        }
示例#2
0
        public ViewResult Category()
        {
            StockViewModel model = new StockViewModel
            {
                Categories = repository.GetAllCategory()
            };

            return View(model);
        }
示例#3
0
 public ActionResult EditProduct(StockViewModel model)
 {
     if (ModelState.IsValid)
     {
         this.repository.UpdateProduct(model.Product);
         return RedirectToAction("Product", "Stock");
     }
     else
     {
         return View(model);
     }
 }
示例#4
0
        public ViewResult EditProduct(int id)
        {
            StockViewModel model = new StockViewModel
            {
                Product = this.repository.GetProductByID(id)
            };

            var category = this.repository.GetAllCategory();
            ViewBag.Category = new MultiSelectList(category, "CategoryID", "Name");

            var taxCategory = this.repository.GetAllTaxCategory();
            ViewBag.TaxCategory = new MultiSelectList(taxCategory, "TaxID", "Name");

            return View(model);
        }
示例#5
0
        public ViewResult Product()
        {
            StockViewModel model = new StockViewModel
            {
                Products = this.repository.GetAllProduct()
            };

            return View(model);
        }