ExamsCategorySettingDAL.cs 1.3 KB

12345678910111213141516171819202122232425262728293031
  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;
  7. using EMIS.ViewModel.ScoreManage;
  8. namespace EMIS.DataLogic.ScoreManage
  9. {
  10. public class ExamsCategorySettingDAL
  11. {
  12. public DictionaryItemRepository DictionaryItemRepository { get; set; }
  13. public ExamsCategorySettingRepository ExamsCategorySettingRepository { get; set; }
  14. public IQueryable<ExamsCategorySettingView> GetExamsCategorySettingView()
  15. {
  16. var sql = (from category in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(CF_ExamsCategory).Name && x.RecordStatus > (int)SYS_STATUS.UNUSABLE)
  17. join setting in ExamsCategorySettingRepository.Entities on category.Value equals setting.ExamsCategoryID into dsetting
  18. from setting in dsetting.DefaultIfEmpty()
  19. select new ExamsCategorySettingView
  20. {
  21. ExamsCategoryID = category.Value,
  22. ExamsCategorySettingID = setting.ExamsCategorySettingID,
  23. IsReadHistory = setting.IsReadHistory ?? false
  24. });
  25. return sql;
  26. }
  27. }
  28. }