GetShippingMethods Method
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
Returns the list of configured shipping methods for all languages.
Namespace: Microsoft.CommerceServer.Runtime.Orders
Assembly: Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)
Syntax
'Declaration
Public Function GetShippingMethods As DataSet
'Usage
Dim instance As OrderContext
Dim returnValue As DataSet
returnValue = instance.GetShippingMethods()
public DataSet GetShippingMethods()
public:
DataSet^ GetShippingMethods()
public function GetShippingMethods() : DataSet
Return Value
Type: System.Data..::.DataSet
A DataSet containing multiple datatables containing the shipping methods that are enabled for each language.
Remarks
GetShippingMethods caches shipping methods, and returns shipping methods from the cache if the shipping method cache is configured. GetShippingMethods queries the database only when the cache is not configured.
Shipping methods are stored in the database table named ShippingMethod in the transaction configuration database. Seven columns are returned:
ShippingMethodId SQL Data Type: uniqueidentifier
LanguageId SQL Data Type: nvarchar(128)
ShippingMethodName SQL Data Type: nvarchar(255)
Description SQL Data Type: nvarchar(255)
ShippingCostCalculator SQL Data Type: nvarchar(255)
ConfiguredMode SQL Data Type: int
ActionPage SQL Data Type: nvarchar(255)
ActionFriendlyName SQL Data Type: nvarchar(255)
For example, assume that the Shipping Methods listed in the following table have been configured for your Commerce Server Web application.
ShippingMethodId |
LanguageId |
ShippingMethodName |
IsDefault |
Enabled |
---|---|---|---|---|
SM1 |
en-US |
SM1-enUS |
True |
True |
SM1 |
fr-FR |
SM1-frFR |
False |
True |
SM2 |
fr-FR |
SM2-frFR |
True |
True |
SM3 |
en-US |
SM3-enUS |
True |
True |
SM3 |
de-DE |
SM3-deDE |
False |
True |
In your site code, you execute the following code:
DataSet allShippingMethods = OrderContext.Current.GetShippingMethods();
The dataset allShippingMethods will contain three tables:
The table named "en-US" will contain records for SM1-enUS and SM3-enUS.
Tha table named "fr-FR" will contain records for SM1-frFR and SM2-frFR.
The table named "de-DE" will contain a record for SM3-deDE.
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.