当前位置: 首页>>代码示例>>C#>>正文


C# Order.GetLineItem方法代码示例

本文整理汇总了C#中MerchantTribe.Commerce.Orders.Order.GetLineItem方法的典型用法代码示例。如果您正苦于以下问题:C# Order.GetLineItem方法的具体用法?C# Order.GetLineItem怎么用?C# Order.GetLineItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MerchantTribe.Commerce.Orders.Order的用法示例。


在下文中一共展示了Order.GetLineItem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OrdersUnshipItems

        private bool OrdersUnshipItems(OrderPackage p, Order o)
        {
            bool result = true;

            if (p.Items.Count > 0)
            {
                if (o != null)
                {
                    if (o.bvin != string.Empty)
                    {
                        foreach (OrderPackageItem pi in p.Items)
                        {
                            if (pi.LineItemId > 0)
                            {
                                Orders.LineItem li = o.GetLineItem(pi.LineItemId);
                                if (li != null)
                                {
                                    int quantityToUnship = 0;
                                    if (li.QuantityShipped < pi.Quantity)
                                    {
                                        quantityToUnship = li.QuantityShipped;
                                    }
                                    else
                                    {
                                        quantityToUnship = pi.Quantity;
                                    }
                                    CatalogServices.InventoryLineItemUnShipQuantity(li, quantityToUnship);
                                }
                            }
                        }
                    }
                }
            }

            return result;
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:36,代码来源:MerchantTribeApplication.cs

示例2: ShipItems

        private OrderPackage ShipItems(Order o, string trackingNumber, string serviceProvider, string serviceCode, bool dontShip)
        {
            OrderPackage p = new OrderPackage();

            p.ShipDateUtc = DateTime.UtcNow;
            p.TrackingNumber = trackingNumber;
            p.ShippingProviderId = serviceProvider;
            p.ShippingProviderServiceCode = serviceCode;
            foreach (GridViewRow gvr in this.ItemsGridView.Rows)
            {
                if (gvr.RowType == DataControlRowType.DataRow)
                {
                    LineItem li = o.GetLineItem((long)this.ItemsGridView.DataKeys[gvr.RowIndex].Value);
                    if (li != null)
                    {

                        int qty = 0;
                        TextBox QtyToShip = (TextBox)gvr.FindControl("QtyToShip");
                        if (QtyToShip != null)
                        {
                            if (!int.TryParse(QtyToShip.Text, out qty))
                            {
                                qty = 0;
                            }
                        }
                        p.Items.Add(new OrderPackageItem(li.ProductId, li.Id, qty));
                        p.Weight += (li.ProductShippingWeight * qty);
                    }
                }
            }
            p.WeightUnits = WebAppSettings.ApplicationWeightUnits;

            o.Packages.Add(p);            
            if (!dontShip)
            {
                MTApp.OrdersShipPackage(p, o);
            }
            MTApp.OrderServices.Orders.Update(o);

            return p;
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:41,代码来源:ShipOrder.aspx.cs

示例3: OrdersShipItems

        private bool OrdersShipItems(OrderPackage p, Order o)
        {
            bool result = true;

            if (p.Items.Count > 0)
            {
                if (o != null)
                {
                    if (o.bvin != string.Empty)
                    {
                        foreach (OrderPackageItem pi in p.Items)
                        {
                            if (pi.LineItemId > 0)
                            {
                                Orders.LineItem li = o.GetLineItem(pi.LineItemId);
                                if (li != null)
                                {
                                    if (pi.Quantity > (li.Quantity - li.QuantityShipped))
                                    {
                                        pi.Quantity = li.Quantity - li.QuantityShipped;
                                    }

                                    if (pi.Quantity <= 0)
                                    {
                                        pi.Quantity = 0;
                                    }
                                    else
                                    {
                                        CatalogServices.InventoryLineItemShipQuantity(li, pi.Quantity);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            return result;
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:39,代码来源:MerchantTribeApplication.cs


注:本文中的MerchantTribe.Commerce.Orders.Order.GetLineItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。