Exemple #1
0
 public CountryRowModel(Country country)
 {
     Id = country.Id;
     Name = country.Name;
     ThreeLetterIsoCode = country.ThreeLetterIsoCode;
     TwoLetterIsoCode = country.TwoLetterIsoCode;
     NumericIsoCode = country.NumericIsoCode;
 }
 public void UpdateTo(Country country)
 {
     country.Id = Id;
     country.Name = Name.Trim();
     country.ThreeLetterIsoCode = ThreeLetterIsoCode;
     country.TwoLetterIsoCode = TwoLetterIsoCode;
     country.NumericIsoCode = NumericIsoCode;
 }
        public ActionResult Save(CountryEditorModel model, string @return)
        {
            var country = new Country();
            model.UpdateTo(country);

            if (country.Id > 0)
            {
                _countryService.Update(country);
            }
            else
            {
                _countryService.Create(country);
            }

            return AjaxForm().RedirectTo(@return);
        }
Exemple #4
0
 public void Update(Country country)
 {
     _countryRepository.Update(country);
 }
Exemple #5
0
 public void Delete(Country country)
 {
     _countryRepository.Delete(country);
 }
Exemple #6
0
 public void Create(Country country)
 {
     _countryRepository.Insert(country);
 }