Ejemplo n.º 1
0
        public ActionResult UserRoleList(string u_gid)
        {
            int rowCount;
            //查询所有的角色
            SystemRoleSearchInfo search   = new SystemRoleSearchInfo();
            List <Role>          roleList = SystemSeviceClass.Role_SelectPage(search, 1, 100, out rowCount);

            ViewData["roleList"] = roleList;

            //查询用户拥有的所有角色
            List <User_Role_Mapping> urList = SystemSeviceClass.User_Role_Mapping_SelectByu_gid(u_gid);
            Dictionary <Role, bool>  rbDic  = new Dictionary <Role, bool>();

            foreach (Role item in roleList)
            {
                if (urList.Where(ur => ur.r_gid == item.r_gid).Count() > 0)
                {
                    rbDic.Add(item, true);
                }
                else
                {
                    rbDic.Add(item, false);
                }
            }
            ViewBag.rbDic = rbDic;
            ViewBag.u_gid = u_gid;

            return(View());
        }
Ejemplo n.º 2
0
 public static List <Role> Role_SelectPage(SystemRoleSearchInfo search, int pageIndex, int pageSize, out int rowCount)
 {
     using (SystemDAL access = new SystemDAL())
     {
         return(access.Role_SelectPage("*", pageIndex, pageSize, search.DefaultOrder, search.ToWhereString(), out rowCount));
     }
 }
Ejemplo n.º 3
0
        public ActionResult PermissionAssignListView()
        {
            int rowCount;
            //查询所有的角色
            SystemRoleSearchInfo search   = new SystemRoleSearchInfo();
            List <Role>          roleList = SystemSeviceClass.Role_SelectPage(search, 1, 100, out rowCount);

            ViewData["roleList"] = roleList;

            return(PartialView());
        }
Ejemplo n.º 4
0
        public ActionResult RoleListView()
        {
            int page     = Request["page"].ToString().ToInt32(1);
            int pageSize = Request["pagesize"].ToString().ToInt32(15);
            //搜索关键字
            string r_name = Request["r_name"] ?? string.Empty;

            int rowCount;
            //查询所有的模块
            SystemRoleSearchInfo search = new SystemRoleSearchInfo()
            {
                r_name = r_name
            };
            List <Role> list = SystemSeviceClass.Role_SelectPage(search, page, pageSize, out rowCount);

            ViewData["list"] = list;

            ViewData["page"]     = page;
            ViewData["pageSize"] = pageSize;
            ViewData["rowCount"] = rowCount;

            return(PartialView());
        }