using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.DataLogic.Repositories; using System.Linq.Expressions; using EMIS.Entities; namespace EMIS.DataLogic.ExamManage { public class ExamSubjectLimitDAL { public ExaminationProjectCountLimitRepository CountLimitRepository { get; set; } public DictionaryItemRepository DictionaryItemRepository { get; set; } public ExaminationTypeRepository TypeRepository { get; set; } public IQueryable GetList(Expression> expCampus) { var query = from a in CountLimitRepository.GetList(expCampus) join t in TypeRepository.Entities on a.ExaminationTypeID equals t.ExaminationTypeID join c in DictionaryItemRepository.Entities on new { a.SchoolyearNumID, DictionaryCode = "CF_SchoolyearNum" } equals new { SchoolyearNumID = c.Value, c.DictionaryCode } join d in DictionaryItemRepository.Entities on new { a.StandardID, DictionaryCode = "CF_Standard" } equals new { StandardID = d.Value, d.DictionaryCode } select new EMIS.ViewModel.ExamSubjectLimitView { ExaminationSubjectCountLimitID = a.ExaminationSubjectCountLimitID, ExaminationTypeID = a.ExaminationTypeID, StandardID = a.StandardID, SchoolyearNumID = a.SchoolyearNumID, SchoolyearNumName = c.Name, StandardName = d.Name, SubjectCountLimit = a.SubjectCountLimit, ExaminationTypeName=t.Name }; return query; } } }