示例#1
0
 public CartResponse CreateCart()
 {
     CartResponse resp = new CartResponse();
     Entities.Cart c = DS.Cart.Cart.CreateCart();
     resp.CartID = c.CartID;
     resp.CreateDate = c.CreateDate;
     resp.ModifyDate = c.ModifyDate;
     resp.Total = resp.CartItems.Sum(i => i.Price);
     return resp;
 }
示例#2
0
 public CartResponse RemoveProduct(CartProductRequest request)
 {
     CartResponse resp = new CartResponse();
     Entities.Cart c = DS.Cart.Cart.RemoveProduct(request.CartID, request.ProductID);
     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;
 }