Пример #1
0
 public CartResponse GetCart(CartRequest request)
 {
     CartResponse resp = new CartResponse();
     Entities.Cart c = DS.Cart.Cart.GetCart(request.CartID);
     resp.CartID = c.CartID;
     resp.CreateDate = c.CreateDate;
     resp.ModifyDate = c.ModifyDate;
     resp.CartItems = GetProducts(c.ProductIDs);
     resp.Total = resp.CartItems.Sum(i => i.Price);
     return resp;
 }
Пример #2
0
 private void DisplayCart()
 {
     if (Session["CartID"] != null)
     {
         int cartID = (int)Session["CartID"];
         GetCartClient client = new GetCartClient();
         CartRequest req = new CartRequest();
         req.CartID = cartID;
         CartResponse resp = client.GetCart(req);
         DisplayCart(resp);
     }
 }