Поделиться через


GetPurchaseOrder Method (Guid, Guid)

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

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

Syntax

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

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

Parameters

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

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

userId or orderGroupId is empty.

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 purchase order identifier. 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