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)); }
public ActionResult GetUserRoles(string uId, string roldIds) { RoleBll roleBll = new RoleBll(); List <RoleEntity> roleEntities = roleBll.GetRoles(roldIds); ViewData["uId"] = uId; return(PartialView(roleEntities)); }
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)); }
/// <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)); }