コード例 #1
0
 public ActionResult Create(CurrencyRate currencyrate, string userid)
 {
     if (ModelState.IsValid)
     {
         ICR.Add(currencyrate, Session["userid"].ToString());
     }
     return(View(currencyrate));
 }
コード例 #2
0
        public async Task <List <CurrencyRate> > GetCurrencyRates(DateTime date, string currency, string currencyDefault)
        {
            List <CurrencyRate> currencyRates = _currencyRateRepository.GetCurrencyItems(date, currency, currencyDefault);

            if (currencyRates.Select(c => c.BankId).ToList().Distinct().Count() == 0)
            {
                IEnumerable <CurrencyRate> rates = await _bankClientDataProvider.GetRatesFromBanks(date);

                _currencyRateRepository.Add(rates);
                currencyRates.AddRange(rates);
            }

            return(currencyRates);
        }