RetakeParameterDAL.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Repositories;
  6. using EMIS.ViewModel.RetakeManage;
  7. using EMIS.ViewModel;
  8. namespace EMIS.DataLogic.RetakeManage
  9. {
  10. public class RetakeParameterDAL
  11. {
  12. public DictionaryItemRepository DictionaryItemRepository { get; set; }
  13. public RetakeExamsCatagoryRepository RetakeExamsCatagoryRepository { get; set; }
  14. /// <summary>
  15. /// 查询重修预查考试性质信息View
  16. /// </summary>
  17. /// <returns></returns>
  18. public IQueryable<RetakeExamsCategoryView> GetRetakeExamsCategoryViewQuery()
  19. {
  20. var query = (from examsCategory in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(CF_ExamsCategory).Name)
  21. join retakeCategory in RetakeExamsCatagoryRepository.Entities
  22. on examsCategory.Value equals retakeCategory.ExamsCategoryID
  23. into dretakeCatagory
  24. from eretakeCatagory in dretakeCatagory.DefaultIfEmpty()
  25. select new RetakeExamsCategoryView
  26. {
  27. RetakeExamsCatagoryID = eretakeCatagory.RetakeExamsCatagoryID,
  28. ExamsCategoryID = examsCategory.Value,
  29. IsSelected = eretakeCatagory.ExamsCategoryID != null
  30. });
  31. return query;
  32. }
  33. }
  34. }