public ViewResult EditCategory(int id) { StockViewModel model = new StockViewModel { ProductCategory = this.repository.GetCategoryByID(id) }; return View(model); }
public ViewResult Category() { StockViewModel model = new StockViewModel { Categories = repository.GetAllCategory() }; return View(model); }
public ActionResult EditProduct(StockViewModel model) { if (ModelState.IsValid) { this.repository.UpdateProduct(model.Product); return RedirectToAction("Product", "Stock"); } else { return View(model); } }
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); }
public ViewResult Product() { StockViewModel model = new StockViewModel { Products = this.repository.GetAllProduct() }; return View(model); }