日期:2014-05-17 浏览次数:20660 次
private void BindTree()
{
TreeNode ParentNode;
TreeNode ChildNode;
TreeNode SzNote;
TreeNode SszNote;
TreeNode TreeList;
DataTable Dt = DbHelperSQL.QueryDataTable("SELECT ID,CompanyName FROM Company_Abbreviation");
DataTable SzDt = DbHelperSQL.QueryDataTable("SELECT ID,CardRightDescription FROM Card_Right");
DataTable SszDt = DbHelperSQL.QueryDataTable("SELECT distinct(JobType) FROM WorkType WHERE LEN(JobType)>0");
DataTable DtTreeList = DbHelperSQL.QueryDataTable("SELECT top 4 Work_Pos FROM WorkType");
//XX
ParentNode = new TreeNode("XX", "0", "Images/ParentNode.gif");
TreeView1.Nodes.Add(ParentNode);
ParentNode.Expanded = false;
ParentNode.NavigateUrl = "right.aspx?id=0";
ParentNode.Target = "mainFrame";
//ParentNode.SelectAction = TreeNodeSelectAction.Expand;
//公司
foreach (DataRow ChildRow in Dt.Rows)
{
ChildNode = new TreeNode(ChildRow["CompanyName"].ToString(), ChildRow["ID"].ToString(), "Images/ChildNode.gif");
ParentNode.ChildNodes.Add(ChildNode);
ChildNode.Expanded = false;
ChildNode.NavigateUrl = "right.aspx?id=1&company=" + ChildRow["CompanyName"].ToString();
ChildNode.Target = "mainFrame";
//ChildNode.SelectAction = TreeNodeSelectAction.Expand;
&nbs