private void IniDeptTree(Node node, int leavel, string parCode) { IList <SsbDept> lst = basDeptManager.GetEntityList(new SsbDept() { DeptLevel = leavel + 1, ParentId = Convert.ToInt32(parCode) }, "DISPLAY_ID"); if (lst.Count == 0) { node.Icon = Icon.BuildingGo; node.Leaf = true; return; } foreach (SsbDept m in lst) { Node n = IniNode(m); n.NodeID = m.ObjId.ToString(); CheckNode(n); if (basDeptManager.GetRowCount(new SsbDept() { DeptLevel = leavel + 2, ParentId = m.ObjId }) == 0) { n.Icon = Icon.BuildingGo; n.Leaf = true; } else { n.Icon = Icon.Building; n.Leaf = false; } node.Children.Add(n); } }