Example #1
0
        public ActionResult Index([Bind(Prefix = "SystemConfig")] SystemConfig systemConfig_Form)
        {
            this.Validator(systemConfig_Form.SystemName, "系统名称", "SystemConfig.SystemName", false);

            if (!ModelState.IsValid)
            {
                var vd = new SystemConfig_IndexVD()
                {
                    SystemConfig = systemConfig_Form,
                };
                return(View(vd));
            }

            var systemConfig = _systemConfigService.GetObject(systemConfig_Form.Id);

            if (systemConfig == null)
            {
                return(RenderError("信息不存在!"));
            }

            this.TryUpdateModel(systemConfig, "SystemConfig", null, new[] { "Id" });
            this._systemConfigService.SaveObject(systemConfig);

            base.SetMessager(MessageType.success, "修改成功!");
            return(RedirectToAction("Index"));
        }
Example #2
0
        public ActionResult Index()
        {
            var vd = new SystemConfig_IndexVD()
            {
                SystemConfig = _systemConfigService.GetObject(z => true),
            };

            return(View(vd));
        }
Example #3
0
 public IActionResult Index(SystemConfig_IndexVD model)
 {
     return(RedirectToAction("Index"));
 }