CourseServices.cs 1009 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMISOnline.Entities;
  6. using EMISOnline.DataLogic.Educational;
  7. using EMISOnline.ViewModel.Educational;
  8. using Bowin.Common.Linq.Entity;
  9. using Bowin.Common.Linq;
  10. using System.Linq.Expressions;
  11. namespace EMISOnline.CommonLogic.EducationalServices
  12. {
  13. public class CourseServices : BaseServices, ICourseServices
  14. {
  15. public CourseDAL CourseDAL { get; set; }
  16. public IGridResultSet<CoursematerView> GetCoursematerList(int pageIndex, int pageSize, string courseName)
  17. {
  18. Expression<Func<CoursematerView, bool>> exp = (e => true);
  19. if (!string.IsNullOrEmpty(courseName))
  20. {
  21. exp = exp.And(e => e.CourseName.Contains(courseName.Trim()));
  22. }
  23. var list = CourseDAL.GetCoursematerialViewQueryable().Where(exp).OrderByDescending(r => r.CreateTime).ToGridResultSet(pageIndex, pageSize);
  24. return list;
  25. }
  26. }
  27. }