Example #1
0
    private void HandlerDataBind()
    {
        TSysUserVo objUser = new TSysUserVo();

        objUser.IS_USE  = "1";
        objUser.IS_DEL  = "0";
        objUser.IS_HIDE = "0";
        DataTable dt = new DataTable();

        dt = new TSysUserLogic().SelectByTable(objUser);

        HandlerList.DataSource     = dt;
        HandlerList.DataTextField  = "REAL_NAME";
        HandlerList.DataValueField = "ID";
        HandlerList.DataBind();

        //有直接上级就默认选择直接上级
        if (HandlerList.Items.Count > 0)
        {
            string    strLocalUserID = base.LogInfo.UserInfo.ID;
            DataTable dtDeptAdmin    = new TSysUserPostLogic().SelectDeptAdmin_byTable(strLocalUserID);
            if (dtDeptAdmin.Rows.Count > 0)
            {
                string strDeptAdminId = dtDeptAdmin.Rows[0]["user_id"].ToString();
                for (int i = 0; i < HandlerList.Items.Count; i++)
                {
                    if (HandlerList.Items[i].Value == strDeptAdminId)
                    {
                        HandlerList.SelectedIndex = i;
                    }
                }
            }
        }
    }
Example #2
0
    private void HandlerDataBind()
    {
        TSysUserVo objUser = new TSysUserVo();

        objUser.IS_USE  = "1";
        objUser.IS_DEL  = "0";
        objUser.IS_HIDE = "0";
        DataTable dt = new DataTable();

        dt = new TSysUserLogic().SelectByTable(objUser);

        HandlerList.DataSource     = dt;
        HandlerList.DataTextField  = "REAL_NAME";
        HandlerList.DataValueField = "ID";
        HandlerList.DataBind();
    }