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
- promoCodeRecord
Type: Microsoft.CommerceServer.Runtime.Orders..::.PromoCodeRecord
The new PromoCodeRecord to add. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
PromoCodeRecordCollection Class