示例#1
0
        public static string GetDictionaryText(IEnumerable <DictionaryDto> dictionaries, int tag, string value)
        {
            string        ret           = "";
            DictionaryDto dictionaryDto = dictionaries.Where(d => d.Tag == tag).FirstOrDefault();

            if (dictionaryDto != null)
            {
                DictionaryValueDto dictionaryValueDto = dictionaryDto.Values.Where(d => d.Value.Equals(value, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
                if (dictionaryValueDto != null)
                {
                    ret = dictionaryValueDto.Text;
                }
            }
            return(ret);
        }
示例#2
0
        public static string GetDictionaryText(IEnumerable <DictionaryDto> dictionaries, int tag, string value)
        {
            string        ret           = "";
            DictionaryDto dictionaryDto = dictionaries.Where(d => d.Tag == tag).FirstOrDefault();

            if (dictionaryDto != null)
            {
                DictionaryValueDto dictionaryValueDto = dictionaryDto.Values.Where(d => d.Value == value).FirstOrDefault();
                if (dictionaryValueDto != null)
                {
                    ret = dictionaryValueDto.Text;
                }
            }
            return(ret);
        }