Exemplo n.º 1
0
        void BindTreeView()
        {
            Daiv_OA.BLL.DepartmentBLL dp = new Daiv_OA.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;
        }
Exemplo n.º 2
0
 void department()
 {
     Daiv_OA.BLL.DepartmentBLL dps = new Daiv_OA.BLL.DepartmentBLL();
     DropDownList1.DataSource     = dps.GetList("").Tables[0];
     DropDownList1.DataTextField  = "DName";
     DropDownList1.DataValueField = "Did";
     DropDownList1.DataBind();
     DropDownList1.Items.Insert(0, new ListItem("管理部", "0"));
 }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     User_Load("user-add");
     if (!this.IsPostBack)
     {
         string sql = "";
         Daiv_OA.BLL.DepartmentBLL dp = new Daiv_OA.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();
     }
 }
Exemplo n.º 4
0
        public string getstrobj(object name, int i)
        {
            Daiv_OA.BLL.DepartmentBLL dp = new Daiv_OA.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);
        }