Data_Control/zzjg_control.cs

(开头部分) 17KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;
using System.Data ;
using System.Data .SqlClient ;
using Data_Access ;

namespace Data_Control
{
    public  class zzjg_control:EquipmentDBConnection 
    {
        /// <summary>
        /// 显示完整组织结构树
        /// </summary>
        /// <returns>组织结构树</returns>
        public string TreeLoad()
        {
            using (SqlConnection conn = this.GetEquipmentConnStr())
            {
                conn.Open();
                string strSQL = "select * from Department order by DepartmentID asc";
                //SqlDataAdapter da = new SqlDataAdapter(strSQL, conn);
                //DataSet ds = new DataSet();
                //da.Fill(ds, "TreeAll");
                SqlCommand cmd = new SqlCommand(strSQL,conn );
                SqlDataReader dr = cmd.ExecuteReader();
                string arr_tree = "<DIV class=deeptree>";
                arr_tree += "<script language=javascript>";
                arr_tree += "var a=new TreeView(\'a\',\'main\');";
                //while (ds.Tables ["TreeAll"].Rows.Count !=0)
                while (dr.Read ())
                {
                    //arr_tree += "a.add(" + ds.Tables[0].Rows [0][0] + "," + ds.Tables[0].Rows[0][1] + ",\"" + ds.Tables [0].Rows [0][2].ToString() +
                    //    "\",\"sys_zzjg.aspx?id=" + ds.Tables[0].Rows[0][0] + "& NodeName=" + ds.Tables[0].Rows[0][2] +
                    //    "\",\"parnent\");";
                    arr_tree += "a.add(" + dr["DepartmentID"] + "," + dr["ParentID"] + ",\"" + dr["DepartmentName"].ToString() +
                    "\",\"sys_zzjg.aspx?id=" + dr["DepartmentID"] + "& NodeName=" + dr["DepartmentName"] +
                    "\",\"parnent\");";
                }
                arr_tree += "document.write(a);";
                arr_tree += "a.expandAll();";
                arr_tree += "</script>";
                arr_tree += "</DIV>";
                dr.Close();
                conn.Close();
                return arr_tree;
            }
        }
        /// <summary>
        /// 生成一个完整的部门树
        /// </summary>
        /// <param name="sel"></param>
        /// <returns></returns>
        public string TreeLoad(string sel)
        {
            //CreateDb mydb = new CreateDb();
            //IDataReader Rs = null;
            //DBManager my = mydb.Createdb();
            //my.OpenConn();
            using (SqlConnection conn = this.GetEquipmentConnStr())
后面还有 318 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。