using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMISOnline.Entities; using EMISOnline.DataLogic.Repositories; using EMISOnline.ViewModel.Educational; namespace EMISOnline.DataLogic.Educational { public class CourseWareDAL { public GrademajorRepository GrademajorRepository { get; set; } public ExecutablePlanRepository ExecutablePlanRepository { get; set; } public CoursematerialRepository CoursematerialRepository { get; set; } public CourseChapterRepository CourseChapterRepository { get; set; } public CourseVideoRepository CourseVideoRepository { get; set; } public UserRepository UserRepository { get; set; } public CourseChapter_VideoRepository CourseChapter_VideoRepository { get; set; } public IQueryable GetCourseWareList() { var query = from cv in CourseVideoRepository.Entities //join ep in ExecutablePlanRepository.Entities on gm.GrademajorID equals ep.GrademajorID //join cm in CoursematerialRepository.Entities on ep.CoursematerialID equals cm.CoursematerialID //join cc in CourseChapterRepository.Entities on cm.CoursematerialID equals cc.CoursematerialID //join ccv in CourseChapter_VideoRepository.Entities on cc.CourseChapterID equals ccv.CourseChapterID //join cv in CourseVideoRepository.Entities on ccv.CourseVideoID equals cv.CourseVideoID join u in UserRepository.Entities on cv.CreateUserID equals u.UserID select new CourseWareView { CourseVideoID = cv.CourseVideoID, GrademajorName = "", CoursematerialName = "", CourseVideoName = cv.Name, CreateUserName = u.Name, CreateTime = cv.CreateTime }; return query; } } }