DictionaryDAL.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. public IQueryable<DictionaryItemView> GetDictionaryItemQuery(DictionaryItem dictionaryCode)
  14. {
  15. var code = dictionaryCode.ToString();
  16. return GetDictionaryItemQuery(code);
  17. }
  18. public IQueryable<DictionaryItemView> GetDictionaryItemQuery(string dictionaryCode)
  19. {
  20. var query = DictionaryItemRepository
  21. .GetList(w => w.DictionaryCode == dictionaryCode)
  22. .Select(s => new DictionaryItemView
  23. {
  24. DictionaryCode = s.DictionaryCode,
  25. Code = s.Code,
  26. Name = s.Name,
  27. Value = s.Value,
  28. OrderNo = s.OrderNo,
  29. });
  30. return query;
  31. }
  32. }
  33. }