Table of Contents

Class StockUnit

Namespace
Dynamicweb.Ecommerce.Stocks
Assembly
Dynamicweb.Ecommerce.dll
Represents the stock unit.
public class StockUnit : StockUnitIdentifier
Inheritance
StockUnit
Inherited Members

Constructors

StockUnit()

Initializes a new instance of the class.
public StockUnit()

StockUnit(Product, string, long)

Initializes a new instance of the class.
[Obsolete("Use GetProductStockUnits instead")]
public StockUnit(Product product, string unitId, long stockLocationId)

Parameters

product Product
The product.
unitId string
The unit id.
stockLocationId long
The stock location id.

StockUnit(IDataReader)

Initializes a new instance of the class.
[Obsolete("This method is no longer used.")]
public StockUnit(IDataReader dataReader)

Parameters

dataReader IDataReader
The data reader.

Properties

AutoId

public int AutoId { get; }

Property Value

int

Depth

Gets or sets the depth.
public double Depth { get; set; }

Property Value

double

Description

Gets or sets a description of the unit for this product.
public string Description { get; set; }

Property Value

string

ExpectedDelivery

Gets or sets the expected delivery date.
public DateTime ExpectedDelivery { get; set; }

Property Value

DateTime

Height

Gets or sets the height.
public double Height { get; set; }

Property Value

double

NeverOutOfStock

Gets or sets value indicating whether to unit can be never out of stock.
public bool NeverOutOfStock { get; set; }

Property Value

bool

RowId

Gets or sets the row id.
[Obsolete("Use AutoId instead.")]
public int RowId { get; set; }

Property Value

int

StockQuantity

Gets or sets the stock quantity.
public double StockQuantity { get; set; }

Property Value

double

Volume

Gets or sets the volume.
public double Volume { get; set; }

Property Value

double

Weight

Gets or sets the weight.
public double Weight { get; set; }

Property Value

double

Width

Gets or sets the width.
public double Width { get; set; }

Property Value

double

Methods

Delete(int)

Deletes the stock unit.
[Obsolete("Use Services.StockService.DeleteStockUnit(Int32) instead.")]
public static void Delete(int id)

Parameters

id int
The id.

Delete(string, string)

Deletes the stock unit.
[Obsolete("Use DeleteProductStockUnits instead")]
public void Delete(string productId, string variantId)

Parameters

productId string
The product id.
variantId string
The variant id.

DeleteProductStockUnits(string, string)

Delete the product's stock units.
[Obsolete("Use Services.StockService.DeleteStockUnits(String, String) instead.")]
public static void DeleteProductStockUnits(string productId, string variantId)

Parameters

productId string
The product id.
variantId string
The variant id.

DeleteProductStockUnits(string, string, string, long)

Delete the product's stock units.
[Obsolete("Use Services.StockService.DeleteStockUnits(String, String, String, Int64) instead.")]
public static void DeleteProductStockUnits(string productId, string variantId, string unitId, long stockLocationId)

Parameters

productId string
The product id.
variantId string
The variant id.
unitId string
stockLocationId long

GetMaxRowID()

Gets max row id.
[Obsolete("Use Services.StockService.GetMaxStockUnitRowId() instead.", true)]
public static int GetMaxRowID()

Returns

int
The max id.

GetProductStockUnits(Product)

Gets the product's stock units.
[Obsolete("Use Services.StockService.GetStockUnits(String, String) instead.")]
public static StockUnitCollection GetProductStockUnits(Product product)

Parameters

product Product
The product.

Returns

StockUnitCollection
The collection of the StockUnit.

GetProductStockUnits(string, string)

Gets the product's stock units.
[Obsolete("Use Services.StockService.GetStockUnits(String, String) instead.")]
public static StockUnitCollection GetProductStockUnits(string productId, string variantId)

Parameters

productId string
The product id.
variantId string
The variant id.

Returns

StockUnitCollection
The collection of the StockUnit.

GetProductStockUnitsSorted(string)

Gets sorted product's stock units.
[Obsolete("Use VariantOptionService.GetStockUnitsSorted(String, String) instead.")]
public static IEnumerable<VariantOption> GetProductStockUnitsSorted(string productId)

Parameters

productId string
The product id.

Returns

IEnumerable<VariantOption>
The collection of the VariantOption.

GetProductStockUnitsSorted(string, string)

Gets sorted product's stock units.
[Obsolete("Use VariantOptionService.GetStockUnitsSorted(String, String) instead.")]
public static IEnumerable<VariantOption> GetProductStockUnitsSorted(string productId, string variantId)

Parameters

productId string
The product id.
variantId string
The variant id.

Returns

IEnumerable<VariantOption>
The collection of the VariantOption.

GetProductStockUnitsSorted(string, string, string)

Gets sorted product's stock units.
[Obsolete("Use VariantOptionService.GetStockUnitsSorted(String, String) instead.")]
public static IEnumerable<VariantOption> GetProductStockUnitsSorted(string productId, string variantId, string languageId)

Parameters

productId string
The product id.
variantId string
The variant id.
languageId string
The rendering language id.

Returns

IEnumerable<VariantOption>
The collection of the VariantOption.

GetProductStockUnitsWithVariants(Product)

Gets the product's and product variant's stock units.
[Obsolete("Use Services.StockService.GetStockUnitsWithVariants(Product) instead.")]
public static StockUnitCollection GetProductStockUnitsWithVariants(Product product)

Parameters

product Product
The product.

Returns

StockUnitCollection
The collection of the StockUnit.

GetStockUnitById(int)

Gets the stock unit by the id.
[Obsolete("Use Services.StockService.GetStockUnit(Int32) instead.")]
public static StockUnit GetStockUnitById(int id)

Parameters

id int
The id.

Returns

StockUnit
The stock unit.

GetStockUnitTotals(Product, string)

Gets the stock unit totals.
[Obsolete("Use Services.StockService.GetStockUnitTotals(Product, String) instead.")]
public static Tuple<double, double, double> GetStockUnitTotals(Product product, string currrentStockUnitId)

Parameters

product Product
The product.
currrentStockUnitId string
The stock unit id.

Returns

Tuple<double, double, double>
The totals.

LoadStockUnitsOnProducts(ProductCollection)

Loads the stock units for the products.
[Obsolete("This method is no longer used.")]
public static void LoadStockUnitsOnProducts(ProductCollection products)

Parameters

products ProductCollection
Product collection.

LoadStockUnitsOnProducts(IEnumerable<Product>)

Loads the stock units for the products.
[Obsolete("This method is no longer used.")]
public static void LoadStockUnitsOnProducts(IEnumerable<Product> products)

Parameters

products IEnumerable<Product>
Product collection.

Save()

Saves the stock unit.
[Obsolete("Use Services.StockService.SaveStockUnit(StockUnit) instead.")]
public void Save()

Save(int)

Saves the stock unit.
[Obsolete("Use Save() instead")]
public void Save(int id)

Parameters

id int
The id.

Save(string, string, string)

Saves the stock unit.
[Obsolete("Use Save() instead")]
public void Save(string productId, string variantId, string unitId)

Parameters

productId string
The product id.
variantId string
The variant id.
unitId string
The unit id.
To top