Dijeli putem


ConvertToBasket Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Converts the current order template to a basket.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Function ConvertToBasket As Basket
'Usage
Dim instance As OrderTemplate
Dim returnValue As Basket

returnValue = instance.ConvertToBasket()
public Basket ConvertToBasket()
public:
Basket^ ConvertToBasket()
public function ConvertToBasket() : Basket

Return Value

Type: Microsoft.CommerceServer.Runtime.Orders..::.Basket
A newly-created Basket.

Exceptions

Exception Condition
OrderGroupConversionException

A OrderTemplate or a Basket has the same name but is of a different type.

InvalidOperationException

The current order template has been converted to a basket. No further operations are permited on this order template. You can, however, perform operations on the new basket.

Remarks

Conversion rules:

  • Both strongly and weakly-typed properties on an OrderTemplate which have matching strongly-typed properties on a basket will be carried over as strongly-typed basket properties. Consider the example of two properties: prop1 and prop2. When defined on an OrderTemplate, "prop1" is strongly-typed and "prop2" is weakly-typed. When defined on a Basket, both "prop1" and "prop2" are strongly typed. A call to ConvertToBasket populates the strongly-typed properties of the basket with the data in the strongly- and weakly-typed properties of the OrderTemplate.

  • Both strongly and weakly-typed properties on an OrderTemplate which do not have matching strongly-typed properties on a basket will carried over as weakly-typed basket properties. Strongly-typed or weakly-typed properties in the OrderTemplate having no corresponding strongly-typed property name in the Basket will be added to the Basket as weakly-typed properties.

Permissions

See Also

Reference

OrderTemplate Class

OrderTemplate Members

Microsoft.CommerceServer.Runtime.Orders Namespace