示例#1
0
        public ActionResult AddItem(CartItem item)
        {
            var response = purchaseService.AddItem(new ServiceContract.Dto.AddItemRequest {
                ProductId  = item.ProductId,
                CustomerId = item.CustomerId
            });

            var cart = new ServiceContract.Dto.ShoppingCart();

            cart.CustomerId = response.CustomerId;
            cart.GoodsTotal = response.GoodsTotal;
            cart.Id         = response.Id;
            cart.Items      = response.Items;

            return(View("_MyCart", cart));
        }