Save Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Saves the current order group instance to the underlying data stores.

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

Syntax

'Declaration
Public Overridable Sub Save
'Usage
Dim instance As OrderGroup

instance.Save()
public virtual void Save()
public:
virtual void Save()
public function Save()

Exceptions

Exception Condition
SerializationException

A weakly-typed property entry not starting with an underscore (_) in a class instance was not serializable. All weakly-typed property entries that will be marshaled to storage (i.e., having no underscore prefix to prevent them being marshaled) must be serializable.

ConfiguredLimitExceededException

If you were to save this instance to the database you would exceed the specified maximum number of instances for this user. The maximum number of Basket or OrderTemplate objects in the database (controlled by the BasketsPerUser and OrderTemplatesPerUser attributes respectively) can be set within the Web.config file.

InvalidOperationException

The order group has been disposed, either directly or by conversion from an OrderTemplate to a Basket or a Basket to a PurchaseOrder.

Remarks

Basket and OrderTemplate will update LastModified and save to the database regardless of whether the Basket or OrderTemplate has had any other modification to it. This ensures that the LastModified time reflects the last time any code explicitly called Save.

PurchaseOrder will only write to the database if any property has been modified for the current instance and the SetDirty property for the instance has been set to true. PurchaseOrder does this as an optimization to reduce the number of writes to the database.

When a OrderGroup is serialized and saved to the database, the LastModified field is automatically updated even if no recent changes have been made to the OrderGroup. Created and LastModified are system properties that are written by the Commerce Server system. If you want to preserve OrderGroup properties that reflect historical Created and LastModified values, you should create a set of custom properties that are not overridden by the system.

Permissions

See Also

Reference

OrderGroup Class

OrderGroup Members

Microsoft.CommerceServer.Runtime.Orders Namespace