public void UpdateTo(Country country) { country.Id = Id; country.Name = Name.Trim(); country.ThreeLetterIsoCode = ThreeLetterIsoCode; country.TwoLetterIsoCode = TwoLetterIsoCode; country.NumericIsoCode = NumericIsoCode; }
public CountryEditorModel(Country country) { Id = country.Id; Name = country.Name; ThreeLetterIsoCode = country.ThreeLetterIsoCode; TwoLetterIsoCode = country.TwoLetterIsoCode; NumericIsoCode = country.NumericIsoCode; }
public ActionResult Save(CountryEditorModel model, string @return) { var data = new JsonResultData(); data.RunWithTry(_ => { var country = new Country(); model.UpdateTo(country); _countryService.Save(country); data.RedirectUrl = @return; }); return Json(data); }