예제 #1
0
    /// <summary>
    /// 根据用户ID获取用户可以管理的部门
    /// </summary>
    /// <param name="userID">用户ID(编号)</param>
    protected void InitDeptDropDownList(string userID)
    {
        RS_ScoreExtend sExtend = new RS_ScoreExtend();

        this.DeptDropDownList.DataSource     = sExtend.GetUnitByUserCode(userID);
        this.DeptDropDownList.DataTextField  = "UnitName";
        this.DeptDropDownList.DataValueField = "UnitCode";
        this.DeptDropDownList.DataBind();
    }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (!String.IsNullOrEmpty(Request.QueryString["UserCode"]))
         {
             string userCode = Request.QueryString["UserCode"];
             if (!user.UserCode.Equals(userCode))
             {
                 this.ClosePage();
             }
             RS_ScoreExtend sExtend = new RS_ScoreExtend();
             lsUnitModel = sExtend.GetUnitByUserCode(user.UserCode);
             this.DeptRadioButtonList.DataSource     = lsUnitModel;
             this.DeptRadioButtonList.DataTextField  = "UnitName";
             this.DeptRadioButtonList.DataValueField = "UnitCode";
             this.DataBind();
             this.DeptRadioButtonList.SelectedIndex = 0;
         }
     }
 }