DictionaryHelper.cs 858 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMISOnline.Entities;
  6. using EMISOnline.ViewModel;
  7. using EMISOnline.ViewModel.Cache;
  8. namespace EMISOnline.Utility
  9. {
  10. public class DictionaryHelper
  11. {
  12. public static IEnumerable<Sys_DictionaryItem> GetDictionaryValue(DictionaryItem dictionaryItem)
  13. {
  14. return GetDictionaryValue(dictionaryItem.ToString());
  15. }
  16. public static Sys_DictionaryItem GetSingleDictionary(int dictionaryValue, string dictionaryCode)
  17. {
  18. return GetDictionaryValue(dictionaryCode).FirstOrDefault(x => x.Value == dictionaryValue);
  19. }
  20. public static IEnumerable<Sys_DictionaryItem> GetDictionaryValue(string dictionaryCode)
  21. {
  22. return IdNameExt.GetDictionaryItem(dictionaryCode);
  23. }
  24. }
  25. }