ExaminationModeSettingDAL.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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.ExaminationManage;
  7. using System.Linq.Expressions;
  8. using EMIS.Entities;
  9. using EMIS.ViewModel;
  10. namespace EMIS.DataLogic.ExaminationManage
  11. {
  12. public class ExaminationModeSettingDAL
  13. {
  14. public DictionaryItemRepository DictionaryItemRepository { get; set; }
  15. public ExaminationModeSettingRepository ExaminationModeSettingRepository { get; set; }
  16. public IQueryable<ExaminationModeSettingView> GetExaminationModeSettingView()
  17. {
  18. var query = (from diem in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(CF_ExaminationMode).Name)
  19. join ems in ExaminationModeSettingRepository.Entities
  20. on diem.Value equals ems.ExaminationModeID into dems
  21. from eems in dems.DefaultIfEmpty()
  22. orderby diem.OrderNo
  23. select new ExaminationModeSettingView
  24. {
  25. ExaminationModeSettingID = eems.ExaminationModeSettingID == null ? Guid.NewGuid() : eems.ExaminationModeSettingID,
  26. ExaminationModeID = diem.Value,
  27. IsGeneratePlan = eems.IsGeneratePlan ?? false
  28. });
  29. return query;
  30. }
  31. }
  32. }