예제 #1
0
        public ActionResult Edit(int id)
        {
            var country = _countryService.GetById(id);
            var model = new CountryEditorModel(country);

            return View(model);
        }
예제 #2
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);
        }
예제 #3
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);
        }
예제 #4
0
        public ActionResult Create()
        {
            var model = new CountryEditorModel();

            return View(model);
        }