using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace QMAPP.BLL.Dict
{
///
/// 字典管理
///
public class DictManagerBLL:BaseBLL
{
///
/// 字典信息
///
private Dictionary _dicts = null;
#region 构造函数
public DictManagerBLL()
{
}
public DictManagerBLL(DictKind kind)
{
this._dicts = this.GetModelDictionary(kind);
}
#endregion
#region 获取字典值
///
/// 获取字典值
///
/// 键
/// 值
public string GetDictValue(string key)
{
string value = key;
if (string.IsNullOrEmpty(key) == true)
return key;
if (this._dicts == null)
throw new Exception("未初始化字典信息。");
this._dicts.TryGetValue(key, out value);
return value;
}
#endregion
#region 获取字典信息
///
/// 获取字典信息
/// 字典类别
///
/// 字典信息
public Dictionary GetModelDictionary(DictKind kind)
{
Dictionary dicts = null;
try
{
QMFrameWork.Common.Util.ModelDictionaryHandler.TryGetModelDictionary(kind.ToString(), out dicts);
return dicts;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}