UpdateTo() public method

public UpdateTo ( Country country ) : void
country Kooboo.Commerce.Countries.Country
return void
Esempio n. 1
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);
        }
Esempio n. 2
0
        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);
        }