CourseWareDAL.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMISOnline.Entities;
  6. using EMISOnline.DataLogic.Repositories;
  7. using EMISOnline.ViewModel.Educational;
  8. namespace EMISOnline.DataLogic.Educational
  9. {
  10. public class CourseWareDAL
  11. {
  12. public GrademajorRepository GrademajorRepository { get; set; }
  13. public ExecutablePlanRepository ExecutablePlanRepository { get; set; }
  14. public CoursematerialRepository CoursematerialRepository { get; set; }
  15. public CourseChapterRepository CourseChapterRepository { get; set; }
  16. public CourseVideoRepository CourseVideoRepository { get; set; }
  17. public UserRepository UserRepository { get; set; }
  18. public CourseChapter_VideoRepository CourseChapter_VideoRepository { get; set; }
  19. public IQueryable<CourseWareView> GetCourseWareList()
  20. {
  21. var query = from cv in CourseVideoRepository.Entities
  22. //join ep in ExecutablePlanRepository.Entities on gm.GrademajorID equals ep.GrademajorID
  23. //join cm in CoursematerialRepository.Entities on ep.CoursematerialID equals cm.CoursematerialID
  24. //join cc in CourseChapterRepository.Entities on cm.CoursematerialID equals cc.CoursematerialID
  25. //join ccv in CourseChapter_VideoRepository.Entities on cc.CourseChapterID equals ccv.CourseChapterID
  26. //join cv in CourseVideoRepository.Entities on ccv.CourseVideoID equals cv.CourseVideoID
  27. join u in UserRepository.Entities on cv.CreateUserID equals u.UserID
  28. select new CourseWareView
  29. {
  30. CourseVideoID = cv.CourseVideoID,
  31. GrademajorName = "",
  32. CoursematerialName = "",
  33. CourseVideoName = cv.Name,
  34. CreateUserName = u.Name,
  35. CreateTime = cv.CreateTime
  36. };
  37. return query;
  38. }
  39. }
  40. }