Example #1
0
        public ActionResult Create()
        {
            CurrencyRateCreateOrEditViewModel model = new CurrencyRateCreateOrEditViewModel();

            model.Currencies = _currenciesBL.GetAll().Where(currency => !currency.IsMain).ToList();

            return(View("Edit", model));
        }
Example #2
0
        public ActionResult Edit(int id)
        {
            CurrencyRate currencyRate = _currencyRatesBL.Get(id);
            CurrencyRateCreateOrEditViewModel model = new CurrencyRateCreateOrEditViewModel
            {
                MainCurrency = _currenciesBL.GetMainCurrency(),
                Id           = id,
                Rate         = currencyRate.Rate,
                CurrencyId   = currencyRate.CurrencyId,
                Currencies   = _currenciesBL.GetAll().Where(currency => !currency.IsMain).ToList()
            };

            return(View(model));
        }
Example #3
0
 private void AssignModelToCurrencyRate(CurrencyRateCreateOrEditViewModel source, CurrencyRate destination)
 {
     destination.Rate       = source.Rate;
     destination.CurrencyId = source.CurrencyId.Value;
 }