MinorStandardSettingDAL.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.MinorManage.MinorSetting;
  6. using System.Linq.Expressions;
  7. using EMIS.Entities;
  8. using EMIS.DataLogic.Repositories;
  9. using EMIS.ViewModel;
  10. namespace EMIS.DataLogic.MinorManage.MinorSetting
  11. {
  12. public class MinorStandardSettingDAL
  13. {
  14. public MinorStandardSettingRepository minorStandardSettingRepository { get; set; }
  15. public DictionaryItemRepository dictionaryItemRepository { get; set; }
  16. public IQueryable<MinorStandardSettingView> GetMinorStandardSettingViewQueryable(Expression<Func<CF_MinorStandardSetting, bool>> exp)
  17. {
  18. var query = from mssr in minorStandardSettingRepository.GetList(exp)
  19. select new MinorStandardSettingView
  20. {
  21. MinorStandardSettingID = mssr.MinorStandardSettingID,
  22. MinorStandardID = mssr.MinorStandardID,
  23. StandardID = mssr.StandardID,
  24. };
  25. return query;
  26. }
  27. public IQueryable<MinorStandardSettingView> GetStandardNotHaveSelect(Expression<Func<Sys_DictionaryItem, bool>> exp)
  28. {
  29. var query = from dir in dictionaryItemRepository.GetList(exp)
  30. select new MinorStandardSettingView
  31. {
  32. MinorStandardCode = dir.Code,
  33. //Name = dir.Name,
  34. MinorStandardID = dir.Value,
  35. };
  36. return query.OrderBy(x => x.MinorStandardID);
  37. }
  38. }
  39. }