Example #1
0
        public DictDto GetByCode(DictTypeEnum dictType, string dictValue)
        {
            var dict = _dictRepository.Table.Where(a => a.DictType == dictType.ToString() && a.DictCode == dictValue).FirstOrDefault();

            if (dict != null)
            {
                return(dict.ToModel());
            }
            return(null);
        }
        /// <summary>
        /// 重载词库信息
        /// </summary>
        /// <param name="dictType">词库类型</param>
        internal virtual void Reload(DictTypeEnum dictType)
        {
            switch (dictType)
            {
            case DictTypeEnum.Text:
                ReloadTextDict();
                break;

            case DictTypeEnum.PinYin:
                ReloadPinYinDict();
                break;
            }
        }
Example #3
0
 /// <summary>
 /// 取得字典类型代码
 /// </summary>
 /// <param name="type">DictTypeEnum字典类型枚举</param>
 /// <returns>字典类型代码</returns>
 public string GetDictTypeName(DictTypeEnum type)
 {
     return(Enum.GetName(typeof(DictTypeEnum), type));
 }
Example #4
0
        public IList <DictEntity> GetListByType(DictTypeEnum dictType)
        {
            var query = _dictRepository.Table.Where(a => a.DictType == dictType.ToString());

            return(query.ToList());
        }
Example #5
0
File: Dict.cs Project: qq5013/JXNG
 /// <summary>
 /// 取得字典类型代码
 /// </summary>
 /// <param name="type">DictTypeEnum字典类型枚举</param>
 /// <returns>字典类型代码</returns>
 public string GetDictTypeName(DictTypeEnum type)
 {
     return Enum.GetName(typeof(DictTypeEnum), type);
 }