ExamSubjectLimitDAL.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Repositories;
  6. using System.Linq.Expressions;
  7. using EMIS.Entities;
  8. namespace EMIS.DataLogic.ExamManage
  9. {
  10. public class ExamSubjectLimitDAL
  11. {
  12. public ExaminationProjectCountLimitRepository CountLimitRepository { get; set; }
  13. public DictionaryItemRepository DictionaryItemRepository { get; set; }
  14. public ExaminationTypeRepository TypeRepository { get; set; }
  15. public IQueryable<EMIS.ViewModel.ExamSubjectLimitView> GetList(Expression<Func<EX_ExaminationProjectCountLimit, bool>> expCampus)
  16. {
  17. var query = from a in CountLimitRepository.GetList(expCampus)
  18. join t in TypeRepository.Entities on a.ExaminationTypeID equals t.ExaminationTypeID
  19. join c in DictionaryItemRepository.Entities
  20. on new { a.SchoolyearNumID, DictionaryCode = "CF_SchoolyearNum" } equals new { SchoolyearNumID = c.Value, c.DictionaryCode }
  21. join d in DictionaryItemRepository.Entities
  22. on new { a.StandardID, DictionaryCode = "CF_Standard" } equals new { StandardID = d.Value, d.DictionaryCode }
  23. select new EMIS.ViewModel.ExamSubjectLimitView
  24. {
  25. ExaminationSubjectCountLimitID = a.ExaminationSubjectCountLimitID,
  26. ExaminationTypeID = a.ExaminationTypeID,
  27. StandardID = a.StandardID,
  28. SchoolyearNumID = a.SchoolyearNumID,
  29. SchoolyearNumName = c.Name,
  30. StandardName = d.Name,
  31. SubjectCountLimit = a.SubjectCountLimit,
  32. ExaminationTypeName=t.Name
  33. };
  34. return query;
  35. }
  36. }
  37. }