コード例 #1
0
        private PagedList<Employee> QueryListData(EmployeeSearch searchModel)
        {
            int recordCount = 0;
            int pageSize = ConstantManager.PageSize;
            EmployeeService service = new EmployeeService();

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

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

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