html 二叉树模式,二叉树的HTML显示

protectedstringbf(inti,stringcoding,stringpcoding,strings)

{stringc1="", c2="";if(coding=="左未注册"||coding=="右未注册")

{ c1="

 左未注册
"; c2="
右未注册
"; }else{//c1 = "
 左未注册
"; c2 = "
右未注册
";c1=string.Format("
{1} 
", coding,"左未注册");

c2=string.Format("

{1} 
", coding,"右未注册");

}

Sale.BLL.Customer bcustomer=newSale.BLL.Customer();

Sale.Model.Customer mcustomer=bcustomer.GetModel(coding);if(i<2)

{

i++;if(mcustomer!=null)

{if(!string.IsNullOrEmpty(mcustomer.LeftChildCoding))

{

c1=bf(i, mcustomer.LeftChildCoding, coding, s);

}else{

c1=bf(i,"左未注册", coding, s);

}if(!string.IsNullOrEmpty(mcustomer.RightChildCoding))

{

c2=bf(i, mcustomer.RightChildCoding, coding, s);

}else{

c2=bf(i,"右未注册", coding, s);

}

}else{

c1=bf(i,"左未注册", coding, s);

c2=bf(i,"右未注册", coding, s);

}

}else{if(mcustomer!=null)

{if(!string.IsNullOrEmpty(mcustomer.LeftChildCoding))

{

Sale.Model.Customer lcus=bcustomer.GetModel(mcustomer.LeftChildCoding);

c1=string.Format("{0}({1}单)", mcustomer.LeftChildCoding,lcus.RatingCoding, lcus.IsValid?"alan":"ahuang");

}if(!string.IsNullOrEmpty(mcustomer.RightChildCoding))

{

Sale.Model.Customer rcus=bcustomer.GetModel(mcustomer.RightChildCoding);

c2=string.Format("{0}({1}单)", mcustomer.RightChildCoding,rcus.RatingCoding,rcus.IsValid?"alan":"ahuang");

}

}

}if(coding=="左未注册"||coding=="右未注册")

{if(pcoding=="左未注册"||pcoding=="右未注册")

{returns.Replace("左孩子", c1).Replace("右孩子", c2).Replace("根节点",string.Format("

{0} 
", coding));

}elsereturns.Replace("左孩子", c1).Replace("右孩子", c2).Replace("根节点",string.Format("

{2} 
", pcoding, coding=="左未注册"?"0":"1", coding));

}elsereturns.Replace("左孩子", c1).Replace("右孩子", c2).Replace("根节点",string.Format("{0}({1}单)", coding, mcustomer.RatingCoding,mcustomer.IsValid?"alan":"ahuang"));

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值