Add Method

Adds the specified PromoCodeRecord to the end of the PromoCodeRecordCollection.

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

Syntax

'Declaration
Public Sub Add ( _
    promoCodeRecord As PromoCodeRecord _
)
'Usage
Dim instance As PromoCodeRecordCollection
Dim promoCodeRecord As PromoCodeRecord

instance.Add(promoCodeRecord)
public void Add(
    PromoCodeRecord promoCodeRecord
)
public:
void Add(
    PromoCodeRecord^ promoCodeRecord
)
public function Add(
    promoCodeRecord : PromoCodeRecord
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

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

ArgumentException

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

EntityAlreadyExistsException

A PromoCodeRecord with the same name already exists in the collection.

ConfiguredLimitExceededException

The number of PromoCodeRecord instances in the collection is already at the PromoCodeRecordsPerOrderForm limit set in the web.config.

Remarks

Adds the specified PromoCodeRecord to the end of the PromoCodeRecordCollection. Successfully calling Add updates LastModified. ParentOrderForm and OrderGroupId will be set during an Add operation.

Permissions

See Also

Reference

PromoCodeRecordCollection Class

PromoCodeRecordCollection Members

Microsoft.CommerceServer.Runtime.Orders Namespace