Table of Contents

Class StockService

Namespace
Dynamicweb.Ecommerce.Stocks
Assembly
Dynamicweb.Ecommerce.dll
public class StockService : ICacheStorage<LanguageBasedKey<string>, IEnumerable<ProductStock>>, ICacheStorage<LanguageBasedKey<string>>, ICacheStorage
Inheritance
StockService
Implements
Inherited Members

Constructors

StockService()

public StockService()

Methods

ClearCache()

Resets all keys to the default value for objects stored in the object cache
public void ClearCache()

ClearCache(LanguageBasedKey<string>)

Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(LanguageBasedKey<string> key)

Parameters

key LanguageBasedKey<string>
Key to reset

ClearCache(IEnumerable<LanguageBasedKey<string>>)

Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<LanguageBasedKey<string>> keys)

Parameters

keys IEnumerable<LanguageBasedKey<string>>
Keys to reset

ClearStockGroupCache()

public void ClearStockGroupCache()

CreateStockLocationRelation(string, long)

public void CreateStockLocationRelation(string shopId, long stockLocationId)

Parameters

shopId string
stockLocationId long

DeleteAllStockLocationRelationsFromShop(string)

public void DeleteAllStockLocationRelationsFromShop(string shopId)

Parameters

shopId string

DeleteStockGroup(string)

public void DeleteStockGroup(string stockGroupId)

Parameters

stockGroupId string

DeleteStockLocation(StockLocation)

public void DeleteStockLocation(StockLocation theStockLocation)

Parameters

theStockLocation StockLocation

DeleteStockLocation(StockLocation, long)

[Obsolete]
public void DeleteStockLocation(StockLocation theStockLocation, long id)

Parameters

theStockLocation StockLocation
id long

DeleteStockLocationCategory(string)

public void DeleteStockLocationCategory(string locationCategoryId)

Parameters

locationCategoryId string

DeleteStockLocationRelation(string, long)

public void DeleteStockLocationRelation(string shopId, long stockLocationId)

Parameters

shopId string
stockLocationId long

DeleteStockLocationRelations(StockLocation)

public void DeleteStockLocationRelations(StockLocation theStockLocation)

Parameters

theStockLocation StockLocation

DeleteStockStatus(StockStatus)

public void DeleteStockStatus(StockStatus theStockStatus)

Parameters

theStockStatus StockStatus

DeleteStockStatusesByGroupId(string)

public void DeleteStockStatusesByGroupId(string groupId)

Parameters

groupId string

DeleteStockUnit(StockUnitIdentifier)

public void DeleteStockUnit(StockUnitIdentifier identifier)

Parameters

identifier StockUnitIdentifier

DeleteStockUnitDetail(StockUnitDetail)

public void DeleteStockUnitDetail(StockUnitDetail detail)

Parameters

detail StockUnitDetail

DeleteStockUnitDetail(StockUnitDetailIdentifier)

public void DeleteStockUnitDetail(StockUnitDetailIdentifier identifier)

Parameters

identifier StockUnitDetailIdentifier

DeleteStockUnits(string, string)

public void DeleteStockUnits(string productId, string variantId)

Parameters

productId string
variantId string

DeleteStockUnits(string, string, string, long)

public void DeleteStockUnits(string productId, string variantId, string unitId, long stockLocationId)

Parameters

productId string
variantId string
unitId string
stockLocationId long

GetMaxStockUnitRowId()

[Obsolete("Never worked as intended.")]
public int GetMaxStockUnitRowId()

Returns

int

GetStockGroup(string)

public StockGroup GetStockGroup(string id)

Parameters

id string

Returns

StockGroup

GetStockGroups()

public IEnumerable<StockGroup> GetStockGroups()

Returns

IEnumerable<StockGroup>

GetStockLocation(Product, long)

[Obsolete("Use the GetStockLocation instead.")]
public StockLocation GetStockLocation(Product product, long stockLocationId)

Parameters

product Product
stockLocationId long

Returns

StockLocation

GetStockLocation(long)

public StockLocation GetStockLocation(long stockLocationId)

Parameters

stockLocationId long

Returns

StockLocation

GetStockLocation(long, string)

[Obsolete("Use the overload without languageId and then use Translations on the stock location.")]
public StockLocation GetStockLocation(long stockLocationId, string languageId)

Parameters

stockLocationId long
languageId string

Returns

StockLocation

GetStockLocationCategories()

public IEnumerable<StockLocationCategory> GetStockLocationCategories()

Returns

IEnumerable<StockLocationCategory>

GetStockLocationCategory(string)

public StockLocationCategory GetStockLocationCategory(string id)

Parameters

id string

Returns

StockLocationCategory

GetStockLocationRelations(string)

public IEnumerable<StockLocation> GetStockLocationRelations(string shopId)

Parameters

shopId string

Returns

IEnumerable<StockLocation>

GetStockLocations()

public IEnumerable<StockLocation> GetStockLocations()

Returns

IEnumerable<StockLocation>

GetStockLocations(Product)

public IEnumerable<StockLocation> GetStockLocations(Product product)

Parameters

product Product

Returns

IEnumerable<StockLocation>

GetStockLocations(Product, string)

