using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace iWare.Wms.Application.Mapper
|
{
|
public static class DataHandler
|
{
|
public static List<DictTreeOutput> Dicts;
|
|
private static object lockDicts = new object();
|
public static string GetDictForName(string dictcode, object code)
|
{
|
lock (lockDicts)
|
{
|
string str = "";
|
if (Dicts == null|| code==null || dictcode==null)
|
{
|
return str;
|
}
|
else
|
{
|
try
|
{
|
Dicts.ForEach(u =>
|
{
|
if (u.Code == dictcode)
|
{
|
var date = u.Children.Where(o => o.Code.Equals(code.ToString()));
|
if (date != null)
|
{
|
str = date.FirstOrDefault().Name;
|
}
|
else
|
{
|
str = code.ToString();
|
}
|
}
|
});
|
|
}
|
catch (Exception ex)
|
{
|
str= code.ToString();
|
}
|
return str;
|
}
|
}
|
}
|
}
|
}
|