예제 #1
0
        private PagedList<Department> QueryListData(DepartmentSearch searchModel)
        {
            int recordCount = 0;
            int pageSize = ConstantManager.PageSize;
            DepartmentService service = new DepartmentService();

            string Group = searchModel.IsAsc ? searchModel.SortBy : searchModel.SortBy + " Descending";

            IList<Department> allEntities = service.QueryByPage(this.GetSearchFilter(searchModel), Group, pageSize, searchModel.PageIndex + 1, out recordCount);

            var formCondition = "var condition=" + JsonConvert.SerializeObject(searchModel);
            return new PagedList<Department>(allEntities, searchModel.PageIndex, pageSize, recordCount, "Id", "Id", formCondition);
        }