本文整理汇总了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;
}
示例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;
}
示例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;
}