コード例 #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
ファイル: CountryController.cs プロジェクト: Kooboo/Ecommerce
        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);
        }