namespace Yw.WinFrmUI
|
{
|
/// <summary>
|
/// 评价分类辅助类
|
/// </summary>
|
public class HydroEvaluationCatalogHelper
|
{
|
/// <summary>
|
/// 字典
|
/// </summary>
|
public static Dictionary<string, string> Dict
|
{
|
get { return _dict; }
|
}
|
|
//字典
|
private static readonly Dictionary<string, string> _dict = new Dictionary<string, string>()
|
{
|
{ Yw.Hydro.ParterCatalog.Cooling,"冷却塔"},
|
{ Yw.Hydro.ParterCatalog.Pipe,"管道"},
|
{ Yw.Hydro.ParterCatalog.Pump,"水泵"}
|
};
|
|
/// <summary>
|
/// 获取名称
|
/// </summary>
|
public static string GetName(string code)
|
{
|
if (_dict.ContainsKey(code))
|
{
|
return _dict[code];
|
}
|
return string.Empty;
|
}
|
|
/// <summary>
|
/// 获取编码
|
/// </summary>
|
public static string GetCode(string name)
|
{
|
if (_dict.ContainsValue(name))
|
{
|
return _dict.FirstOrDefault(x => x.Value == name).Key;
|
}
|
return string.Empty;
|
}
|
|
|
}
|
}
|