12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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 EducationMissionClassDAL
- {
- public ExecutablePlanRepository ExecutablePlanRepository { get; set; }
- public CoursematerialRepository CoursematerialRepository { get; set; }
- public GrademajorRepository GrademajorRepository { get; set; }
- public SchoolyearRepository SchoolyearRepository { get; set; }
- public StudentRepository StudentRepository { get; set; }
- public ClassmajorRepository ClassmajorRepository { get; set; }
- public EducationMissionRepository EducationMissionRepository { get; set; }
- public EducationMissionClassRepository EducationMissionClassRepository { get; set; }
- public EducationSchedulingClassRepository EducationSchedulingClassRepository { get; set; }
- public EducationSchedulingClass_CF_StudentRepository EducationSchedulingClass_CF_StudentRepository { get; set; }
- public IQueryable<EducationMissionClassView> GetEducationMissionClassList()
- {
- var query = from emc in EducationMissionClassRepository.Entities
- join em in EducationMissionRepository.Entities on emc.EducationMissionID equals em.EducationMissionID
- join cm in CoursematerialRepository.Entities on emc.CoursematerialID equals cm.CoursematerialID
- join sy in SchoolyearRepository.Entities on em.SchoolyearID equals sy.SchoolyearID
- select new EducationMissionClassView
- {
- EducationMissionClassID = emc.EducationMissionClassID,
- Name = emc.Name,
- CoursematerialName = cm.CourseName,
- SchoolyearID = sy.SchoolyearID,
- SchoolyearName = sy.Code,
- CoursematerialID = emc.CoursematerialID
- };
- return query;
- }
- public IQueryable<EM_EducationMissionClass> GetEducationMissionClassByUserID(Guid UserID)
- {
- var query = from stu in StudentRepository.Entities
- join escs in EducationSchedulingClass_CF_StudentRepository.Entities on stu.UserID equals escs.UserID
- join esc in EducationSchedulingClassRepository.Entities on escs.EducationSchedulingClassID equals esc.EducationSchedulingClassID
- join emc in EducationMissionClassRepository.Entities on esc.EducationMissionClassID equals emc.EducationMissionClassID
- where stu.UserID == UserID
- select emc;
- return query;
- }
- }
- }
|