public static PagedData <Students.Student> SimpleSearchStudentList(Students.StudentSimpleSearchCriteria criteria) { CreateAllStudentData(); if (criteria.PagedParam == null) { criteria.PagedParam = new PagedParam(); } var query = AllStudentData.AsQueryable(); if (!string.IsNullOrEmpty(criteria.Name)) { query = query.Where(s => s.Name.Contains(criteria.Name)); } if (!string.IsNullOrEmpty(criteria.Code)) { query = query.Where(s => s.Code.Contains(criteria.Code)); } if (!string.IsNullOrEmpty(criteria.TeacherXG)) { query = query.Where(s => s.TeacherXG.Contains(criteria.TeacherXG)); } if (!string.IsNullOrEmpty(criteria.TeacherZX)) { query = query.Where(s => s.TeacherZX.Contains(criteria.TeacherZX)); } if (!string.IsNullOrEmpty(criteria.Contact)) { query = query.Where(s => s.Contact.Contains(criteria.Contact)); } int totalCount = query.Count(); List <Students.Student> list = query.Skip((criteria.PagedParam.Page - 1) * criteria.PagedParam.Limit).Take(criteria.PagedParam.Limit).ToList(); PagedData <Students.Student> pagedData = new PagedData <Models.Students.Student>(new PagedParam(criteria.PagedParam.Page, criteria.PagedParam.Limit, totalCount)) { Data = list }; return(pagedData); }
public static PagedData <Students.Student> AdvanceSearchStudentList(Students.StudentSimpleSearchCriteria criteria) { throw new NotImplementedException("未实现"); }