Share via


GetPurchaseOrder Method (Guid, String)

Returns an existing purchase order using the specified customer identifier and tracking number.

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

Syntax

'Declaration
Public Function GetPurchaseOrder ( _
    userId As Guid, _
    trackingNumber As String _
) As PurchaseOrder
'Usage
Dim instance As OrderContext
Dim userId As Guid
Dim trackingNumber As String
Dim returnValue As PurchaseOrder

returnValue = instance.GetPurchaseOrder(userId, _
    trackingNumber)
public PurchaseOrder GetPurchaseOrder(
    Guid userId,
    string trackingNumber
)
public:
PurchaseOrder^ GetPurchaseOrder(
    Guid userId, 
    String^ trackingNumber
)
public function GetPurchaseOrder(
    userId : Guid, 
    trackingNumber : String
) : PurchaseOrder

Parameters

  • userId
    Type: System..::.Guid
    The identifier of the customer owning this purchase order.

Return Value

Type: Microsoft.CommerceServer.Runtime.Orders..::.PurchaseOrder
An instance of the PurchaseOrder, or nullNothingnullptra null reference (Nothing in Visual Basic), if one is not found.

Exceptions

Exception Condition
ArgumentNullException

The specified customer identifier is nullNothingnullptra null reference (Nothing in Visual Basic) or Guid.Empty.

ArgumentException

trackingNumber is nullNothingnullptra null reference (Nothing in Visual Basic) or an empty string or a whitespace string.

SqlException

An error occurred while reading data from the SQL Server.

MappedClassDataMismatchException

Information retrieved for loading mapped classes does not match expected formats defined in the mapping. Likely this means there is a misconfigured SQL Server containing the wrong relational schema information. Alternately, the orders mapping file, OrderObjectMappings.xml, was modified and propagated to Web servers along with appropriate SQL schema changes, but new stored procedures were not generated using the OrderMapping.exe tool and applied to the SQL Server.

Remarks

Retrieves an existing PurchaseOrder object using the specified customer identifier and tracking number. If no purchase order exists matching the specified requirements, nullNothingnullptra null reference (Nothing in Visual Basic) is returned.

Permissions

See Also

Reference

OrderContext Class

OrderContext Members

GetPurchaseOrder Overload

Microsoft.CommerceServer.Runtime.Orders Namespace