Beispiel #1
0
    //根据选择的部门动态加载该部门下的所有员工
    protected void ddlDepartmentType_SelectedIndexChanged(object sender, EventArgs e)
    {
        //当部门的选中项改变时,人员也相对应的改变
        int departId = Convert.ToInt32(ddlDepartmentType.SelectedValue);

        ddlCompere.DataSourceID   = null;
        ddlCompere.DataSource     = UserInfoManager.GetAllUsersByDepartmentId(departId);
        ddlCompere.DataTextField  = "Name";
        ddlCompere.DataValueField = "UID";
        ddlCompere.DataBind();
    }
Beispiel #2
0
    protected void drpDept_DataBound(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(drpDept.SelectedValue.ToString());
        IList <UserInfo> userlist = UserInfoManager.GetAllUsersByDepartmentId(id);

        drpMan.Items.Clear();
        foreach (var item in userlist)
        {
            drpMan.Items.Add(new ListItem(item.Name, item.Name));
        }
    }
Beispiel #3
0
    private void NewMethod()
    {
        int id = 1;

        id = Convert.ToInt32(ddlDR_Department.SelectedValue);
        if (id != 0)
        {
            ddlDR_People.DataSource     = UserInfoManager.GetAllUsersByDepartmentId(id);
            ddlDR_People.DataValueField = "UID";
            ddlDR_People.DataTextField  = "Name";
            ddlDR_People.DataBind();
        }
        else
        {
            ddlDR_People.SelectedItem.Text = "请选择";
        }
    }
Beispiel #4
0
 //根据部门动态加载员工
 protected void ddlDepartment_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlDepartment.SelectedItem.Text == "请选择")
     {
         txtLeft.Items.Clear();
         return;
     }
     else
     {
         txtLeft.Items.Clear();
         //根据部门ID查询所有员工
         IList <UserInfo> list = UserInfoManager.GetAllUsersByDepartmentId(Convert.ToInt32(ddlDepartment.SelectedValue));
         for (int i = 0; i < list.Count; i++)
         {
             UserInfo userInfo = list[i];
             txtLeft.Items.Add(new ListItem(userInfo.Name, userInfo.Name));
         }
         txtLeft.DataBind();
     }
 }