public ActionResult ProductDetail(int productID) { ViewBag.Product = ProductAPIController.GetProductByID(productID); ViewBag.Comment = CommentAPIController.GetComment(ViewBag.Product.ProductID); ViewBag.QuantityBuy = 1; return(View()); }
public ActionResult ProductAdmin(int productID) { if (productID == 0) { ViewBag.Product = new Product(); } else { ViewBag.Product = ProductAPIController.GetProductByID(productID); } ViewBag.ImageURL = "~/images/" + ViewBag.Product.ImageName; ViewBag.CategoryList = CategoryAPIController.getAllCategoryAdmin(); return(View()); }