Ejemplo n.º 1
0
        public async Task AddOrUpdateCreditRate(DateTime date, float creditRate)
        {
            var exchangeRateFactors = await GetExchangeRateFactorsByDateInternal(date);

            if (exchangeRateFactors == null)
            {
                exchangeRateFactors = new Model.ExchangeRateFactors
                {
                    Date = date.Date
                };
                _context.ExchangeRateFactors.Add(exchangeRateFactors);
            }
            exchangeRateFactors.CreditRate = creditRate;
            await _context.SaveChangesAsync();
        }
Ejemplo n.º 2
0
        public async Task AddOrUpdateImportIndicator(DateTime date, float importIndicator)
        {
            var exchangeRateFactors = await GetExchangeRateFactorsByDateInternal(date);

            if (exchangeRateFactors == null)
            {
                exchangeRateFactors = new Model.ExchangeRateFactors
                {
                    Date = date.Date
                };
                _context.ExchangeRateFactors.Add(exchangeRateFactors);
            }
            exchangeRateFactors.ImportIndicator = importIndicator;
            await _context.SaveChangesAsync();
        }
Ejemplo n.º 3
0
        public async Task AddOrUpdateInflationIndex(DateTime date, float inflationIndex)
        {
            var exchangeRateFactors = await GetExchangeRateFactorsByDateInternal(date);

            if (exchangeRateFactors == null)
            {
                exchangeRateFactors = new Model.ExchangeRateFactors
                {
                    Date = date.Date
                };
                _context.ExchangeRateFactors.Add(exchangeRateFactors);
            }
            exchangeRateFactors.InflationIndex = inflationIndex;
            await _context.SaveChangesAsync();
        }
Ejemplo n.º 4
0
        public async Task AddOrUpdateExchangeRateUSD(DateTime date, decimal exchangeRateUSD)
        {
            var exchangeRateFactors = await GetExchangeRateFactorsByDateInternal(date);

            if (exchangeRateFactors == null)
            {
                exchangeRateFactors = new Model.ExchangeRateFactors
                {
                    Date = date.Date
                };
                _context.ExchangeRateFactors.Add(exchangeRateFactors);
            }
            exchangeRateFactors.ExchangeRateUSD = exchangeRateUSD;
            await _context.SaveChangesAsync();
        }