public static MOrderItem FromParams(OrderItemParams orderItemParams) { return(new MOrderItem() { ProductId = orderItemParams.ProductId }); }
public static OrderItemModel FromParams(OrderItemParams orderItemParams) { return(new OrderItemModel() { ProductId = orderItemParams.ProductId }); }
public async Task RemoveFromCartAsync(OrderParams orderParams, OrderItemParams item) { orderParams.Items.Remove(item); if (orderParams.Items.Count == 0) { Carts.Remove(orderParams); } await UpdateCartAsync(); }
public async Task RemoveFromCartAsync(OrderParams orderParams, OrderItemParams item) { if (Carts == null) { await ReloadCartAsync(); } orderParams.Items.Remove(item); if (orderParams.Items.Count == 0) { Carts.Remove(orderParams); } await SaveCartAsync(); }
private async Task AddToCartAsync() { if (IsInCart) { return; } var orderItem = new OrderItemParams() { ProductId = ProductId, Product = Product }; await CartService.AddToCartAsync(orderItem); StateHasChanged(); NavigationManager.NavigateTo("/cart"); }
public async Task AddToCartAsync(OrderItemParams item) { OrderParams orderParams = Carts.FirstOrDefault(x => x.SellerId == item.Product.SellerId); if (orderParams == null) { orderParams = new OrderParams() { SellerId = item.Product.SellerId, PaymentMethod = OrderConstants.Methods.PayPal, Seller = item.Product.Seller, Items = new List <OrderItemParams>() }; Carts.Add(orderParams); } orderParams.Items.Add(item); await UpdateCartAsync(); }
public async Task AddToCartAsync(OrderItemParams item) { if (Carts == null) { await ReloadCartAsync(); } var orderParams = Carts.FirstOrDefault(x => x.SellerId == item.Product.SellerId); if (orderParams == null) { orderParams = new OrderParams() { SellerId = item.Product.SellerId, PaymentMethod = PaymentContants.PayPal, Seller = item.Product.Seller, Items = new List <OrderItemParams>() }; Carts.Add(orderParams); } orderParams.Items.Add(item); await SaveCartAsync(); }
private async Task RemoveFromCartAsync(OrderParams cart, OrderItemParams item) { await CartService.RemoveFromCartAsync(cart, item); }
public OrderItemTask OrderItem(OrderItemParams @params) { var task = new OrderItemTask() { Params = @params }; QueueOrder(task); return task; }
public async Task RemoveFromCartAsync(OrderItemParams item) { await OnRemoveFromCart.InvokeAsync(item); }