Exemplo n.º 1
0
 public void UpdateTo(Country country)
 {
     country.Id = Id;
     country.Name = Name.Trim();
     country.ThreeLetterIsoCode = ThreeLetterIsoCode;
     country.TwoLetterIsoCode = TwoLetterIsoCode;
     country.NumericIsoCode = NumericIsoCode;
 }
Exemplo n.º 2
0
 public CountryEditorModel(Country country)
 {
     Id = country.Id;
     Name = country.Name;
     ThreeLetterIsoCode = country.ThreeLetterIsoCode;
     TwoLetterIsoCode = country.TwoLetterIsoCode;
     NumericIsoCode = country.NumericIsoCode;
 }
Exemplo n.º 3
0
        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);
        }