public ActionResult Create() { CurrencyRateCreateOrEditViewModel model = new CurrencyRateCreateOrEditViewModel(); model.Currencies = _currenciesBL.GetAll().Where(currency => !currency.IsMain).ToList(); return(View("Edit", model)); }
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)); }
private void AssignModelToCurrencyRate(CurrencyRateCreateOrEditViewModel source, CurrencyRate destination) { destination.Rate = source.Rate; destination.CurrencyId = source.CurrencyId.Value; }