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

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

            return(View("Edit", model));
        }
예제 #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));
        }
예제 #3
0
 private void AssignModelToCurrencyRate(CurrencyRateCreateOrEditViewModel source, CurrencyRate destination)
 {
     destination.Rate       = source.Rate;
     destination.CurrencyId = source.CurrencyId.Value;
 }