/// <summary>
        /// 获取劳保通过LaborId分页
        /// </summary>
        /// <returns></returns>
        public async Task <PageInfoHelper <LaborDetailListViewModel> > GetAllByHeadPage(GetLaborDetailViewModel model)
        {
            IQueryable <LaborDetailListViewModel> result = _laborDetailRepository.GetAllByHead(model);
            var a = await PageInfoHelper <LaborDetailListViewModel> .CreatePageMsgAsync(result, model.PageNumber, model.PageSize);

            return(a);
        }
示例#2
0
        /// <summary>
        /// 默认获取所有用户,如果有部门名将查询对应的部门人员
        /// </summary>
        /// <param name=""></param>
        /// <returns></returns>
        public async Task <PageInfoHelper <User> > GetAllUser(GetUserViewModel model)
        {
            IQueryable <User> result = _userRepository.GetAllByOrder().OrderBy(m => m.DepartmentId).ThenBy(m => m.EmpNo).Include(m => m.Department);

            if (model.DeptId != Guid.Empty)
            {
                result = result.Where(m => m.DepartmentId == model.DeptId);
            }
            return(await PageInfoHelper <User> .CreatePageMsgAsync(result, model.PageNumber, model.PageSize));
        }
        /// <summary>
        /// 分页获取所有数据,返回数据与页码信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <PageInfoHelper <LaborHead> > GetAllLaborAsync(PageViewModel model)
        {
            IQueryable <LaborHead> laborHeads = _laborHeadRepository.GetAllByOrder();

            return(await PageInfoHelper <LaborHead> .CreatePageMsgAsync(laborHeads, model.PageNumber, model.PageSize));
        }