DictionaryDAL.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.SystemView;
  7. using EMIS.ViewModel;
  8. namespace EMIS.DataLogic.SystemDAL
  9. {
  10. public class DictionaryDAL
  11. {
  12. public DictionaryItemRepository DictionaryItemRepository { get; set; }
  13. /// <summary>
  14. ///
  15. /// </summary>
  16. /// <param name="dictionaryCode"></param>
  17. /// <returns></returns>
  18. public IQueryable<DictionaryItemView> GetDictionaryItemQuery(DictionaryItem dictionaryCode)
  19. {
  20. var code = dictionaryCode.ToString();
  21. return GetDictionaryItemQuery(code);
  22. }
  23. /// <summary>
  24. ///
  25. /// </summary>
  26. /// <param name="dictionaryCode"></param>
  27. /// <returns></returns>
  28. public IQueryable<DictionaryItemView> GetDictionaryItemQuery(string dictionaryCode)
  29. {
  30. var query = DictionaryItemRepository.GetList(w => w.DictionaryCode == dictionaryCode)
  31. .Select(s => new DictionaryItemView
  32. {
  33. DictionaryCode = s.DictionaryCode,
  34. Code = s.Code,
  35. Name = s.Name,
  36. Value = s.Value,
  37. });
  38. return query;
  39. }
  40. }
  41. }