using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.BLL.Dict;
using QMAPP.BLL;
using QMAPP.FJC.Entity.Basic;
using QMAPP.FJC.DAL.Basic;
namespace QMAPP.FJC.BLL.Dict
{
public class DictManageBLL : BaseBLL
{
///
/// 字典信息
///
private Dictionary _dicts = null;
#region 构造函数
public DictManageBLL()
{
}
public DictManageBLL(DictKind kind)
{
this._dicts = this.GetModelDictionary(kind);
}
public DictManageBLL(string DictName)
{
this._dicts = this.GetModelDictionary(DictName);
}
#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;
}
}
///
/// 获取字典信息
/// 字典类别
///
/// 字典信息
public Dictionary GetModelDictionary(string kind)
{
Dictionary dicts = null;
try
{
QMFrameWork.Common.Util.ModelDictionaryHandler.TryGetModelDictionary(kind, out dicts);
return dicts;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region
///
/// 通过工序类别获取设备信息
///
///
///
public List GetMachineListByProcessType(MachineInfo condition)
{
MachineInfoDAL madal = new MachineInfoDAL();
List machList = new List();
machList = madal.GetList(condition);
return machList;
}
#endregion
}
}