Exemple #1
0
        public ActionResult GetDataList(int pIndex = 1)
        {
            ViewBag.pageName = "GetDataList";
            var input    = new GetNoticeDepJobInput();
            var pagedata = ndjService.GetPagedNoticeDepJobs(input);

            GetPageData(pagedata.TotalCount);
            return(PartialView("Shared/DataList", pagedata.Items));
        }
        /// <summary>
        /// 根据查询条件获取分页列表
        /// </summary>
        public PagedResultDto <NoticeDepJobListDto> GetPagedNoticeDepJobs(GetNoticeDepJobInput input)
        {
            var query = _NoticeDepJobRepository.GetAll();
            //TODO:根据传入的参数添加过滤条件

            var NoticeDepJobCount = query.Count();

            var NoticeDepJobs = query
                                .OrderByDescending(t => t.CreationTime)
                                .PageBy(input)
                                .ToList();

            var NoticeDepJobListDtos = NoticeDepJobs.MapTo <List <NoticeDepJobListDto> >();

            return(new PagedResultDto <NoticeDepJobListDto>(
                       NoticeDepJobCount,
                       NoticeDepJobListDtos
                       ));
        }