次の方法で共有


Add Method (LineItem)

Add a specified LineItem to the end of the LineItemCollection.

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

Syntax

'Declaration
Public Sub Add ( _
    lineItem As LineItem _
)
'Usage
Dim instance As LineItemCollection
Dim lineItem As LineItem

instance.Add(lineItem)
public void Add(
    LineItem lineItem
)
public:
void Add(
    LineItem^ lineItem
)
public function Add(
    lineItem : LineItem
)

Parameters

Exceptions

Exception Condition
ConfiguredLimitExceededException

The number of line items within the current instance exceeds the LineItemCountPerOrderFormLimit set in the Web.config file.

ArgumentNullException

lineItem is nullNothingnullptra null reference (Nothing in Visual Basic).

ArgumentException

The entry being added is already a member of a collection.

EntityAlreadyExistsException

A LineItem that matches the new line item is already in the current instance.

Remarks

Add a LineItem to the end of the LineItemCollection.

Successfully calling Add updates LastModified. Add will not clone the line item being added prior to adding it to the collection. Add will add the line item without checking for an existing duplicate entry. Add will not clone the line item being added prior to adding it to the collection. Calling Add(LineItem) will set the ParentOrderForm, OrderFormId, OrderGroupId, and Index properties.

Permissions

See Also

Reference

LineItemCollection Class

LineItemCollection Members

Add Overload

Microsoft.CommerceServer.Runtime.Orders Namespace