Class Price
- Namespace
- Dynamicweb.Ecommerce.Prices
- Assembly
- Dynamicweb.Ecommerce.dll
Represents information about the price.
[Serializable]
[DataContract]
public class Price
- Inheritance
-
Price
- Inherited Members
Constructors
Price()
Initializes a new instance of the Price class.
public Price()
Price(IDataReader)
Initializes a new instance of the Price class.
public Price(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
Price(string)
Initializes a new instance of the Price class.
public Price(string id)
Parameters
id
string- DB field name is PriceID.
Fields
AnyVariantId
public const string AnyVariantId = "Any"
Field Value
Properties
Amount
Gets or sets the amount.
[DataMember]
public double Amount { get; set; }
Property Value
AmountString
Gets or sets the amount string.
[DataMember]
public string AmountString { get; set; }
Property Value
Country
Gets the country.
[IgnoreDataMember]
public Country Country { get; }
Property Value
CountryCode
Gets or sets the country id.
[DataMember]
public string CountryCode { get; set; }
Property Value
- string
- id
Currency
Gets the currency.
[IgnoreDataMember]
public Currency Currency { get; }
Property Value
CurrencyCode
Gets or sets the currency code.
[DataMember]
public string CurrencyCode { get; set; }
Property Value
CurrencyPrices
Gets or sets the currency prices.
[IgnoreDataMember]
public PriceCollection CurrencyPrices { get; set; }
Property Value
CustomerGroupId
Gets or sets the customer group id.
[DataMember]
public string CustomerGroupId { get; set; }
Property Value
ExternalId
Gets or sets the external id.
[DataMember]
public string ExternalId { get; set; }
Property Value
Id
Gets or sets the price id.
[DataMember]
public string Id { get; set; }
Property Value
IsInformative
Gets or sets the value indicating whether the price is informative.
[DataMember]
public bool IsInformative { get; set; }
Property Value
- bool
true
if the price is informative; otherwise,false
.
IsWithVat
Gets or sets the value indicating whether the price is with VAT.
[DataMember]
public bool IsWithVat { get; set; }
Property Value
LanguageId
Gets or sets the language id.
[DataMember]
public string LanguageId { get; set; }
Property Value
PeriodId
Gets or sets the period id.
[DataMember]
public string PeriodId { get; set; }
Property Value
Periods
Gets or sets the periods.
[IgnoreDataMember]
public IEnumerable<Period> Periods { get; set; }
Property Value
Priority
Gets or sets the priority.
[DataMember]
public int Priority { get; set; }
Property Value
ProductId
Gets or sets the product id.
[DataMember]
public string ProductId { get; set; }
Property Value
Quantity
Gets or sets the quantity.
[DataMember]
public double Quantity { get; set; }
Property Value
Shop
Gets the shop.
[IgnoreDataMember]
public Shop Shop { get; }
Property Value
ShopId
Gets or sets the shop id.
[DataMember]
public string ShopId { get; set; }
Property Value
StockLocationId
Gets or sets the stock location id.
[DataMember]
public long StockLocationId { get; set; }
Property Value
UnitId
Gets or sets the unit id.
[DataMember]
public string UnitId { get; set; }
Property Value
Units
Gets or sets the units.
[IgnoreDataMember]
public IEnumerable<VariantOption> Units { get; set; }
Property Value
User
Gets the user.
[IgnoreDataMember]
public User User { get; }
Property Value
UserCustomerNumber
Gets or sets the user customer number.
[DataMember]
public string UserCustomerNumber { get; set; }
Property Value
UserGroup
Gets the user group.
[IgnoreDataMember]
public Group UserGroup { get; }
Property Value
UserGroupId
Gets or sets the user group id.
[DataMember]
public string UserGroupId { get; set; }
Property Value
UserId
Gets or sets the user id.
[DataMember]
public string UserId { get; set; }
Property Value
ValidFrom
Gets or sets the start date.
[DataMember]
public DateTime? ValidFrom { get; set; }
Property Value
ValidTo
Gets or sets the end date.
[DataMember]
public DateTime? ValidTo { get; set; }
Property Value
VariantId
Gets or sets the variant id.
[DataMember]
public string VariantId { get; set; }
Property Value
VariantOptions
Gets or sets the variant options.
[IgnoreDataMember]
public IEnumerable<VariantOption> VariantOptions { get; set; }
Property Value
Methods
Clone()
Clones this instance.
public Price Clone()
Returns
Copy()
Copies this instance.
public Price Copy()
Returns
Delete()
Deletes this instance.
public void Delete()
Delete(ProductCollection)
[Obsolete("Use CommandBuilder Delete(IEnumerable<Product> products) method instead.")]
public string Delete(ProductCollection products)
Parameters
products
ProductCollection
Returns
Delete(ProductCollection, bool)
[Obsolete("Use CommandBuilder Delete(IEnumerable<Product> products, bool run) method instead.")]
public string Delete(ProductCollection products, bool run)
Parameters
products
ProductCollectionrun
bool
Returns
Delete(IEnumerable<Product>)
Deletes the specified instances from DB.
public CommandBuilder Delete(IEnumerable<Product> products)
Parameters
products
IEnumerable<Product>- The products.
Returns
- CommandBuilder
- The SQL query.
Delete(IEnumerable<Product>, bool)
Deletes the specified instances from DB.
public CommandBuilder Delete(IEnumerable<Product> products, bool run)
Parameters
products
IEnumerable<Product>- The products.
run
bool- If set to
true
to delete.
Returns
- CommandBuilder
- The SQL query.
Delete(string)
Deletes the specified instance from DB.
public void Delete(string id)
Parameters
id
string- DB field name is PriceID.
Delete(string, string)
Deletes the specified instance from DB.
public void Delete(string priceId, string productId)
Parameters
Delete(string, string, string)
Deletes the specified instance from DB.
public void Delete(string priceId, string productId, string currencyId)
Parameters
priceId
string- DB field name is PriceID.
productId
string- DB field name is PriceProductID.
currencyId
string
Delete(string, string, string, double)
Deletes the specified instance from DB.
public void Delete(string priceId, string productId, string currencyId, double quantity)
Parameters
priceId
string- DB field name is PriceID.
productId
string- DB field name is PriceProductID.
currencyId
string- DB field name is CurrencyID.
quantity
double- DB field name is PriceQuantity.
DeletePrices(Product)
Deletes the prices.
public static void DeletePrices(Product product)
Parameters
product
Product- DB field name is PriceProductID.
DeletePrices(IEnumerable<Price>)
Deletes the prices.
public static void DeletePrices(IEnumerable<Price> prices)
Parameters
prices
IEnumerable<Price>- A collection of the Price.
Fill(IDataReader)
Fills the properties from the data reader.
public void Fill(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader with data for properties.
GetDoublePriceFormatted(double, Currency, Country, bool)
Gets the double price formatted.
public static string GetDoublePriceFormatted(double price, Currency currency, Country country, bool showFormatted)
Parameters
price
double- The price in default currency.
currency
Currency- The target currency.
country
Country- The country used for VAT calculation.
showFormatted
bool- If set to
true
show with formatted symbol.
Returns
- string
- The formatted price.
GetDoublePriceFormatted(double, Currency, bool)
Gets the double price formatted.
[Obsolete("Use overload with currency and country instead.")]
public static string GetDoublePriceFormatted(double price, Currency currency, bool showFormatted)
Parameters
price
double- The price.
currency
Currency- The currency.
showFormatted
bool- If set to
true
show with formatted symbol.
Returns
- string
- The formatted price.
GetDoublePriceInfo(double, Currency)
Gets the double price info.
[Obsolete("Use overload with currency and country instead.")]
public static PriceInfo GetDoublePriceInfo(double price, Currency currency)
Parameters
Returns
GetDoublePriceInfo(double, Currency, Country)
Gets the price info from a double.
public static PriceInfo GetDoublePriceInfo(double price, Currency currency, Country country)
Parameters
price
double- The price in default currency.
currency
Currency- The currency.
country
Country- The country used for VAT calculation.
Returns
GetDoublePriceStatement(string)
Gets the double price statement.
[Obsolete]
public static string GetDoublePriceStatement(string productPrice)
Parameters
productPrice
string- The product price.
Returns
- string
- The SQL statement.
GetPrices(bool, string, double, string)
Gets the prices.
[Obsolete]
public static PriceCollection GetPrices(bool isDefault, string productId, double quantity, string currencyCode)
Parameters
isDefault
bool- DB field name is CurrencyIsDefault. If set to
true
the currency is default. productId
string- DB field name is PriceProductID.
quantity
double- DB field name is PriceQuantity.
currencyCode
string- DB field name is CurrencyCode.
Returns
GetPrices(string)
Gets the prices.
public static PriceCollection GetPrices(string productId)
Parameters
productId
string- DB field name is PriceProductID.
Returns
GetPrices(string, string)
Gets the prices.
public static PriceCollection GetPrices(string productId, string currencyId)
Parameters
Returns
GetPrices(string, string, string)
Gets the prices.
public static PriceCollection GetPrices(string productId, string currencyId, string priceId)
Parameters
productId
string- DB field name is PriceProductID.
currencyId
string- DB field name is PriceCurrency.
priceId
string- DB field name is PriceID.
Returns
GetPricesBySql(string)
public static List<Price> GetPricesBySql(string sql)
Parameters
sql
string
Returns
LoadPricesOnProducts(ProductCollection)
Loads the prices on products.
public static void LoadPricesOnProducts(ProductCollection products)
Parameters
products
ProductCollection- The products.
LoadPricesOnProducts(IEnumerable<Product>)
Loads the prices on products.
public static void LoadPricesOnProducts(IEnumerable<Product> products)
Parameters
products
IEnumerable<Product>- The products.
NumberOfDecimalPlaces(string)
Gets the number of decimal places.
public static int NumberOfDecimalPlaces(string number)
Parameters
number
string- The number.
Returns
- int
- The number of decimal places.
Save(string, string, string)
Saves the properties into DB.
public void Save(string id, string productId, string currencyCode)
Parameters
id
string- DB field name is PriceID.
productId
string- DB field name is PriceProductID.
currencyCode
string- DB field name is PriceCurrency.
SavePrices(IEnumerable<Price>)
Saves the prices.
public static void SavePrices(IEnumerable<Price> prices)
Parameters
prices
IEnumerable<Price>- A collection of the Price.