PurgeOldPromoCodes Method

Permanently removes the promotion code values and associated transaction history from the database for Discounts that meet the specified age-out criteria.

Namespace:  Microsoft.CommerceServer.Marketing
Assembly:  Microsoft.CommerceServer.Marketing.DataManagement (in Microsoft.CommerceServer.Marketing.DataManagement.dll)

Syntax

'Declaration
Public Sub PurgeOldPromoCodes ( _
    ageOutDays As Integer, _
    purgeOption As PromoCodePurgeOption _
)
'Usage
Dim instance As DataManager
Dim ageOutDays As Integer
Dim purgeOption As PromoCodePurgeOption

instance.PurgeOldPromoCodes(ageOutDays, _
    purgeOption)
public void PurgeOldPromoCodes(
    int ageOutDays,
    PromoCodePurgeOption purgeOption
)
public:
void PurgeOldPromoCodes(
    int ageOutDays, 
    PromoCodePurgeOption purgeOption
)
public function PurgeOldPromoCodes(
    ageOutDays : int, 
    purgeOption : PromoCodePurgeOption
)

Parameters

  • ageOutDays
    Type: System..::.Int32
    The minimum number of days the PromoCode information must have been deleted before it is removed from the database.

Exceptions

Exception Condition
ArgumentOutOfRangeException

ageOutDays is not within the range of allowed values. The minimum value allowed is 0 and the maximum allowed is the number of days between today and 1/1/1900 UTC.

ArgumentException

The purgeOption parameter passed in is not one of the valid PromoCodePurgeOption enum values.

SqlException

An error occurred while accessing the database logic.

Remarks

Purges the specified Promotion Code (discount) by deleting the records from the database.

Permissions

See Also

Reference

DataManager Class

DataManager Members

Microsoft.CommerceServer.Marketing Namespace