GetPurchaseOrdersForUser Method (Guid, DateTime, DateTime)
Returns the collection of PurchaseOrder objects associated with the specified customer and with the purchase order performed within specified time periods.
Namespace: Microsoft.CommerceServer.Runtime.Orders
Assembly: Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)
Syntax
'Declaration
Public Function GetPurchaseOrdersForUser ( _
userId As Guid, _
startDate As DateTime, _
endDate As DateTime _
) As OrderGroupCollection
'Usage
Dim instance As OrderContext
Dim userId As Guid
Dim startDate As DateTime
Dim endDate As DateTime
Dim returnValue As OrderGroupCollection
returnValue = instance.GetPurchaseOrdersForUser(userId, _
startDate, endDate)
public OrderGroupCollection GetPurchaseOrdersForUser(
Guid userId,
DateTime startDate,
DateTime endDate
)
public:
OrderGroupCollection^ GetPurchaseOrdersForUser(
Guid userId,
DateTime startDate,
DateTime endDate
)
public function GetPurchaseOrdersForUser(
userId : Guid,
startDate : DateTime,
endDate : DateTime
) : OrderGroupCollection
Parameters
- userId
Type: System..::.Guid
The identifier of the customer owning the purchase orders.
- startDate
Type: System..::.DateTime
Start Date in local server time zone. PurchaseOrder objects completed before this time should not be returned.
- endDate
Type: System..::.DateTime
End Date in local server time zone. PurchaseOrder objects completed after this time should not be returned.
Return Value
Type: Microsoft.CommerceServer.Runtime.Orders..::.OrderGroupCollection
A collection of PurchaseOrder objects associated with the specified customer and completed within the specified time periods, if any are found. otherwise, nullNothingnullptra null reference (Nothing in Visual Basic).
Exceptions
Exception | Condition |
---|---|
ArgumentException | userId is empty (Guid.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
Returns a collection of PurchaseOrder objects associated with the specified customer and completed within the specified time periods, if any are found. otherwise, nullNothingnullptra null reference (Nothing in Visual Basic).
The startDate and endDate is at the day level.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.