123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 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<ExaminationSubjectCollegeControlView> GetExaminationSubjectCollegeControlView(Expression<Func<EX_ExaminationSubjectCollegeControl, bool>> esccexp, Expression<Func<EX_ExaminationSubject, bool>> esexp, Expression<Func<CF_Facultymajor, bool>> 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;
- }
- }
- }
|