public Hashtable BomCompute(string root,Decimal qty)
{
DataRow[] row = dtBom.Select("father='" + root + "'" );
foreach(DataRow r in row)
{
if(dtBom.Select("father='" + r["child"].ToString()+ "'").Length > 0 ) {
BomCompute(r["child"].ToString(),qty * Convert.ToDecimal(r["qty"]));
}
else
{
this.AddToht(ht,r["child"].ToString(),qty * Convert.ToDecimal(r["qty"]));
}
}
return ht;
}
// 加入HashTable
private void AddToht(Hashtable ht , Object Key,Object Value)
{
if( ! ht.ContainsKey(Key))
{
ht.Add(Key,Value);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货