Пример #1
0
        public ActionResult ShowEditInfo()
        {
            int id = int.Parse(Request["id"]);

            ViewData.Model = roleInfoService.LoadEntities(r => r.ID == id).FirstOrDefault();
            return(View());
        }
Пример #2
0
        public ActionResult SetUserRoleInfo()
        {
            int id       = int.Parse(Request["id"]);
            var userInfo = userInfoService.LoadEntities(c => c.ID == id).FirstOrDefault(); //查询出当前用户信息

            ViewBag.UserInfo = userInfo;
            short DelFlag = (short)DeleteEnumType.Normal;

            ViewBag.AllRoles      = roleInfoService.LoadEntities(r => r.DelFlag == DelFlag).ToList(); //查出所有的角色信息
            ViewBag.ExtAllRoleIds = (from r in userInfo.RoleInfo
                                     select r.ID).ToList();                                           //获取当前用户已经有的角色的编号
            return(View());
        }
        public ActionResult SetActionRole()
        {
            int id         = int.Parse(Request["id"]);                                         //权限编号
            var actionInfo = actionInfoService.LoadEntities(a => a.ID == id).FirstOrDefault(); //找权限

            ViewBag.ActionInfo = actionInfo;
            short DelFlag = (short)DeleteEnumType.Normal;

            ViewBag.AllRoles      = roleInfoService.LoadEntities(r => r.DelFlag == DelFlag).ToList();
            ViewBag.AllExtRoleIds = (from r in actionInfo.RoleInfo
                                     select r.ID).ToList();//查询出当前权限已经有的角色编号.
            return(View());
        }
Пример #4
0
        //显示用户角色信息
        public ActionResult ShowUserRoleInfo()
        {
            //1、获取当前用户信息和存在的角色信息
            int      userId   = int.Parse(Request["id"]);
            UserInfo userInfo = userInfoService.LoadEntities(s => s.ID == userId).FirstOrDefault();

            ViewBag.UserInfo     = userInfo;
            ViewBag.ExitUserRole = userInfo.RoleInfo.ToList();

            //2、获取所有的角色信息
            List <RoleInfo> allRole = roleInfoService.LoadEntities(s => s.DelFlag == "False").ToList();

            ViewBag.AllRole = allRole;
            return(View());
        }