コード例 #1
0
        public async Task <IActionResult> Get(int CartID)
        {
            if (!ModelState.IsValid)
            {
                return(Response(new ResultResponse("Parâmetros inválidos")));
            }

            IResultResponse <IList <CartResponse> > carts = await _appService.Get(CartID);

            return(Response(null));
        }
コード例 #2
0
        public ActionResult RemoveFromCart(int id)
        {
            // Remove the item from the cart
            var cart = ShoppingCart.GetCart(HttpContext);

            // Get the name of the album to display confirmation
            var albumName = _cartAppService.Get(id).Album.Title;

            // Remove from cart
            var itemCount = cart.RemoveFromCart(id);

            // Display the confirmation message
            var results = new ShoppingCartRemoveViewModel
            {
                Message = Server.HtmlEncode(albumName) +
                          " has been removed from your shopping cart.",
                CartTotal = cart.GetTotal(),
                CartCount = cart.GetCount(),
                ItemCount = itemCount,
                DeleteId  = id
            };

            return(Json(results));
        }
コード例 #3
0
 public ActionResult <CartDto> Get(int id)
 {
     return(_cartAppService.Get(id));
 }
コード例 #4
0
        public async Task <IActionResult> Index()
        {
            var response = await _cartAppService.Get();

            return(PartialView(response));
        }