Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
Commerce Server
Development
Discount Class
Discount Methods
 Save Method
.NET Framework Class Library
Discount..::.Save Method
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Saves changes made to the current Discount object.

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

Visual Basic (Declaration)
Public Overrides Sub Save ( _
    forceOverwrite As Boolean _
)
Visual Basic (Usage)
Dim instance As Discount
Dim forceOverwrite As Boolean

instance.Save(forceOverwrite)
C#
public override void Save(
    bool forceOverwrite
)
Visual C++
public:
virtual void Save(
    bool forceOverwrite
) override
JScript
public override function Save(
    forceOverwrite : boolean
)

Parameters

forceOverwrite
Type: System..::.Boolean

true to force an overwrite; otherwise false.

ExceptionCondition
ArgumentException

One or more properties that describe the Discount is invalid. Please refer to actual exception message for more details.

ArgumentNullException

The Discount in the current instance was nullNothingnullptra null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The StartDate or EndDate of the current instance is set to an invalid date time value.

NotAuthorizedException

The user is not authorized to perform the requested updates.

EntityDoesNotExistException

One or more objects referred to by the current instance do not exist. For more information, see the actual exception message.

EntityStateException

An attempt was made to create or update a deleted Discount item object.

DuplicateEntityNameException

An attempt was made to create a Discount with a Name that already exists.

StringLengthValidationException

A string property of the Discount is too long or cannot be set to empty string. See individual properties for details.

PropertyNullValidationException

A string property of the Discount cannot be set to nullNothingnullptra null reference (Nothing in Visual Basic). See individual properties for details.

EnumeratedValueValidationException

An enumeration value of the Discount is not valid.

MaximumValueValidationException

One or more of the numeric property values of the current Discount object was set to a value greater than the maximum allowed.

MinimumValueValidationException

One or more of the numeric property values of the current Discount object was set to a value less than the minimum allowed.

OptimisticLockException

LastModifiedDate of the object was not set or the record was modified in the database since being loaded for editing. This exception is raised only if forceOverwrite is set false

InvalidOperationException

An attempt was made to update the Active status of an existing Discount through the Save API. To update this status, please use Activate or Deactivate.

Controls optimistic locking behavior. If the forceOverwrite parameter is false and the record was modified in the database after it was loaded for editing, then an exception is raised.

Save can be used to add a new Discount to the database or update an existing Discount in the database.

© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker