コード例 #1
0
 public static MOrderItem FromParams(OrderItemParams orderItemParams)
 {
     return(new MOrderItem()
     {
         ProductId = orderItemParams.ProductId
     });
 }
コード例 #2
0
 public static OrderItemModel FromParams(OrderItemParams orderItemParams)
 {
     return(new OrderItemModel()
     {
         ProductId = orderItemParams.ProductId
     });
 }
コード例 #3
0
        public async Task RemoveFromCartAsync(OrderParams orderParams, OrderItemParams item)
        {
            orderParams.Items.Remove(item);
            if (orderParams.Items.Count == 0)
            {
                Carts.Remove(orderParams);
            }

            await UpdateCartAsync();
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        private async Task AddToCartAsync()
        {
            if (IsInCart)
            {
                return;
            }

            var orderItem = new OrderItemParams()
            {
                ProductId = ProductId,
                Product   = Product
            };

            await CartService.AddToCartAsync(orderItem);

            StateHasChanged();
            NavigationManager.NavigateTo("/cart");
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        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();
        }
コード例 #8
0
 private async Task RemoveFromCartAsync(OrderParams cart, OrderItemParams item)
 {
     await CartService.RemoveFromCartAsync(cart, item);
 }
コード例 #9
0
 public OrderItemTask OrderItem(OrderItemParams @params)
 {
     var task = new OrderItemTask() { Params = @params };
     QueueOrder(task);
     return task;
 }
コード例 #10
0
 public async Task RemoveFromCartAsync(OrderItemParams item)
 {
     await OnRemoveFromCart.InvokeAsync(item);
 }