zoukankan      html  css  js  c++  java
  • 杂杞

    protected internal void loadtree(ComponentArt.Web.UI.TreeView tv )
            
    {
                tv.Nodes.Clear();
                DataSet ds 
    =Sqlhelp.fillDataSet("select * from dept where Father_dept_ID=''");
                
    foreach(DataRow row in ds.Tables[0].Rows)
                
    {
                    TreeViewNode root 
    =new TreeViewNode();                
                    root.CssClass
    ="tree";
                    root.ImageUrl
    =@"..\..\image\treeimages\res.gif";
                    root.Text
    =row["Dept_name"].ToString();    
                    root.ID
    =row["Sub_dept_ID"].ToString();
                    loadtree(root,row[
    "Sub_dept_ID"].ToString());
                    tv.Nodes.Add(root);
                }
                
                tv.ExpandAll();
            }

            
    private void loadtree(TreeViewNode node,string deptid)
            
    {
                DataSet ds
    =    Sqlhelp.fillDataSet("select * from dept where Father_dept_ID='"+deptid+"'");
                
    foreach(DataRow row in ds.Tables[0].Rows)
                
    {
                    TreeViewNode subnode 
    =new TreeViewNode();                
                    subnode.Text
    =row["Dept_name"].ToString();
                    subnode.ID
    =row["Sub_dept_ID"].ToString();
                    node.Nodes.Add(subnode);                    
                    subnode.ImageUrl
    =@"..\..\image\treeimages\res.gif";
                    subnode.CssClass
    ="tree";
                    loadtree(subnode,row[
    "Sub_dept_ID"].ToString());
                }

            }
     
  • 相关阅读:
    Wrong codepoints for non-ASCII characters inserted in UTF-8 database using CLP
    SqlException with message "Caught java.io.CharConversionException." and ERRORCODE=-4220
    XSD 数据类型
    Can't read [proguard.ClassPathEntry@1a0c10f] (No such file or directory)
    ubuntu 创建swap分区
    tar分层压缩
    MTK 自定义系统服务
    MTK framework系统默认设置
    MTK 修改默认屏幕亮度
    MTK 隐藏底部状态栏
  • 原文地址:https://www.cnblogs.com/aipeli/p/295860.html
Copyright © 2011-2022 走看看