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
order
OrderThe Order.
orderLineToCopy
OrderLineThe order line.
doMerge
boolif set to
true
try 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
true
if theorderLine
can be merged withanother
order line; otherwise,false
.
ClearCachedPrices(OrderLine)
Clears the cached price.
public void ClearCachedPrices(OrderLine orderLine)
Parameters
orderLine
OrderLineThe 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
order
OrderThe Order.
product
ProductThe Product.
quantity
doubleThe quantity.
unit
StockUnitThe stock uint.
unitPrice
PriceInfoThe 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
order
OrderThe Order.
text
stringThe line text.
quantity
doubleThe quantity.
unitPrice
PriceInfoThe unit price.
type
OrderLineTypeThe order line price.
parentOrderLineId
stringThe parent order line ID.
discountId
stringThe discount ID.
Returns
Delete(string)
Deletes the Order line from database.
public void Delete(string orderLineId)
Parameters
orderLineId
stringThe Order line ID.
DeleteAll(string)
Deletes all order lines from database for a given order including discounts, etc..
public void DeleteAll(string orderId)
Parameters
orderId
stringThe Order ID.
GetById(string)
Gets the order line by ID.
public OrderLine GetById(string orderLineId)
Parameters
orderLineId
stringThe 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
order
OrderThe Order.
Returns
- IEnumerable<OrderLine>
The collection of the OrderLine.
GetOrderLineType(int)
Gets the OrderLineType of the OrderLine.
public OrderLineType GetOrderLineType(int orderLineType)
Parameters
orderLineType
intThe integer equivalent of OrderLineType.
Returns
GetOrderLineType(string)
Gets the OrderLineType of the OrderLine.
public OrderLineType GetOrderLineType(string orderLineType)
Parameters
orderLineType
stringThe string equivalent of OrderLineType.
Returns
GetOrderLineUniqueKey(OrderLine)
public static string GetOrderLineUniqueKey(OrderLine orderLine)
Parameters
orderLine
OrderLine
Returns
Save(OrderLine)
Saves the order line.
public void Save(OrderLine orderLine)
Parameters
orderLine
OrderLineThe Order line.
Save(string, IEnumerable<OrderLine>)
Saves the order lines.
public void Save(string orderId, IEnumerable<OrderLine> orderLines)
Parameters
orderId
stringThe Order ID of the order lines.
orderLines
IEnumerable<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
orderLine
OrderLineThe Order line.
priceInfo
PriceInfoThe unit price.
forcePriceRecalculation
boolDetermines 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
orderLine
OrderLineThe Order line.
theUnitPrice
doubleThe unit price.
applyToCurrentProductSettings
boolDetermines 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)