Пример #1
0
        public JsonResult SetRolePrivilege(FormCollection form)
        {
            JsonReturnMessages msg = new JsonReturnMessages();

            try
            {
                int    roleid   = Convert.ToInt32(form["RoleID"]);
                string addids   = form["AddIDS"];
                string minusids = form["MinusIDS"];
                if (string.IsNullOrEmpty(addids) && string.IsNullOrEmpty(minusids))
                {
                    msg.IsSuccess = false;
                    msg.Msg       = "没有要操作的项";
                }
                else
                {
                    sysManageService.SetRolePrivilege(roleid, addids, minusids, base.UserId, base.CurrentUser.FullName);
                    msg.IsSuccess = true;
                    msg.Msg       = "操作成功";
                }
            }
            catch (BizException bizex)
            {
                msg.IsSuccess = false;
                msg.Msg       = bizex.Message;
            }
            catch (Exception ex)
            {
                msg.IsSuccess = false;
                msg.Msg       = "操作失败:" + ex.Message;
            }
            return(Json(msg));
        }