public BusinessCartContract.Cart DeleteItemsFromCart(string cartId, BusinessCartContract.Items deleteItems) { ProxyCartContract.Items proxyItems = Mapper.Map <BusinessCartContract.Items, ProxyCartContract.Items>(deleteItems); ProxyCartContract.Cart cart = this.cartService.DeleteItemsFromCart(cartId, proxyItems); BusinessCartContract.Cart businessCart = this.ConvertToBusinessCart(cart); return(businessCart); }
public void UpdateItems(Items item) { BusinessCartContract.Items businessItem = Mapper.Map <UICartContract.Items, BusinessCartContract.Items>(item); cartBL = new CartBL(new Credential { UserName = InterplayStorage.SelectedUser.UserName, Password = InterplayStorage.SelectedUser.Password }); BusinessCartContract.Cart cart = null; // Open the cart while adding the first item to the cart if (CartInstance == null || CartInstance.id == null) { cart = cartBL.OpenCart(); // dont use below mapper, its creating new objects, loosing the event handlers, so do it manually //_instance = this.ConvertToUICart(cart); UpdateUIContract(cart, _instance); } if (_instance.status == "OPEN" && _instance.type == "Cart") { cart = cartBL.AddItemsToCart(_instance.id, businessItem); // dont use below mapper, its creating new objects, loosing the event handlers, so do it manually //_instance = this.ConvertToUICart(cart); UpdateUIContract(cart, _instance); if (this.cartItemUpdated != null) { this.cartItemUpdated.Invoke(_instance); } } }
public BusinessCartContract.Cart AddItemsToCart(string cartId, BusinessCartContract.Items addItems) { ProxyCartContract.Items proxyItems = Mapper.Map <BusinessCartContract.Items, ProxyCartContract.Items>(addItems); ProxyCartContract.Cart cart = this.cartService.AddItemsToCart(cartId, proxyItems); BusinessCartContract.Cart businessCart = this.ConvertToBusinessCart(cart); return(businessCart); }