Exemplo n.º 1
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultOutput<OrganizeListDto>> GetOrganizePageList(GetPagedAndSortedAndQueryInput input)
        {
            Expression<Func<AuthorityOrganizeInfo, bool>> lambda = input.QueryConditionItem.ToLambda<AuthorityOrganizeInfo>();
            var query = _organizeRepository.GetAll();
            if (lambda != null)
            {
                query = query.Where(lambda);
            }
            var organizeCount = await query.CountAsync();
            var organizes = await query
                .OrderBy(input.Sorting)
                .PageBy(input)
                .ToListAsync();

            var organizeListDtos = organizes.MapTo<List<OrganizeListDto>>();
            return new PagedResultOutput<OrganizeListDto>(input.Draw, organizeCount, organizeListDtos);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultOutput<ProvinceCityListDto>> GetProvinceCityPageList(GetPagedAndSortedAndQueryInput input)
        {
            Expression<Func<BaseProvinceCityInfo, bool>> lambda = input.QueryConditionItem.ToLambda<BaseProvinceCityInfo>();
            var query = _provinceCityRepository.GetAll();
            if (lambda != null)
            {
                query = query.Where(lambda);
            }
            var provinceCityCount = await query.CountAsync();
            var provinceCitys = await query
                .OrderBy(input.Sorting)
                .PageBy(input)
                .ToListAsync();

            var provinceCityListDtos = provinceCitys.MapTo<List<ProvinceCityListDto>>();
            return new PagedResultOutput<ProvinceCityListDto>(input.Draw, provinceCityCount, provinceCityListDtos);
        }
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultOutput<DataDictionaryDetailListDto>> GetDataDictionaryDetailPageList(GetPagedAndSortedAndQueryInput input)
        {
            Expression<Func<BaseDataDictionaryDetailInfo, bool>> lambda = input.QueryConditionItem.ToLambda<BaseDataDictionaryDetailInfo>();
            var query = _dataDictionaryDetailRepository.GetAll();
            if (lambda != null)
            {
                query = query.Where(lambda);
            }
            var dataDictionaryDetailCount = await query.CountAsync();
            var dataDictionaryDetails = await query
                .OrderBy(input.Sorting)
                .PageBy(input)
                .ToListAsync();

            var dataDictionaryDetailListDtos = dataDictionaryDetails.MapTo<List<DataDictionaryDetailListDto>>();
            return new PagedResultOutput<DataDictionaryDetailListDto>(input.Draw, dataDictionaryDetailCount, dataDictionaryDetailListDtos);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultOutput<CodeRuleSeriousListDto>> GetCodeRuleSeriousPageList(GetPagedAndSortedAndQueryInput input)
        {
            Expression<Func<BaseCodeRuleSeriousInfo, bool>> lambda = input.QueryConditionItem.ToLambda<BaseCodeRuleSeriousInfo>();
            var query = _codeRuleSeriousRepository.GetAll();
            if (lambda != null)
            {
                query = query.Where(lambda);
            }
            var codeRuleSeriousCount = await query.CountAsync();
            var codeRuleSeriouss = await query
                .OrderBy(input.Sorting)
                .PageBy(input)
                .ToListAsync();

            var codeRuleSeriousListDtos = codeRuleSeriouss.MapTo<List<CodeRuleSeriousListDto>>();
            return new PagedResultOutput<CodeRuleSeriousListDto>(input.Draw, codeRuleSeriousCount, codeRuleSeriousListDtos);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultOutput<MenuAppListDto>> GetMenuAppPageList(GetPagedAndSortedAndQueryInput input)
        {
            var query = _menuAppRepository.GetAll();
            Expression<Func<AuthorityMenuAppInfo, bool>> lambda = input.QueryConditionItem.ToLambda<AuthorityMenuAppInfo>();
            if (lambda!=null)
            {
                query = query.Where(lambda);
            }
            var menuAppCount = await query.CountAsync();
            var menuApps = await query
                .OrderBy(input.Sorting)
                .PageBy(input)
                .ToListAsync();

            var menuAppListDtos = menuApps.MapTo<List<MenuAppListDto>>();
            return new PagedResultOutput<MenuAppListDto>(input.Draw, menuAppCount, menuAppListDtos);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultOutput<EmployeeListDto>> GetEmployeePageList(GetPagedAndSortedAndQueryInput input)
        {
            Expression<Func<BaseEmployeeInfo, bool>> lambda = input.QueryConditionItem.ToLambda<BaseEmployeeInfo>();
            var query = _employeeRepository.GetAll();
            if (lambda != null)
            {
                query = query.Where(lambda);
            }
            var employeeCount = await query.CountAsync();
            var employees = await query
                .OrderBy(input.Sorting)
                .PageBy(input)
                .ToListAsync();

            var employeeListDtos = employees.MapTo<List<EmployeeListDto>>();
            return new PagedResultOutput<EmployeeListDto>(input.Draw, employeeCount, employeeListDtos);
        }