天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

125 lines
3.0 KiB

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
{
/// <summary>
/// 字典信息
/// </summary>
private Dictionary<string, string> _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 获取字典值
/// <summary>
/// 获取字典值
/// </summary>
/// <param name="key">键</param>
/// <returns>值</returns>
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 获取字典信息
/// <summary>
/// 获取字典信息
/// <param name="kind">字典类别</param>
/// </summary>
/// <returns>字典信息</returns>
public Dictionary<string, string> GetModelDictionary(DictKind kind)
{
Dictionary<string, string> dicts = null;
try
{
QMFrameWork.Common.Util.ModelDictionaryHandler.TryGetModelDictionary(kind.ToString(), out dicts);
return dicts;
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 获取字典信息
/// <param name="kind">字典类别</param>
/// </summary>
/// <returns>字典信息</returns>
public Dictionary<string, string> GetModelDictionary(string kind)
{
Dictionary<string, string> dicts = null;
try
{
QMFrameWork.Common.Util.ModelDictionaryHandler.TryGetModelDictionary(kind, out dicts);
return dicts;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region
/// <summary>
/// 通过工序类别获取设备信息
/// </summary>
/// <param name="condition"></param>
/// <returns></returns>
public List<MachineInfo> GetMachineListByProcessType(MachineInfo condition)
{
MachineInfoDAL madal = new MachineInfoDAL();
List<MachineInfo> machList = new List<MachineInfo>();
machList = madal.GetList(condition);
return machList;
}
#endregion
}
}