/// <summary>
 /// 分两种,一种是类型为叶节点,另一种是条目为叶子节点
 /// 本层加载的是类型
 /// </summary>
 protected void AddTopNodes(string type)
 {
     List<ZJGEportAssetsDB.DetailAssetsType> LAT = new ZJGEportAssetsDB.AssetsManage().SelectAssetsTypeList();
     ZJGEport.WebControls35.ZJGEportTreeNode node;
     for (int i = 0; i < LAT.Count; i++)
     {
         node = new ZJGEport.WebControls35.ZJGEportTreeNode();
         node.Text = LAT[i].TYPENAME;
         node.Value = LAT[i].TYPEGUID;
         if (type.ToUpper() == "TYPE")
         {
             TreeView1.RootNodeText = "所有资产类型";
             TreeView1.RootNodeUrl = "AssetsItem_List.aspx?TypeGuid=&TypeName=";
             node.NavigateUrl = "AssetsItem_List.aspx?TypeGuid=" + node.Value + "&TypeName=" + node.Text;
             node.PopulateOnDemand = false;
         }
         else
         {
             TreeView1.RootNodeText = "所有资产条目";
             TreeView1.RootNodeUrl = "AssetsStockIn_List.aspx";
             node.PopulateOnDemand = true;
             node.NavigateUrl = "AssetsStockIn_List.aspx?TypeGuid=" + node.Value + "&TypeName=" + node.Text;
         }
         TreeView1.Nodes.Add(node);
     }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     ZJGEportAssetsDB.AssetsManage AM = new ZJGEportAssetsDB.AssetsManage();
     if (!AM.IsAssetsTypeExists(txtTypeName.Text, "abc"))//如果不存在该类型名称
     {
         AM.InsertAssetsType(txtTypeName.Text, txtTypeNode.Text);
         CallJsFun("window.close();");
     }
     else
         ShowJsMessage("该类型名称已经存在,请检查.");
 }
        /// <summary>
        /// 根据资产类型显示相应的资产条目
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void TreeView1_TreeNodePopulate1(object sender, ZJGEportTreeNodeEventArgs e)
        {
            ZJGEportTreeNode pNode = e.Node;
            List<ZJGEportAssetsDB.DetailAssetsItems> DAI=new ZJGEportAssetsDB.AssetsManage().SelectAssetsItemList(pNode.Value);

            for (int i = 0; i < DAI.Count; i++)
            {
                ZJGEportTreeNode node = new ZJGEportTreeNode();
                node.Value = DAI[i].AssetsGuid;
                node.Text = DAI[i].AssetsName;
                node.PopulateOnDemand = false;
                node.NavigateUrl = "AssetsStockIn_List.aspx?AssetsGuid=" + node.Value + "&AssetsName=" + node.Text;
                pNode.ChildNodes.Add(node);
            }
        }