Table of Contents

Class Currency

Namespace
Dynamicweb.Ecommerce.International
Assembly
Dynamicweb.Ecommerce.dll
Represents the currency.
[Serializable]
public class Currency : ICloneable
Inheritance
Currency
Implements
Inherited Members

Constructors

Currency()

Creates a new instance of Currency.
public Currency()

Properties

Code

Gets or sets the currency code.
public string Code { get; set; }

Property Value

string

CultureInfo

Gets or sets the culture information.
public string CultureInfo { get; set; }

Property Value

string

IsDefault

Gets or sets the value indicating whether the currency is default.
public bool IsDefault { get; set; }

Property Value

bool

LanguageId

Gets or sets the language id.
[Obsolete("Use Translations instead.")]
public string LanguageId { get; set; }

Property Value

string

Name

Gets or sets the name.
[Obsolete("Use GetName and SetName instead.")]
public string Name { get; set; }

Property Value

string

NegativePattern

Gets or sets the negative pattern for this Currency. Only used if CultureInfo is used. http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.currencynegativepattern(v=vs.110).aspx
public int NegativePattern { get; set; }

Property Value

int

PayGatewayCode

Gets or sets the code of pay gateway.
public int PayGatewayCode { get; set; }

Property Value

int

PositivePattern

Gets or sets the positive pattern for this Currency. Only used if CultureInfo is used. http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.currencypositivepattern(v=vs.110).aspx
public int PositivePattern { get; set; }

Property Value

int

Rate

Gets or sets the rate.
public double Rate { get; set; }

Property Value

double

Rounding

Gets or sets the Rounding.
public Rounding Rounding { get; set; }

Property Value

Rounding

RoundingId

Gets or sets the rounding id.
public string RoundingId { get; set; }

Property Value

string

Symbol

Gets or sets the symbol.
public string Symbol { get; set; }

Property Value

string

SymbolPlace

Gets or sets the symbol place.
public int SymbolPlace { get; set; }

Property Value

int

Translations

Gets the translations
public TranslationCollection<CurrencyTranslation> Translations { get; }

Property Value

TranslationCollection<CurrencyTranslation>

UseCurrencyCodeForFormat

Gets or sets a value indicating whether to use currency code for formatting prices instead of symbo, i.e. 'EUR 1000' instead of 'Ђ 1000'.
public bool UseCurrencyCodeForFormat { get; set; }

Property Value

bool
true if currency code should bed used for price formatting; otherwise, false.

Methods

Clone()

Creates a new instance of a class with the same value as an existing instance.
public object Clone()

Returns

object

Remarks

Method performs a deep copy of all properties except the IsReadOnly property. IsReadOnly property always is set to False.

DefaultCount()

Gets the count of the default currencies.
[Obsolete("Is not used")]
public static int DefaultCount()

Returns

int
The count of the default currencies.

Delete()

Deletes this instance.
[Obsolete("Use Ecommerce.Services.Currencies.Delete instead")]
public void Delete()

Delete(string)

Deletes an instance with the specified parameters.
[Obsolete("Use Ecommerce.Services.Currencies.Delete instead")]
public void Delete(string code)

Parameters

code string
The currency code.

Delete(string, string)

Deletes an instance with the specified parameters.
[Obsolete("Use Ecommerce.Services.Currencies.Delete instead")]
public void Delete(string code, string languagId)

Parameters

code string
The currency code.
languagId string
The language id.

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Format(double)

Formats the specified value according to the currency settings.
[Obsolete("Use Ecommerce.Services.Currencies.Format instead")]
public string Format(double value)

Parameters

value double
The value - the price to format to a string.

Returns

string
The formatted value.

Format(double, bool)

Formats the specified value according to the currency settings.
[Obsolete("Use Ecommerce.Services.Currencies.Format instead")]
public string Format(double value, bool showSymbol)

Parameters

value double
The value - the price to format to a string.
showSymbol bool
if set to true includes the currency symbol.

Returns

string
The formatted value.

GetAllCurrencies()

Gets all currencies.
[Obsolete("Use Ecommerce.Services.Currencies.GetCurrencies() instead")]
public static CurrencyCollection GetAllCurrencies()

Returns

CurrencyCollection
A collection of the Currency.

GetCurrenciesForCode(string)

Gets all currencies by the specified parameters.
[Obsolete("Use Ecommerce.Services.Currencies.GetCurrenciesForCode instead")]
public static CurrencyCollection GetCurrenciesForCode(string code)

Parameters

code string
The currency code.

Returns

CurrencyCollection
A collection of the Currency.

GetCurrenciesForLanguage(string)

Gets all currencies by the specified parameters.
[Obsolete("Use Ecommerce.Services.Currencies.GetCurrenciesForLanguage instead")]
public static CurrencyCollection GetCurrenciesForLanguage(string languageId)

Parameters

languageId string
The language id.

Returns

CurrencyCollection
A collection of the Currency.

GetName(string)

Gets the name of the currency for the given language.
public string GetName(string languageId)

Parameters

languageId string

Returns

string

GetTranslation(string)

[Obsolete("Use Translations.Get(languageId) instead.")]
public CurrencyTranslation GetTranslation(string languageId)

Parameters

languageId string

Returns

CurrencyTranslation

Lock()

Makes this inctance to read only.
[Obsolete("Is not used")]
public void Lock()

RemoveTranslation(string)

[Obsolete("Use Translations.Remove(languageId) instead.")]
public void RemoveTranslation(string languageId)

Parameters

languageId string

Round(double)

Rounds the value.
[Obsolete("Use Ecommerce.Services.Currencies.Round instead")]
public double Round(double value)

Parameters

value double
The value.

Returns

double
The rounded value.

Save(string)

Saves an instance with the specified parameters.
[Obsolete("Use Ecommerce.Services.Currencies.Save instead")]
public void Save(string code)

Parameters

code string
The currency code.

Save(string, string)

Saves an instance with the specified parameters.
[Obsolete("Use Ecommerce.Services.Currencies.Save instead")]
public void Save(string code, string languageId)

Parameters

code string
The currency code.
languageId string
The language id.

SetName(string, string)

Sets the name of the currency for the given language.
public void SetName(string languageId, string name)

Parameters

languageId string
name string

SetTranslation(CurrencyTranslation)

[Obsolete("Use Translations.Set(translation) instead.")]
public void SetTranslation(CurrencyTranslation translation)

Parameters

translation CurrencyTranslation

UpdateDefault(bool)

Changes the value of "CurrencyIsDefault" property.
[Obsolete("Use Ecommerce.Services.Currencies.CleanDefault instead")]
public void UpdateDefault(bool setDefaultTo)

Parameters

setDefaultTo bool
New value for "CurrencyIsDefault" property.

UpdateDefault(bool, string)

Changes the value of "CurrencyIsDefault" property.
[Obsolete("Use Ecommerce.Services.Currencies.CleanDefault instead")]
public void UpdateDefault(bool setDefaultTo, string code)

Parameters

setDefaultTo bool
New value for "CurrencyIsDefault" property.
code string
The currency code.

UpdateForAllLanguages(Currency, string)

Updates currency for all languages.
[Obsolete("Use Ecommerce.Services.Currencies.UpdateForAllLanguages instead")]
public void UpdateForAllLanguages(Currency currency, string code)

Parameters

currency Currency
The currency.
code string
The currency id.
To top