예제 #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);
        }