CollegeServices.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Linq.Expressions;
  6. using EMISOnline.Entities;
  7. using EMISOnline.DataLogic.Educational;
  8. using Bowin.Common.Linq.Entity;
  9. using EMISOnline.ViewModel.Educational;
  10. using Bowin.Common.Linq;
  11. namespace EMISOnline.CommonLogic.EducationalServices
  12. {
  13. public class CollegeServices : BaseServices, ICollegeServices
  14. {
  15. public CollegeDAL CollegeDAL { get; set; }
  16. public IGridResultSet<CollegeView> GetCollegeList(int pageIndex, int pageSize, string collegeName, string collegeNo)
  17. {
  18. Expression<Func<CF_College, bool>> exp = (x => true);
  19. if (!string.IsNullOrEmpty(collegeName))
  20. {
  21. exp = exp.And(e => e.Name.Contains(collegeName.Trim()));
  22. }
  23. if (!string.IsNullOrEmpty(collegeNo))
  24. {
  25. exp = exp.And(e => e.No.Contains(collegeNo.Trim()));
  26. }
  27. var list = CollegeDAL.GetCollegeList(exp).OrderByDescending(r => r.CreateTime).ToGridResultSet(pageIndex, pageSize);
  28. return list;
  29. }
  30. }
  31. }