예제 #1
0
        public decimal CalculatePriceInTheMainCurrency(int currencyIdOfThePrice, decimal price, DateTime date)
        {
            Currency mainCurrency = _currenciesRepository.GetMainCurrency();

            if (currencyIdOfThePrice == mainCurrency.Id)
            {
                return(price);
            }

            CurrencyRate currencyRate = _currencyRatesRepository.GetActualRate(currencyIdOfThePrice, date);

            return(currencyRate.Rate * price);
        }
예제 #2
0
 public Currency GetMainCurrency()
 {
     return(_currenciesRepository.GetMainCurrency());
 }