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
orderOrder- The Order.
orderLineToCopyOrderLine- The order line.
doMergebool- if 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
orderLineOrderLine- The Order line.
Create(Order, Product, double, StockUnit, PriceInfo)
public OrderLine Create(Order order, Product product, double quantity, StockUnit unit, PriceInfo unitPrice)
Parameters
orderOrder- The Order.
productProduct- The Product.
quantitydouble- The quantity.
unitStockUnit- The stock uint.
unitPricePriceInfo- The unit price.
Returns
Create(Order, Product, double, StockUnit, PriceInfo, Currency, Country)
[Obsolete("Use Create(Order, Product, Double, StockUnit, PriceInfo) instead.")]
public OrderLine Create(Order order, Product product, double quantity, StockUnit unit, PriceInfo unitPrice, Currency currency, Country country)
Parameters
orderOrder- The Order.
productProduct- The Product.
quantitydouble- The quantity.
unitStockUnit- The stock unit.
unitPricePriceInfo- The unit price.
currencyCurrency- The currency.
countryCountry- The country.
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
orderOrder- The Order.
textstring- The line text.
quantitydouble- The quantity.
unitPricePriceInfo- The unit price.
typeOrderLineType- The order line price.
parentOrderLineIdstring- The parent order line ID.
discountIdstring- The discount ID.
Returns
Create(Order, string, double, PriceInfo, OrderLineType, string, string, Currency)
Adds a new OrderLine to the OrderLineCollection of the Order with the given OrderLineType and the given text.
[Obsolete("Use Create(Order, String, Double, PriceInfo, OrderLineType, String, String) instead.")]
public OrderLine Create(Order order, string text, double quantity, PriceInfo unitPrice, OrderLineType type, string parentOrderLineId, string discountId, Currency currency)
Parameters
orderOrder- The Order.
textstring- The line text.
quantitydouble- The quantity.
unitPricePriceInfo- The unit price.
typeOrderLineType- The order line price.
parentOrderLineIdstring- The parent order line ID.
discountIdstring- The discount ID.
currencyCurrency- The currency.
Returns
Delete(string)
Deletes the Order line from database.
public void Delete(string orderLineId)
Parameters
orderLineIdstring- The Order line ID.
DeleteAll(string)
Deletes all order lines from database for a given order including discounts, etc..
public void DeleteAll(string orderId)
Parameters
orderIdstring
GetById(string)
Gets the order line by ID.
public OrderLine GetById(string orderLineId)
Parameters
orderLineIdstring- The Order line ID.
Returns
GetById(string, Currency)
Gets the order line by ID.
[Obsolete("Use GetById(String, Order) instead.")]
public OrderLine GetById(string orderLineId, Currency currency)
Parameters
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
orderOrder- The Order.
Returns
- IEnumerable<OrderLine>
- The collection of the OrderLine.
GetByOrder(Order, Currency)
Gets the lines of the specified order.
[Obsolete("Use GetByOrder(Order) instead.")]
public IEnumerable<OrderLine> GetByOrder(Order order, Currency currency)
Parameters
Returns
- IEnumerable<OrderLine>
- The collection of the OrderLine.
GetOrderLine(string)
Gets the order line by ID.
[Obsolete("Use GetById(String, Order) instead.")]
public OrderLine GetOrderLine(string orderLineId)
Parameters
orderLineIdstring- The Order line ID.
Returns
GetOrderLines(Order)
Gets the lines of the specified order.
[Obsolete("Use 'GetByOrder' instead")]
public IEnumerable<OrderLine> GetOrderLines(Order order)
Parameters
orderOrder- The Order.
Returns
- IEnumerable<OrderLine>
- The collection of the OrderLine.
GetOrderLineType(int)
Gets the OrderLineType of the OrderLine.
public OrderLineType GetOrderLineType(int orderLineType)
Parameters
orderLineTypeint- The integer equivalent of OrderLineType.
Returns
GetOrderLineType(string)
Gets the OrderLineType of the OrderLine.
public OrderLineType GetOrderLineType(string orderLineType)
Parameters
orderLineTypestring- The string equivalent of OrderLineType.
Returns
GetOrderLineUniqueKey(OrderLine)
public static string GetOrderLineUniqueKey(OrderLine orderLine)
Parameters
orderLineOrderLine
Returns
GetProductImage(OrderLine, int?)
Returns the path to the product image.
public string GetProductImage(OrderLine orderLine, int? areaId)
Parameters
Returns
- string
- The path to the product image.
OrderLineBuilder(Order, OrderLineBuilderConfig)
Builds an OrderLine based on the given OrderLineBuilderConfig.
[Obsolete("Use Services.Carts.OrderLineBuilder(Order, OrderLineBuilderConfig) instead.")]
public OrderLine OrderLineBuilder(Order order, OrderLineBuilderConfig builderConfiguration)
Parameters
orderOrderbuilderConfigurationOrderLineBuilderConfig- The builder configuration.
Returns
Save(OrderLine)
Saves the order line.
public void Save(OrderLine orderLine)
Parameters
orderLineOrderLine- The Order line.
Save(string, IEnumerable<OrderLine>)
Saves the order lines.
public void Save(string orderId, IEnumerable<OrderLine> orderLines)
Parameters
orderIdstring- The 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
SetProductInformation(OrderLine, Product, string, string)
Sets the product information.
Usually used for BOM products.
[Obsolete("Use SetProductInformation(OrderLine, Product) instead.")]
public void SetProductInformation(OrderLine orderLine, Product product, string currencyCode, string vatCountryCode)
Parameters
orderLineOrderLine- The Order line.
productProduct- The product.
currencyCodestring- The currency code.
vatCountryCodestring- The country code.
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
orderLineOrderLine- The Order line.
priceInfoPriceInfo- The unit price.
forcePriceRecalculationbool- Determines whether the order line price should be recalculated.
SetUnitPrice(OrderLine, double)
Sets the unit price.
[Obsolete("Use SetUnitPrice(OrderLine, Double, Boolean) instead.")]
public void SetUnitPrice(OrderLine orderLine, double theUnitPrice)
Parameters
SetUnitPrice(OrderLine, double, bool)
Sets the unit price.
public void SetUnitPrice(OrderLine orderLine, double theUnitPrice, bool applyToCurrentProductSettings)
Parameters
orderLineOrderLine- The Order line.
theUnitPricedouble- The unit price.
applyToCurrentProductSettingsbool- Determines whether price should be applied to the order line product.
SetUnitPrice(OrderLine, double, bool, Currency, Country)
Sets the unit price.
[Obsolete("Use SetUnitPrice(OrderLine, Double, Boolean) instead.")]
public void SetUnitPrice(OrderLine orderLine, double theUnitPrice, bool applyToCurrentProductSettings, Currency currency, Country country)