コード例 #1
0
        public ActionResult Product()
        {
            var productCartMgr = new ProductCartManager();
            var productManager = new ProductManager();

            IList<ProductModel> productModels = productManager.GetallProducts();
            ViewBag.ItemsCount = productCartMgr.CountCartItems(GetShoppingCartId());

            return View(productModels);
        }
コード例 #2
0
 public ActionResult Index(ProductModel product)
 {
     var productCartMgr = new ProductCartManager();
     ViewBag.ItemsCount = productCartMgr.CountCartItems(GetShoppingCartId());
     ViewBag.ProductId = product.Id;
     ViewBag.Price = product.Price;
     ViewBag.ProductName = product.Name;
     ViewBag.Description = product.Description;
     var productManager = new ProductManager();
     var productImages = productManager.GetProductImagesById(product.Id);
     return View("ProductDetail", productImages);
 }