예제 #1
0
        public ActionResult Edit(AdminRole arl, string ModuleIds)
        {
            if (!Request.IsAjaxRequest())
            {
                return(Content("操作失败,你的浏览器禁用了Javascript脚本!"));
            }
            var srm = new ShowResultModel();

            if (ModelState.IsValid)
            {
                try
                {
                    _adminRoleService.UpdateRole(arl, ModuleIds);
                    srm.TipMsg    = "修改角色成功!";
                    srm.IsSuccess = true;
                }
                catch (InvalidOperationException ex)
                {
                    srm.TipMsg = ex.Message;
                }
                catch (Exception ex)
                {
                    srm.TipMsg = ex.Message;
                    LoggerHelper.Log("【修改管理员角色】出错,系统操作管理员:" + _currentAdmin.AdminInfo.SAName + ",错误原因:" + (ex.InnerException == null ? ex.Message : ex.InnerException.ToString()));
                }
            }
            else
            {
                srm.TipMsg = "数据有效性验证失败!";
            }
            return(Json(srm));
        }