OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Server.MFinance.Common.TCurrencyInfo Class Reference

Base on the idea to reduce the number of database request to it's minimum, this object reads the complete a_currency table. Two currency slots are provided, a base currency slot and a foreigen currency slot. The the base currency slot can only set in one of the constructors one time and the foreign currency slot can easily be switched to an other currency by using the ForeignCurrencyCode property without and any more database request. More...

Public Member Functions

 TCurrencyInfo (string ACurrencyCode)
 Constructor which automatically loads the table and sets the value of the currency table. More...
 
 TCurrencyInfo (string ABaseCurrencyCode, string AForeignCurrencyCode)
 Constructor which automatically loads the table and sets the value of the base currency table and foreign currency table. More...
 
decimal RoundBaseCurrencyValue (decimal AValueToRound)
 This rotine handles a correct roundig by using the number of digits in a_currency More...
 
decimal RoundForeignCurrencyValue (decimal AValueToRound)
 This rotine handles a correct roundig by using the number of digits in a_currency More...
 
decimal ToBaseValue (decimal AForeignValue, decimal AExchangeRate)
 Here you can calculate the base value amount by defining the parameters below. Because of the rounding the ToBaseValue(ToForeignValue(someValue)) != someValue More...
 
decimal ToForeignValue (decimal ABaseValue, decimal AExchangeRate)
 Here you can calculate the base value amount by defining the parameters below. Because of the rounding the ToBaseValue(ToForeignValue(someValue)) != someValue More...
 

Properties

string CurrencyCode [get]
 Property to read the base currency code value. More...
 
string ForeignCurrencyCode [get, set]
 Property to read and to set the foreign currency code value. More...
 
int digits [get]
 Calculates the number of digits by reading the row.DisplayFormat Entry of the currency table and convert the old petra string to an integer response. More...
 
int foreignDigits [get]
 Calculates the number of digits for the foreign currency. More...
 

Detailed Description

Base on the idea to reduce the number of database request to it's minimum, this object reads the complete a_currency table. Two currency slots are provided, a base currency slot and a foreigen currency slot. The the base currency slot can only set in one of the constructors one time and the foreign currency slot can easily be switched to an other currency by using the ForeignCurrencyCode property without and any more database request.

The petra table a_currency contains a "hidden information" about the number of digits and this value will be used either to calculate the number of value dependet rounding digits. Furthermore there are some servic routines base on this information.

Constructor & Destructor Documentation

◆ TCurrencyInfo() [1/2]

Ict.Petra.Server.MFinance.Common.TCurrencyInfo.TCurrencyInfo ( string  ACurrencyCode)
inline

Constructor which automatically loads the table and sets the value of the currency table.

Parameters
ACurrencyCodeThree digit description to define the base currency.

◆ TCurrencyInfo() [2/2]

Ict.Petra.Server.MFinance.Common.TCurrencyInfo.TCurrencyInfo ( string  ABaseCurrencyCode,
string  AForeignCurrencyCode 
)
inline

Constructor which automatically loads the table and sets the value of the base currency table and foreign currency table.

Parameters
ABaseCurrencyCodeBase currency code
AForeignCurrencyCodeforeign Currency Code

Member Function Documentation

◆ RoundBaseCurrencyValue()

decimal Ict.Petra.Server.MFinance.Common.TCurrencyInfo.RoundBaseCurrencyValue ( decimal  AValueToRound)
inline

This rotine handles a correct roundig by using the number of digits in a_currency

Parameters
AValueToRound
Returns

◆ RoundForeignCurrencyValue()

decimal Ict.Petra.Server.MFinance.Common.TCurrencyInfo.RoundForeignCurrencyValue ( decimal  AValueToRound)
inline

This rotine handles a correct roundig by using the number of digits in a_currency

Parameters
AValueToRound
Returns

◆ ToBaseValue()

decimal Ict.Petra.Server.MFinance.Common.TCurrencyInfo.ToBaseValue ( decimal  AForeignValue,
decimal  AExchangeRate 
)
inline

Here you can calculate the base value amount by defining the parameters below. Because of the rounding the ToBaseValue(ToForeignValue(someValue)) != someValue

Parameters
AForeignValue
AExchangeRate
Returns

◆ ToForeignValue()

decimal Ict.Petra.Server.MFinance.Common.TCurrencyInfo.ToForeignValue ( decimal  ABaseValue,
decimal  AExchangeRate 
)
inline

Here you can calculate the base value amount by defining the parameters below. Because of the rounding the ToBaseValue(ToForeignValue(someValue)) != someValue

Parameters
ABaseValue
AExchangeRate
Returns

Property Documentation

◆ CurrencyCode

string Ict.Petra.Server.MFinance.Common.TCurrencyInfo.CurrencyCode
get

Property to read the base currency code value.

◆ digits

int Ict.Petra.Server.MFinance.Common.TCurrencyInfo.digits
get

Calculates the number of digits by reading the row.DisplayFormat Entry of the currency table and convert the old petra string to an integer response.

◆ ForeignCurrencyCode

string Ict.Petra.Server.MFinance.Common.TCurrencyInfo.ForeignCurrencyCode
getset

Property to read and to set the foreign currency code value.

◆ foreignDigits

int Ict.Petra.Server.MFinance.Common.TCurrencyInfo.foreignDigits
get

Calculates the number of digits for the foreign currency.


The documentation for this class was generated from the following file: