Ejemplo n.º 1
0
 public List<FullUser> Query(FullUserQueryForm form)
 {
     if (form.PageSize.HasValue && form.PageSize.Value > 0)
     {
         form.RecordCount = mapper.QueryForObject<int>("QueryFullUserRecordCount", form);
     }
     return mapper.QueryForList<FullUser>("QueryFullUser", form).ToList();
 }
Ejemplo n.º 2
0
 public PagingEntity<FullUser> QueryUser(FullUserQueryForm form)
 {
     var list = bll.Query(form);
     PagingEntity<FullUser> users = new PagingEntity<FullUser>
     {
         Record = list,
         PageCount = form.PageCount,
         RecordCount = form.RecordCount,
     };
     return users;
 }
Ejemplo n.º 3
0
 public UserInitResultForm Init(FullUserQueryForm form)
 {
     var list = bll.Query(form);
     PagingEntity<FullUser> users = new PagingEntity<FullUser>
     {
         Record = list,
         PageCount = form.PageCount,
         RecordCount = form.RecordCount,
     };
     RoleBLL rolebll = new RoleBLL();
     var role = rolebll.Query(new RoleQueryForm { });
     UserInitResultForm resultform = new UserInitResultForm
     {
         User = users,
         Role = role,
     };
     return resultform;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 查询所有用户
 /// </summary>
 /// <returns></returns>
 public List<FullUser> Query(FullUserQueryForm form)
 {
     ISqlMapper mapper = Common.GetMapperFromSession();
     FullUserDao dao = new FullUserDao(mapper);
     User_RoleDao urdao = new User_RoleDao(mapper);
     RoleDao roledao = new RoleDao(mapper);
     var userlist = dao.Query(form);
     var userids = (from u in userlist select u.ID).ToList();
     var urs = urdao.Query(new User_RoleQueryForm { UserIDs = userids });
     var roleids = (from ur in urs select ur.RoleID).Distinct().ToList();
     var roles = roledao.Query(new RoleQueryForm { IDs = roleids });
     foreach (var u in userlist)
     {
         var ur_temp = urs.FindAll(t => t.UserID == u.ID);
         var rolelist = (from ur in ur_temp join r in roles on ur.RoleID equals r.ID select r).ToList();
         u.RoleList = rolelist;
     }
     return userlist;
 }