public ActionResult RemoveFromCart(int bookId)
        {
            int     numberOfItems     = cartMenager.RemoveFromCart(bookId);
            int     numberOfCartItems = cartMenager.DownloadQuantityOfCartItems();
            decimal cartValue         = cartMenager.DownloadCartValue();

            var result = new CartRemovalViewModel
            {
                IdItemsToRemove     = bookId,
                NumberItemsToRemove = numberOfItems,
                CartTotalPrice      = cartValue,
                CartQuantityItem    = numberOfCartItems
            };

            return(Json(result));
        }
Esempio n. 2
0
        public ActionResult RemoveFromCart(int AudiobookId2)
        {
            int     amountItems     = cartMenager.RemoveFromCart(AudiobookId2);
            int     amountItemsCart = cartMenager.DownloadAmountCartItem();
            decimal valueCart       = cartMenager.DdownloadValueOfTheCart();

            var result = new CartRemovalViewModel
            {
                IdItemRemoved      = AudiobookId2,
                AmountItemsRemoved = amountItems,
                CartPriceTotal     = valueCart,
                CartAmountItems    = amountItemsCart,
            };

            return(Json(result));
        }