Partager via


Save Method (String)

Saves the order template to the database using the specified order template name.

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

Syntax

'Declaration
Public Sub Save ( _
    templateName As String _
)
'Usage
Dim instance As OrderTemplate
Dim templateName As String

instance.Save(templateName)
public void Save(
    string templateName
)
public:
void Save(
    String^ templateName
)
public function Save(
    templateName : String
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

templateName is nullNothingnullptra null reference (Nothing in Visual Basic).

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 customer. The number of OrderTemplate objects allowed per user can be set by the OrderTemplatesPerUser parameter in the Web.config file.

InvalidOperationException

The current order template instance has been deleted, either directly or by conversion to a basket.

Remarks

Saves the order template to the database using the specified order template name. When a OrderTemplate is serialized and saved to the database, the LastModified field is automatically updated even if no recent changes have been made to the OrderTemplate. Created and LastModified are system properties that are written by the Commerce Server system. If you want to preserve OrderTemplate 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

OrderTemplate Class

OrderTemplate Members

Save Overload

Microsoft.CommerceServer.Runtime.Orders Namespace