コード例 #1
0
        public ActionResult GetRoles2()
        {
            RoleBll           roleBll      = new RoleBll();
            List <RoleEntity> roleEntities = roleBll.GetRoles();
            var data = roleEntities.Select(m => new { m.Id, m.Name });

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult GetUserRoles(string uId, string roldIds)
        {
            RoleBll           roleBll      = new RoleBll();
            List <RoleEntity> roleEntities = roleBll.GetRoles(roldIds);

            ViewData["uId"] = uId;
            return(PartialView(roleEntities));
        }
コード例 #3
0
        public ActionResult GetRoles(int pageIndex, int pageSize)
        {
            RoleBll           roleBll      = new RoleBll();
            int               count        = 0;
            List <RoleEntity> roleEntities = roleBll.GetRoles(pageIndex, pageSize, "", out count);

            return(PartialView(roleEntities));
        }
コード例 #4
0
        /// <summary>角色列表
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <param name="callBack"></param>
        /// <returns></returns>
        public ActionResult RoleList(int pageIndex, int pageSize, string callBack, string RoleName)
        {
            int               count        = 0;
            RoleBll           roleBll      = new RoleBll();
            List <RoleEntity> roleEntities = roleBll.GetRoles(pageIndex, pageSize, RoleName, out count);

            ViewBag.PageIndex = pageIndex;
            ViewBag.PageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
            ViewBag.callback  = callBack;
            return(PartialView(roleEntities));
        }