다음을 통해 공유


Save Method

Saves the current Customer object to the database.

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

Syntax

'Declaration
Public Sub Save ( _
    forceOverwrite As Boolean _
)
'Usage
Dim instance As Customer
Dim forceOverwrite As Boolean

instance.Save(forceOverwrite)
public void Save(
    bool forceOverwrite
)
public:
void Save(
    bool forceOverwrite
)
public function Save(
    forceOverwrite : boolean
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

Customer was nullNothingnullptra null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The Id of the Customer is set to a negative value.

EntityDoesNotExistException

The Id of the Customer was set to a nonzero value, indicating an update operation, but the specified Customer does not exist in the database.

StringLengthValidationException

One or more string property values of the Customer was set to a disallowed value. For more information, see the exception thrown.

PropertyNullValidationException

One or more property values of the Customer was set to nullNothingnullptra null reference (Nothing in Visual Basic) when not allowed. For more information, see the exception thrown.

DuplicateEntityNameException

A customer already exists with the specified name. This is only allowed if the other customer record is marked as deleted, but not otherwise.

DuplicateEntityIdException

The customer Id specified already exists in the database.

OptimisticLockException

An optimistic locking conflict was detected or the LastModifiedDate of the customer was not set. This exception will never be raised if forceOverwrite is set to true.

EntityStateException

An attempt was made to update an existing customer record that is deleted. The customer must first be restored before it can be modified.

Remarks

Saves changes to the database. Upon completion sets the HasChanges property to false.

Use forceOverwrite to prevent overwriting the object in the database. This will raise an exception if set to false and the record was modified in the database after it was loaded for editing.

Permissions

See Also

Reference

Customer Class

Customer Members

Microsoft.CommerceServer.Marketing Namespace