public PartialViewResult ShowProductWindow() { ViewBag.Categories = CategoryBusiness.GetCategoriesSelectList(); ViewBag.Manufacturers = ManufacturerBusiness.GetManufacturersSelectList(); return(PartialView("AddProduct", new Product())); }
public PartialViewResult GetProduct(int id) { ViewBag.Categories = CategoryBusiness.GetCategoriesSelectList(); ViewBag.Manufacturers = ManufacturerBusiness.GetManufacturersSelectList(); var product = ProductBusiness.GetProductByProductId(id); return(PartialView("_ProductWindow", product)); }
// Redirect to Add Product Form public async Task <ActionResult> AddProduct() { ViewBag.Categories = await CategoryBusiness.GetCategoriesSelectList(); ViewBag.Manufacturers = await ManufacturerBusiness.GetManufacturersSelectList(); return(View("AddProduct", new Product())); }
// Redirect to Edit Product Form public async Task <ActionResult> EditProduct(int Id) { ViewBag.Categories = await CategoryBusiness.GetCategoriesSelectList(); ViewBag.Manufacturers = await ManufacturerBusiness.GetManufacturersSelectList(); var product = await ProductBusiness.GetProductByProductId(Id); return(View("AddProduct", product)); }