protected void Page_Load(object sender, EventArgs e) { #region "原始代码" //if (!Page.IsPostBack) //{ // dt = DateTime.Now; // if (!String.IsNullOrEmpty(Request.QueryString["UnitCode"])) // { // string unitCode = Request.QueryString["UnitCode"]; // deptName = smBFL.GetDeptNameByDeptID(unitCode); // this.GridView1.DataSource = smBFL.GetUserByUnitCode(unitCode); // this.GridView1.DataBind(); // } //} #endregion #region "修改代码 修改日期 2007-1-9" dt = RS_ScoreExtend.CheckMonth; if (!Page.IsPostBack) { if (!String.IsNullOrEmpty(Request.QueryString["UnitCode"])) { string unitCode = Request.QueryString["UnitCode"]; deptName = smBFL.GetDeptNameByDeptID(unitCode); RS_ScoreExtend sExtend = new RS_ScoreExtend(); this.GridView1.DataSource = sExtend.GetUsersByCode(user.UserCode, unitCode); this.GridView1.DataBind(); } } #endregion }
/// <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(); }
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; } } }