foreach (OF_Area area1 in areaManager.GetAreasByPAreaID(0))
{
TreeNode node1 = new TreeNode();
node1.Text = area1.AreaName;
node1.Value = area1.AreaID.ToString();
foreach (OF_Area area2 in areaManager.GetAreasByPAreaID(area1.AreaID))
{
TreeNode node2 = new TreeNode();
node2.Text = area2.AreaName;
node2.Value = area2.AreaID.ToString();
foreach (OF_Area area3 in areaManager.GetAreasByPAreaID(area2.AreaID))
{
TreeNode node3 = new TreeNode();
node3.Text = area3.AreaName;
node3.Value = area3.AreaID.ToString();
node2.ChildNodes.Add(node3);
}
node1.ChildNodes.Add(node2);
}
tvArea.Nodes.Add(node1);
}
将以上代码改成递归