using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.DataLogic.Repositories; using EMIS.ViewModel.SelectCourse; using System.Linq.Expressions; using EMIS.Entities; namespace EMIS.DataLogic.SelectCourse { public class ExaminationSubjectCollegeControlDAL { public ExaminationSubjectCollegeControlRepository examinationSubjectCollegeControlRepository { get; set; } public ExaminationSubjectRepository examinationSubjectRepository { get; set; } public FacultymajorRepository facultymajorRepository { get; set; } public ExaminationTypeRepository examinationTypeRepository { get; set; } public CollegeRepository collegeRepository { get; set; } public IQueryable GetExaminationSubjectCollegeControlView(Expression> esccexp, Expression> esexp, Expression> fexp) { var query = from esccr in examinationSubjectCollegeControlRepository.GetList(esccexp) join esr in examinationSubjectRepository.GetList(esexp) on esccr.ExaminationSubjectID equals esr.ExaminationSubjectID join etr in examinationTypeRepository.Entities on esr.ExaminationTypeID equals etr.ExaminationTypeID join fac in facultymajorRepository.GetList(fexp) on esccr.FacultymajorID equals fac.FacultymajorID join col in collegeRepository.Entities on fac.CollegeID equals col.CollegeID select new ExaminationSubjectCollegeControlView { ExaminationSubjectCollegeControlID = esccr.ExaminationSubjectCollegeControlID, ExaminationSubjectID = esccr.ExaminationSubjectID, ExaminationSubjectName = esr.Name, ExaminationTypeID = esr.ExaminationTypeID, ExaminationTypeName = etr.Name, FacultymajorID = esccr.FacultymajorID, FacultymajorName = fac.Name, CollegeID = fac.CollegeID, CollegeName = col.Name, SchoolyearNumID = esccr.SchoolyearNumID, RecordStatus = esccr.RecordStatus, }; return query; } } }