示例#1
0
        public ActionResult Edit(int id)
        {
            var model = _siteSettingService.GetSettingManageModel(id);

            if (model == null)
            {
                SetErrorMessage(T("SiteSetting_Message_ObjectNotFound"));
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
示例#2
0
        public JsonResult GoogleAnalyticApiSetup(GoogleAnalyticApiSetting model)
        {
            if (ModelState.IsValid)
            {
                var setting = _siteSettingService.GetSetting(model.GetSetup().Name);

                var manageModel = _siteSettingService.GetSettingManageModel(setting.Id);
                manageModel.Value = SerializeUtilities.Serialize(model);

                var response = _siteSettingService.SaveSettingManageModel(manageModel);

                return(Json(response));
            }

            return(Json(new ResponseModel
            {
                Success = false,
                Message = ModelState.BuildValidationMessages()
            }));
        }