public List <GroupInfoFullDto> GetList() { AdminVerify(0, "GetList"); var res = _groupInfoDal.GetList(); if (res.Count > 0) { var projectList = _projectInfoDal.GetList(res.Select(p => p.ProjectId).ToArray()); res.ForEach(p => { p.ProjectInfo = projectList.Find(pj => pj.Id == p.ProjectId); }); } return(res); }
public PageResult <UserInfoFullDto> SearchPage(UserInfoSearchDto search) { AdminVerify(search, "SearchPage"); search = search ?? new UserInfoSearchDto(); search.PageSize = search.PageSize < 1 ? 50 : search.PageSize; search.PageIndex = search.PageIndex < 1 ? 1 : search.PageIndex; var res = _userInfoDal.SearchPage(search); if (res.Items.Count > 0) { var list = _groupInfoDal.GetList(res.Items.Select(p => p.GroupId).ToArray()); foreach (var item in res.Items) { item.GroupInfo = list.Find(p => p.Id == item.GroupId); } } return(res); }
public PageResult <CustomerInfoFullDto> SearchPage(CustomerSearchDto search) { search = search ?? new CustomerSearchDto(); search.PageSize = search.PageSize < 1 ? 50 : search.PageSize; search.PageIndex = search.PageIndex < 1 ? 1 : search.PageIndex; var res = _customerInfoDal.SearchPage(search); if (res.Items.Count > 0) { var list = _groupInfoDal.GetList(res.Items.Select(p => p.GroupId).ToArray()); var userinfos = _userInfoDal.GetList(res.Items.Select(p => p.UserId).ToArray()); foreach (var item in res.Items) { item.GroupInfo = list.Find(p => p.Id == item.GroupId); item.UserInfo = userinfos.Find(p => p.Id == item.UserId); } } return(res); }