zoukankan      html  css  js  c++  java
  • DrpList

     private void ShowFolderList()
        {
            drpLegalType1.Items.Clear();
            string LegalTypeName=string.Empty;   

            DataSet ds = FieldType.GetList("t0025");//案件性质类别
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                LegalTypeName = ds.Tables[0].Rows[i]["TypeName"].ToString();
                this.drpLegalType1.Items.Add(new ListItem(LegalTypeName, LegalTypeName));
                addChildFolder(LegalTypeName);
            }
        }

        private void addChildFolder(string parentID)
        {
            string folder = string.Empty;
            string LegalTypeName = string.Empty;
            DataSet ds = FieldType.GetList2(parentID);

            if (ds.Tables[0].Rows.Count != 0)
            {          
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    LegalTypeName = ds.Tables[0].Rows[i]["TypeName"].ToString();
                    folder = "   ├" + LegalTypeName;            
                    this.drpLegalType1.Items.Add(new ListItem(folder, LegalTypeName));
                }
            }
        }
    ---------------------------------------------------------------------------------

    private void ShowFolderList()
      { 
       drpDep.Items.Clear();
       this.drpDep.Items.Add(new ListItem("--选择学院名称--","00"));
       string str="";
        str="select SD_ID,SD_NAME from SYS_DEPARTMENT where   SD_PARENTID=0";
       DataSet ds=sql.GetDataSet(str);
       for(int i=0;i<ds.Tables[0].Rows.Count;i++)
       {    
        int intSRSID = (int)ds.Tables[0].Rows[i]["SD_ID"];
        string folder = ds.Tables[0].Rows[i]["SD_NAME"].ToString();
        this.drpDep.Items.Add(new ListItem(folder,intSRSID.ToString()));               
        addChildFolder(intSRSID,1);
       }
      }

      private void addChildFolder(int parentID,int layer)
      {   
       string str="";   
       str="select SD_ID,SD_NAME from SYS_DEPARTMENT where   SD_PARENTID='"+parentID+"'order by SD_PARENTID asc";   
       DataSet ds=sql.GetDataSet(str);   
       if(ds.Tables[0].Rows.Count!=0)
       {
        layer++;
        for(int i=0;i<ds.Tables[0].Rows.Count;i++)
        {
         int intSRSID = (int)ds.Tables[0].Rows[i]["SD_ID"];
         string folder = "├"+ds.Tables[0].Rows[i]["SD_NAME"].ToString();
         for(int j=0;j<layer-1;j++)
         {
          folder =" "+folder;
         }
         this.drpDep.Items.Add(new ListItem(folder,intSRSID.ToString()));    
         if(IsParentID(intSRSID))
          addChildFolder(intSRSID,layer);   
         
        } 
       }
      }
      private bool IsParentID(int ParentID)
      {
       string str="select SD_ID,SD_NAME from SYS_DEPARTMENT where   SD_PARENTID='"+ParentID+"'";
       DataSet ds=sql.GetDataSet(str);
       if(ds!=null)
       {
        if(ds.Tables[0].Rows.Count!=0)
         return true;
        else
         return false;
       }
       else
        return false;
      }

  • 相关阅读:
    清除浮动的三种方式
    js控制滚动条默认在底部
    npm 基础命令
    package.json中^,~的区别
    mac 使用iTerm2快捷登录远程服务器
    iterm 分屏切换快捷键与配色设置
    git tag — 标签相关操作
    gulp iconfont
    webpack 3 升级 webpack4 个人笔记
    import * as x from 'xx' 和 import x from 'xx'
  • 原文地址:https://www.cnblogs.com/meiproject/p/928773.html
Copyright © 2011-2022 走看看