private void BiudTree(int treeType) { DataTable table; SysTree tree = new SysTree(); if (treeType > -1) { table = tree.GetTreeList("TreeType = " + treeType).Tables[0]; } else { table = tree.GetTreeList("").Tables[0]; } this.listTarget.Items.Clear(); this.listTarget2.Items.Clear(); this.listTarget.Items.Add(new ListItem(SysManage.listTargetOne, "-1")); this.listTarget.Items.Add(new ListItem(SysManage.listTargetTwo, "0")); this.listTarget2.Items.Add(new ListItem(SysManage.listTargetTwo, "0")); foreach (DataRow row in table.Select("ParentID= " + 0)) { string str = row["NodeID"].ToString(); string text = row["TreeText"].ToString(); row["ParentID"].ToString(); row["PermissionID"].ToString(); text = "╋" + text; this.listTarget.Items.Add(new ListItem(text, str)); this.listTarget2.Items.Add(new ListItem(text, str)); int parentid = int.Parse(str); string blank = "├"; this.BindNode(parentid, table, blank); } this.listTarget.DataBind(); this.listTarget2.DataBind(); this.listTarget2.Items.Insert(0, new ListItem("移动到...", "")); }
private void BiudTree(int treeType) { DataTable table; SysTree tree = new SysTree(); if (treeType > -1) { table = tree.GetTreeList("TreeType = " + treeType).Tables[0]; } else { table = tree.GetTreeList("").Tables[0]; } this.listTarget.Items.Clear(); this.listTarget.Items.Add(new ListItem(Site.lblRootDirectory, "0")); foreach (DataRow row in table.Select("ParentID= " + 0)) { string str = row["NodeID"].ToString(); string text = row["TreeText"].ToString(); text = "╋" + text; this.listTarget.Items.Add(new ListItem(text, str)); int parentid = int.Parse(str); string blank = "├"; this.BindNode(parentid, table, blank); } this.listTarget.DataBind(); }
private void BiudTree() { SysTree tree = new SysTree(); DataTable dt = tree.GetTreeList("").Tables[0]; this.listTarget.Items.Clear(); this.listTarget.Items.Add(new ListItem(Site.lblRootDirectory, "0")); foreach (DataRow row in dt.Select("ParentID= " + 0)) { string str = row["NodeID"].ToString(); string text = row["TreeText"].ToString(); row["ParentID"].ToString(); row["PermissionID"].ToString(); text = "╋" + text; this.listTarget.Items.Add(new ListItem(text, str)); int parentid = int.Parse(str); string blank = "├"; this.BindNode(parentid, dt, blank); } this.listTarget.DataBind(); }