public ActionResult AddToCart(int productId, int count)
        {
            var product = _productService.GetViewModel(productId);

            if (count <= product.StockQuantity)
            {
                _cartManager.AddToCart(productId, count);

                return(SuccessResult());
            }
            else
            {
                return(ErrorResult(Messages.OutOfStockQuantity));
            }
        }
Exemple #2
0
        public ActionResult ViewDetail(int id)
        {
            var model = _productService.GetViewModel(id);

            return(View("ViewDetail", model));
        }