[Obsolete("Use the overload without languageId and then use Translations on the stock location.")]
public IEnumerable<StockLocation> GetStockLocations(Product product, string languageId)

Parameters

product Product
languageId string

Returns

IEnumerable<StockLocation>

GetStockLocations(bool)

public IEnumerable<StockLocation> GetStockLocations(bool sortByOrder)

Parameters

sortByOrder bool

Returns

IEnumerable<StockLocation>

GetStockLocations(long)

[Obsolete("Use the GetStockLocation instead and then use Translations on the stock location.")]
public IEnumerable<StockLocation> GetStockLocations(long groupId)

Parameters

groupId long

Returns

IEnumerable<StockLocation>

GetStockLocations(string)

[Obsolete("Use the overload without languageId and then use Translations on the stock location.")]
public IEnumerable<StockLocation> GetStockLocations(string languageId)

Parameters

languageId string

Returns

IEnumerable<StockLocation>

GetStockLocations(string, bool)

[Obsolete("Use the overload without languageId and then use Translations on the stock location.")]
public IEnumerable<StockLocation> GetStockLocations(string languageId, bool showUntranslated)

Parameters

languageId string
showUntranslated bool

Returns

IEnumerable<StockLocation>

GetStockStatus(string)

public StockStatus GetStockStatus(string id)

Parameters

id string

Returns

StockStatus

GetStockStatus(string, string)

[Obsolete("Use GetStockStatus(string) overload instead.")]
public StockStatus GetStockStatus(string id, string languageId)

Parameters

id string
languageId string

Returns

StockStatus

GetStockStatuses(string, bool)

public IEnumerable<StockStatus> GetStockStatuses(string statusGroupId, bool orderBy)

Parameters

statusGroupId string
orderBy bool

Returns

IEnumerable<StockStatus>

GetStockStatuses(string, bool, string)

[Obsolete("Use GetStockStatuses(String, Bool) overload instead.")]
public IEnumerable<StockStatus> GetStockStatuses(string statusGroupId, bool orderBy, string languageId)

Parameters

statusGroupId string
orderBy bool
languageId string

Returns

IEnumerable<StockStatus>

GetStockUnit(StockUnitIdentifier)

public StockUnit GetStockUnit(StockUnitIdentifier identifier)

Parameters

identifier StockUnitIdentifier

Returns

StockUnit

GetStockUnit(int)

[Obsolete("Use other GetStockUnit overload.")]
public StockUnit GetStockUnit(int rowId)

Parameters

rowId int

Returns

StockUnit

GetStockUnit(string, string, string, StockLocation)

public StockUnit GetStockUnit(string productId, string variantId, string unitId, StockLocation stockLocation)

Parameters

productId string
variantId string
unitId string
stockLocation StockLocation

Returns

StockUnit

GetStockUnitDetail(StockUnitDetailIdentifier)

public StockUnitDetail GetStockUnitDetail(StockUnitDetailIdentifier identifier)

Parameters

identifier StockUnitDetailIdentifier

Returns

StockUnitDetail

GetStockUnits(string, string)

public IEnumerable<StockUnit> GetStockUnits(string productId, string variantId)

Parameters

productId string
variantId string

Returns

IEnumerable<StockUnit>

GetStockUnitsByUnitId(string)

public IEnumerable<StockUnit> GetStockUnitsByUnitId(string unitId)

Parameters

unitId string

Returns

IEnumerable<StockUnit>

GetStockUnitsWithVariants(Product)

[Obsolete("Use GetStockUnitsWithVariants(productId) instead.")]
public IEnumerable<StockUnit> GetStockUnitsWithVariants(Product product)

Parameters

product Product

Returns

IEnumerable<StockUnit>

GetStockUnitsWithVariants(string)

public IEnumerable<StockUnit> GetStockUnitsWithVariants(string productId)

Parameters

productId string

Returns

IEnumerable<StockUnit>

GetStockUnitTotals(Product, string)

public Tuple<double, double, double> GetStockUnitTotals(Product product, string unitId)

Parameters

product Product
unitId string

Returns

Tuple<double, double, double>

SaveStockGroup(StockGroup)

public StockGroup SaveStockGroup(StockGroup theStockGroup)

Parameters

theStockGroup StockGroup

Returns

StockGroup

SaveStockLocation(StockLocation)

public void SaveStockLocation(StockLocation theStockLocation)

Parameters

theStockLocation StockLocation

SaveStockLocationCategory(StockLocationCategory)

public void SaveStockLocationCategory(StockLocationCategory stockLocationCategory)

Parameters

stockLocationCategory StockLocationCategory

SaveStockStatus(StockStatus)

public void SaveStockStatus(StockStatus theStockStatus)

Parameters

theStockStatus StockStatus

SaveStockStatus(StockStatus, string)

[Obsolete("Use SaveStockStatus(StockStatus) overload instead.")]
public void SaveStockStatus(StockStatus theStockStatus, string id)

Parameters

theStockStatus StockStatus
id string

SaveStockUnit(StockUnit)

public void SaveStockUnit(StockUnit theStockUnit)

Parameters

theStockUnit StockUnit

SaveStockUnitDetail(StockUnitDetail)

public void SaveStockUnitDetail(StockUnitDetail detail)

Parameters

detail StockUnitDetail
To top