Class ItemService
Inheritance
Implements
Namespace: DirectScale.Disco.Extension.Services
Assembly: DirectScale.Disco.Extension.Abstractions.dll
Syntax
public class ItemService : Object, IItemService
Constructors
ItemService(IApiService)
Declaration
public ItemService(IApiService apiService)
Parameters
Type | Name | Description |
---|---|---|
IApiService | apiService |
Methods
GetItem(Int32)
Read inventory item record with itemId
.
Declaration
public Task<InventoryItem> GetItem(int itemId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | itemId | Item DB recordnumber. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InventoryItem> | Specified InventoryItem if found, or an empty inventory item. |
GetLineItemById(Int32, Double, String, String, Int32, Int32, Int32, Int32, String)
Instantiates a LineItem with supplied information and base InventoryItem found by itemId
.
Declaration
public Task<LineItem> GetLineItemById(int itemId, double qty, string currencyCode, string languageCode, int regionId, int orderType, int priceGroup, int storeId, string countryCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | itemId | The base InventoryItem's recordnumber Id. |
System.Double | qty | The quantity of the item being purchased. |
System.String | currencyCode | The currency used for the order. |
System.String | languageCode | Used to populate Description, ProductName, and Specifications correctly. |
System.Int32 | regionId | Used to calculate correct Price. |
System.Int32 | orderType | Used to calculate correct Price. |
System.Int32 | priceGroup | Used to calculate correct Price. |
System.Int32 | storeId | Used to calculate correct Price. |
System.String | countryCode | Used to calculate correct Price taxes. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LineItem> | LineItem instance, or null if |
See Also
GetLineItemBySku(String, Double, String, String, Int32, Int32, Int32, Int32, String)
Instantiates a LineItem with supplied information and base InventoryItem found by sku
.
Declaration
public Task<LineItem> GetLineItemBySku(string sku, double qty, string currencyCode, string languageCode, int regionId, int orderType, int priceGroup, int storeId, string countryCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | sku | The base InventoryItem's SKU. |
System.Double | qty | The quantity of the item being purchased. |
System.String | currencyCode | The currency used for the order. |
System.String | languageCode | Used to populate Description, ProductName, and Specifications correctly. |
System.Int32 | regionId | Used to calculate correct Price. |
System.Int32 | orderType | Used to calculate correct Price. |
System.Int32 | priceGroup | Used to calculate correct Price. |
System.Int32 | storeId | Used to calculate correct Price. |
System.String | countryCode | Used to calculate correct Price taxes. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LineItem> | LineItem instance, or null if |
See Also
GetLineItems(Int32, String, String, Int32, Int32, Int32, Int32, Int32, String)
Instantiates LineItems with supplied information and base InventoryItems that belong to specified categoryId
and productClass
.
Declaration
public Task<LineItem[]> GetLineItems(int categoryId, string currencyCode, string languageCode, int regionId, int orderType, int priceGroup, int storeId, int productClass, string countryCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | categoryId | Category of items requested. |
System.String | currencyCode | The currency used for the order. |
System.String | languageCode | Used to populate Description, ProductName, and Specifications correctly. |
System.Int32 | regionId | Used to calculate correct Price. |
System.Int32 | orderType | Used to calculate correct Price. |
System.Int32 | priceGroup | Used to calculate correct Price. |
System.Int32 | storeId | Used to calculate correct Price. |
System.Int32 | productClass | Product class of items requested. |
System.String | countryCode | Used to calculate correct Price taxes. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LineItem[]> | LineItem instances for items in |
Remarks
Calls
See Also
GetLineItemsForAssociate(Int32, Int32, Int32, Int32, String, Address)
Instantiates LineItems with supplied information, using associateId
's address and language and base InventoryItems found by productClass
.
Declaration
public Task<LineItem[]> GetLineItemsForAssociate(int associateId, int priceGroup, int storeId, int productClass, string countryCode, Address addressOverride = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | associateId | Associate to use. |
System.Int32 | priceGroup | Used to calculate correct Price. |
System.Int32 | storeId | Used to calculate correct Price. |
System.Int32 | productClass | |
System.String | countryCode | Used to calculate correct Price taxes. |
Address | addressOverride | Optional. Used instead of associate's address if not null. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LineItem[]> |
Remarks
Calls GetLineItems(Int32, String, String, Int32, Int32, Int32, Int32, Int32, String) using address and language for associateId
and passing 0 for categoryId and orderType.
SaveItem(InventoryItem)
Declaration
public Task<int> SaveItem(InventoryItem item)
Parameters
Type | Name | Description |
---|---|---|
InventoryItem | item |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32> |