using System; using System.Collections.Generic; using System.Linq; using System.Text; using QMAPP.BLL.Dict; using QMAPP.BLL; namespace QMAPP.MD.BLL.Dict { public class DictManageBLL : BaseBLL { /// /// 字典信息 /// private Dictionary _dicts = null; #region 构造函数 public DictManageBLL() { } public DictManageBLL(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 } }