Class OrderLineService
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
public class OrderLineService
- Inheritance
-
OrderLineService
- Inherited Members
Methods
AddOrderLineCopy(Order, OrderLine, bool)
Adds a copy of the specified order line.
public void AddOrderLineCopy(Order order, OrderLine orderLineToCopy, bool doMerge)
Parameters
orderOrderThe Order.
orderLineToCopyOrderLineThe order line.
doMergeboolif set to
truetry to merge.
CanBeMerged(OrderLine, OrderLine)
Determines whether the orderLine can be merged with the another order line.
public bool CanBeMerged(OrderLine orderLine, OrderLine another)
Parameters
Returns
- bool
trueif theorderLinecan be merged withanotherorder line; otherwise,false.
ClearCachedPrices(OrderLine)
Clears the cached price.
public void ClearCachedPrices(OrderLine orderLine)
Parameters
orderLineOrderLineThe Order line.
Create(Order, Product, double, StockUnit, PriceInfo)
Adds a new OrderLine to the OrderLineCollection of the Order based on the given Product.
public OrderLine Create(Order order, Product product, double quantity, StockUnit unit, PriceInfo unitPrice)
Parameters
orderOrderThe Order.
productProductThe Product.
quantitydoubleThe quantity.
unitStockUnitThe stock uint.
unitPricePriceInfoThe unit price.
Returns
Create(Order, string, double, PriceInfo, OrderLineType, string, string)
Adds a new OrderLine to the OrderLineCollection of the Order with the given OrderLineType and the given text.
public OrderLine Create(Order order, string text, double quantity, PriceInfo unitPrice, OrderLineType type, string parentOrderLineId, string discountId)
Parameters
orderOrderThe Order.
textstringThe line text.
quantitydoubleThe quantity.
unitPricePriceInfoThe unit price.
typeOrderLineTypeThe order line price.
parentOrderLineIdstringThe parent order line ID.
discountIdstringThe discount ID.
Returns
Delete(string)
Deletes the Order line from database.
public void Delete(string orderLineId)
Parameters
orderLineIdstringThe Order line ID.
DeleteAll(string)
Deletes all order lines from database for a given order including discounts, etc..
public void DeleteAll(string orderId)
Parameters
orderIdstringThe Order ID.
GetById(string)
Gets the order line by ID.
public OrderLine GetById(string orderLineId)
Parameters
orderLineIdstringThe Order line ID.
Returns
GetById(string, Order)
Gets the order line by ID.
public OrderLine GetById(string orderLineId, Order order)
Parameters
Returns
GetByOrder(Order)
Gets the lines of the specified order.
public IEnumerable<OrderLine> GetByOrder(Order order)
Parameters
orderOrderThe Order.
Returns
- IEnumerable<OrderLine>
The collection of the OrderLine.
GetOrderLineType(int)
Gets the OrderLineType of the OrderLine.
public OrderLineType GetOrderLineType(int orderLineType)
Parameters
orderLineTypeintThe integer equivalent of OrderLineType.
Returns
GetOrderLineType(string)
Gets the OrderLineType of the OrderLine.
public OrderLineType GetOrderLineType(string orderLineType)
Parameters
orderLineTypestringThe string equivalent of OrderLineType.
Returns
GetOrderLineUniqueKey(OrderLine)
public static string GetOrderLineUniqueKey(OrderLine orderLine)
Parameters
orderLineOrderLine
Returns
Save(OrderLine)
Saves the order line.
public void Save(OrderLine orderLine)
Parameters
orderLineOrderLineThe Order line.
Save(string, IEnumerable<OrderLine>)
Saves the order lines.
public void Save(string orderId, IEnumerable<OrderLine> orderLines)
Parameters
orderIdstringThe Order ID of the order lines.
orderLinesIEnumerable<OrderLine>The Order lines.
SetProductInformation(OrderLine, Product)
Sets the product information. Usually used for BOM products.
public void SetProductInformation(OrderLine orderLine, Product product)
Parameters
SetUnitPrice(OrderLine, PriceInfo)
Sets the unit price.
public void SetUnitPrice(OrderLine orderLine, PriceInfo priceInfo)
Parameters
SetUnitPrice(OrderLine, PriceInfo, bool)
Sets the unit price.
public void SetUnitPrice(OrderLine orderLine, PriceInfo priceInfo, bool forcePriceRecalculation)
Parameters
orderLineOrderLineThe Order line.
priceInfoPriceInfoThe unit price.
forcePriceRecalculationboolDetermines whether the order line price should be recalculated.
SetUnitPrice(OrderLine, double, bool)
Sets the unit price.
public void SetUnitPrice(OrderLine orderLine, double theUnitPrice, bool applyToCurrentProductSettings)
Parameters
orderLineOrderLineThe Order line.
theUnitPricedoubleThe unit price.
applyToCurrentProductSettingsboolDetermines whether price should be applied to the order line product.
SetUnitPrice(OrderLine, double, bool, bool)
Sets the unit price.
public void SetUnitPrice(OrderLine orderLine, double theUnitPrice, bool applyToCurrentProductSettings, bool priceIsWithVat)