Partager via


Restore Method (Int32, String)

Restores a deleted Customer record, based upon its unique identifier, and gives it a new name.

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

Syntax

'Declaration
Public Sub Restore ( _
    customerId As Integer, _
    newCustomerName As String _
)
'Usage
Dim instance As CustomerManager
Dim customerId As Integer
Dim newCustomerName As String

instance.Restore(customerId, newCustomerName)
public void Restore(
    int customerId,
    string newCustomerName
)
public:
void Restore(
    int customerId, 
    String^ newCustomerName
)
public function Restore(
    customerId : int, 
    newCustomerName : String
)

Parameters

Exceptions

Exception Condition
ArgumentOutOfRangeException

customerId was less than one.

EntityDoesNotExistException

The requested customer record does not exist.

EntityStateException

The Customer is not currently deleted.

StringLengthValidationException

The new Customer name provided is not within the range of valid lengths.

DuplicateEntityNameException

newCustomerName contains the name of an existing Customer.

Remarks

If the newCustomerName is set to nullNothingnullptra null reference (Nothing in Visual Basic) or an empty string, the existing Customer name is restored.

Deleting a Customer does not actually remove the customer record from the database. These records are not permanently removed until the PurgeDeletedCustomers method is called to purge them from the database. This method allows you to restore the record before it is permanently deleted.

Permissions

See Also

Reference

CustomerManager Class

CustomerManager Members

Restore Overload

Microsoft.CommerceServer.Marketing Namespace