Пример #1
0
        public CurrencyConversionLibrary(Classes.Session.Session currentSession)
        {
            this.SetDefaults(currentSession);
            this.ValueFrom = 1;

            this.Currencies = new CurrencyLibrary();

            this.ChangeCurrencyRates(this.DefaultFromCurrency, this.DefaultToCurrency);
        }
Пример #2
0
 private void SetDefaults(Classes.Session.Session currentSession)
 {
     if (currentSession != null)
     {
         SessionDefaults defaults = currentSession.GetSessionDefaultsForUser(currentSession.UserID);
         this.DefaultFromCurrency = defaults.DefaultCurrencyFrom;
         this.DefaultToCurrency   = defaults.DefaultCurrencyTo;
     }
     else
     {
         this.DefaultToCurrency   = "EUR";
         this.DefaultFromCurrency = "USD";
     }
 }