通过内存遍历输出内容
2016-02-18 09:36:23 访问(1710) 赞(0) 踩(0)
/// <summary>
///
/// </summary>
/// <param name="str"></param>
/// <param name="basicOilList"></param>
/// <returns></returns>
protected string VehTypeGet
(
long theValue,
List<eKing.XlyLib.Model.Basic.UTB_EK_BASIC_VEHTYPE> basicVehList
)
{
if (theValue == 0)
return "其它";
foreach (eKing.XlyLib.Model.Basic.UTB_EK_BASIC_VEHTYPE model in basicVehList)
{
if (model.ID == theValue)
{
return model.TheName;
}
}
return "其它";
}
/// <summary>
///
/// </summary>
/// <param name="str"></param>
/// <param name="basicOilList"></param>
/// <returns></returns>
protected string OilGet
(
string str,
List<eKing.XlyLib.Model.Basic.UTB_EK_BASIC_OIL> basicOilList
)
{
if (str == null || str.Length == 0)
return "";
StringBuilder theResult
=
new StringBuilder();
string[] sA = str.Split(',');
bool isFirst = true;
string sItem = null;
foreach (string s in sA)
{
if (s == null)
continue;
sItem = s.Trim();
if (sItem.Length == 0)
continue;
foreach (eKing.XlyLib.Model.Basic.UTB_EK_BASIC_OIL model in basicOilList)
{
if (model.ID.ToString() == sItem)
{
if (isFirst)
isFirst = false;
else
theResult.Append("/");
theResult.Append(model.TheName);
break;
}
}
}
return theResult.ToString();
}
标签:
通过内存遍历输出内容 


上一条:
下一条:
相关评论
发表评论