Esempio n. 1
0
        public ActionResult AddToCart(string ProductId)
        {
            var prodId  = int.Parse(ProductId);
            var product = productHandler.GetProduct(prodId);

            var productForCart = new ProductViewModel
            {
                Name      = product.Name,
                Price     = product.Price,
                Quantity  = 1,
                ProductId = product.ProductId
            };

            ShoppingBag.AddToCart(productForCart);

            return(null);
        }