コード例 #1
0
        void BindTreeView()
        {
            JumbotOA.BLL.DepartmentBLL dp = new JumbotOA.BLL.DepartmentBLL();
            string   fenlei = "全部";
            TreeNode yiji   = new TreeNode(fenlei, "-1");

            TreeView1.Nodes.Add(yiji);
            DataTable dt = new DataTable();

            dt = dp.GetList("").Tables[0];//得到部门
            for (int i = -1; i < dt.Rows.Count; i++)
            {
                TreeNode erjinote = new TreeNode();
                if (i == -1)
                {
                    erjinote.Value = "0"; erjinote.Text = "组织管理";
                }
                else
                {
                    erjinote.Value = dt.Rows[i]["Did"].ToString();
                    erjinote.Text  = dt.Rows[i]["DName"].ToString();
                }
                yiji.ChildNodes.Add(erjinote);
                NextNote(erjinote);
            }
            TreeView1.ExpandDepth = 1;
        }
コード例 #2
0
 void department()
 {
     JumbotOA.BLL.DepartmentBLL dps = new JumbotOA.BLL.DepartmentBLL();
     DropDownList1.DataSource     = dps.GetList("").Tables[0];
     DropDownList1.DataTextField  = "DName";
     DropDownList1.DataValueField = "Did";
     DropDownList1.DataBind();
     DropDownList1.Items.Insert(0, new ListItem("管理部", "0"));
 }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     User_Load("user-add");
     if (!this.IsPostBack)
     {
         string sql = "";
         JumbotOA.BLL.DepartmentBLL dp = new JumbotOA.BLL.DepartmentBLL();
         DataSet ds = dp.GetList(sql);
         for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
         {
             ListItem listItem = new ListItem();
             listItem.Text  = ds.Tables[0].Rows[j]["DName"].ToString();
             listItem.Value = ds.Tables[0].Rows[j]["Did"].ToString();
             // this.ddlDid.Items.Add(listItem);
         }
         ds.Clear();
     }
 }
 public string getstrobj(object name,int i)
 {
     JumbotOA.BLL.DepartmentBLL dp=new JumbotOA.BLL.DepartmentBLL ();
        string str="";
       switch(i)
       {
       case 1:
          str= user.GetList("Uid="+name.ToString()).Tables[0].Rows[0]["Uname"].ToString();
           break;
       case 2:
           if (name.ToString() == "0")
               str = "管理部";
           else
           str = dp.GetList("Did=" + name.ToString()).Tables[0].Rows[0]["DName"].ToString();
           break;
       }
       return str;
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     User_Load("user-add");
     if (!this.IsPostBack)
     {
         string sql = "";
         JumbotOA.BLL.DepartmentBLL dp = new JumbotOA.BLL.DepartmentBLL();
         DataSet ds = dp.GetList(sql);
         for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
         {
             ListItem listItem = new ListItem();
             listItem.Text = ds.Tables[0].Rows[j]["DName"].ToString();
             listItem.Value = ds.Tables[0].Rows[j]["Did"].ToString();
             this.ddlDid.Items.Add(listItem);
         }
         ds.Clear();
     }
 }
コード例 #6
0
        public string getstrobj(object name, int i)
        {
            JumbotOA.BLL.DepartmentBLL dp = new JumbotOA.BLL.DepartmentBLL();
            string str = "";

            switch (i)
            {
            case 1:
                str = user.GetList("Uid=" + name.ToString()).Tables[0].Rows[0]["Uname"].ToString();
                break;

            case 2:
                if (name.ToString() == "0")
                {
                    str = "管理部";
                }
                else
                {
                    str = dp.GetList("Did=" + name.ToString()).Tables[0].Rows[0]["DName"].ToString();
                }
                break;
            }
            return(str);
        }
 void drop()
 {
     JumbotOA.BLL.DepartmentBLL dp = new JumbotOA.BLL.DepartmentBLL();
         DropDownList1.DataSource = dp.GetList("").Tables[0];
         DropDownList1.DataTextField = "DName";
         DropDownList1.DataValueField = "Did";
         DropDownList1.DataBind();
         DropDownList1.Items.Insert(1, new ListItem("组织管理部", "0"));
         DropDownList1.Items.Insert(0, new ListItem("请选择部门", "-1"));
 }
コード例 #8
0
 void BindTreeView()
 {
     JumbotOA.BLL.DepartmentBLL dp = new JumbotOA.BLL.DepartmentBLL();
     string fenlei = "全部";
     TreeNode yiji = new TreeNode(fenlei, "-1");
     TreeView1.Nodes.Add(yiji);
     DataTable dt = new DataTable();
     dt = dp.GetList("").Tables[0];//得到部门
     for (int i = -1; i <dt.Rows.Count; i++)
     {
         TreeNode erjinote = new TreeNode();
         if (i == -1)
         {
             erjinote.Value = "0"; erjinote.Text = "组织管理";
         }
         else
         {
             erjinote.Value = dt.Rows[i]["Did"].ToString();
             erjinote.Text = dt.Rows[i]["DName"].ToString();
         }
         yiji.ChildNodes.Add(erjinote);
         NextNote(erjinote);
     }
     TreeView1.ExpandDepth = 1;
 }