protectedstringbf(inti,stringcoding,stringpcoding,strings)
{stringc1="", c2="";if(coding=="左未注册"||coding=="右未注册")
{ c1="
c2=string.Format("
}
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("
}elsereturns.Replace("左孩子", c1).Replace("右孩子", c2).Replace("根节点",string.Format("
}elsereturns.Replace("左孩子", c1).Replace("右孩子", c2).Replace("根节点",string.Format("{0}({1}单)", coding, mcustomer.RatingCoding,mcustomer.IsValid?"alan":"ahuang"));
}