CustomCurrencyInfoProvider

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

This class provides the methods to work with currencies. Methods work with CMS.Ecommerce.CurrencyInfo class.

 

object GetCurrencyInfo(int currencyId) – returns the CurrencyInfo object by currency ID.
object GetCurrencyInfo(string currencyName) – returns the CurrencyInfo object by code name.
void SetCurrencyInfo(object currency) – inserts/updates the currency record to the database. If CurrencyID is set, it performs an update, else it performs a new currency insertion and initializes new record ID.
void DeleteCurrencyInfo(int currencyId) – deletes the currency record specified by its ID.
DataSet GetAllCurrencies() – returns the DataSet of all the currencies, see the database reference for the currency column definition.
DataSet GetCurrencies(string where, string orderBy) – returns the DataSet of all the currencies filtered by where condition and ordered by orderBy expression, see the database reference for the currency column definition.
DataSet GetCurrenciesWithExchangeRate() – returns the DataSet with currencies, that have a currently valid an exchange rate specified.
object GetMainCurrency() – returns the main (default) currency. The main currency has the CurrencyIsMain value set to true, all the others must have it set to false.
void RemoveMainCurrency() – removes the main currency flag from the currency records (it sets all CurrencyIsMain values to false)
double RoundTo(double price, int currencyId) – performs the price rounding based on the currency defined by its ID.
double RoundTo(double price, object ciObj) – performs the price rounding based on the given CurrencyInfo object.
string GetFormatedPrice(double price, object ciObj) – returns the price string formatted by given CurrencyInfo object content (CurrencyFormatString).
string GetFormatedValue(double price, object ciObj) – returns the string formatted by given CurrencyInfo object (to display the value without price, in grids etc.).
double GetLastValidExchangeRate(int currencyId) – returns the last valid exchange rate for given currency ID.
double GetCurrentValidExchangeRate(int currencyId) – returns the currently valid exchange rate for given currency ID.
double GetExchangeRate(int currencyId, DateTime time) – returns exchange rate for given currency ID at given time.
bool CheckDependencies(int currencyId) – returns true if some objects depend on the currency specified by its ID.
void RecalculateValues(double rate, bool updExchangeRates, bool updSKUs, bool updTaxes, bool updDiscountCoupons, bool updVolumeDiscounts, bool updCredit, bool updShippingOptions, bool updDocuments, bool updFreeShipping) - recalculates specified values with given exchange rate.

 

Page url: http://devnet.kentico.com/docs/5_5r2/ecommerceguide/index.html?customcurrencyinfoprovider.htm