public JsonResult GetPage(int pageNum = 1, int pageSize = 10, string field = "id", string order = " desc ") { var pageDatas = roleBLL.GetPage(GetWhereStr(), (field + " " + order), pageNum, pageSize); FSRep rep = pageDatas.MapTo <Pub_Role>(); return(Json(rep)); }
public JsonResult GetPage(int pageNum = 1, int pageSize = 10, string field = "id", string order = " desc ") { var users = userDeptBLL.GetPage(GetWhereStr(), (field + " " + order), pageNum, pageSize); var usersData = users.data; var roles = userRoleBLL.GetUserRoles(" UserCode in @UserCode", new { RoleCode = usersData.Select(p => p.UserCode) }); foreach (var item in usersData) { var itemRoles = roles.Where(p => p.UserCode == item.UserCode); item.RoleCodes = string.Join(",", itemRoles.Select(p => p.RoleCode)); item.RoleNames = string.Join(",", itemRoles.Select(p => p.RoleName)); } FSRep rep = users.MapTo <V_PubUser_Dept>(); return(Json(rep)); }
public JsonResult GetPage(int pageNum = 1, int pageSize = 10, string field = "id", string order = " desc ") { var users = userDeptBLL.GetPage(GetWhereStr(), (field + " " + order), pageNum, pageSize); var usersData = users.data; var roles = userRoleBLL.GetUserRoles(" UserCode in @UserCode", new { RoleCode = usersData.Select(p => p.UserCode) }); foreach (var item in usersData) { var itemRoles = roles.Where(p => p.UserCode == item.UserCode); item.RoleCodes = string.Join(",", itemRoles.Select(p => p.RoleCode)); item.RoleNames = string.Join(",", itemRoles.Select(p => p.RoleName)); } //var model = userRoleBLL.GetList("", limits: 1).FirstOrDefault(); //var roleExt = TinyMapper.Map<Pub_UserRoleExt>(model); //TinyMapperHelper.MapTo<Pub_UserRoleExt>(model); FSRep rep = users.MapTo <V_PubUser_Dept>(); return(Json(rep)); }