using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.DataLogic.Repositories; using EMIS.ViewModel.ExaminationApply; using System.Linq.Expressions; using EMIS.Entities; namespace EMIS.DataLogic.ExaminationApply { public class SubjectCountLimitDAL { public ExaminationSubjectCountLimitRepository ExaminationSubjectCountLimitRepository { get; set; } public IQueryable GetSubjectCountLimitView(Expression> subjectCountLimitExpression) { var q = (from es in ExaminationSubjectCountLimitRepository.GetList(subjectCountLimitExpression) select new SubjectCountLimitView { ExaminationSubjectCountLimitID = es.ExaminationSubjectCountLimitID, ExaminationTypeID = es.ExaminationTypeID, ExaminationTypeName = es.EX_ExaminationType.Name, FacultymajorID = es.FacultymajorID, FacultymajorName = es.CF_Facultymajor.Name, CollegeID=es.CF_Facultymajor.CollegeID, Years = es.Years, SubjectCountLimit = es.SubjectCountLimit, RecordStatus = es.RecordStatus, CreateUserID = es.CreateUserID, CreateTime = es.CreateTime, ModifyUserID = es.ModifyUserID, ModifyTime = es.ModifyTime//, }).OrderBy(x => x.ExaminationTypeName).ThenBy(x => x.FacultymajorName).ThenByDescending(x => x.Years); return q; } } }