protected void LogInBtn_Click(object sender, EventArgs e) { if (this.IsValid) { BusinessObjects.AuthorizationDS.StuffUserDataTable table = this.BLL.GetStuffUserByUserId(this.UserIdCtl.Text.Trim()); Session.Clear(); Session["StuffUser"] = table[0]; if (new AuthorizationBLL().GetProxyBusinessByProxyUserIDAndCurrentDate(table[0].StuffUserId, DateTime.Now).Count > 0) { this.Response.Redirect("~/BusinessProxySelect.aspx"); } else { AuthorizationDS.PositionDataTable positions = new AuthorizationBLL().GetPositionByStuffUser(table[0].StuffUserId); if (positions.Count > 1) { this.Response.Redirect("~/PositionSelect.aspx"); } else { this.Response.Redirect("~/Home.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { //base.Page_Load(sender, e); if (!this.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["extra"])) { string username = Request.QueryString["extra"]; if (username.IndexOf("\\") > -1) { username = username.Split('\\')[1].ToString(); } BusinessObjects.AuthorizationDS.StuffUserDataTable table = this.BLL.GetStuffUserByUserId(username); if (table.Count < 1) { this.odsMyAwaiting.SelectParameters["queryExpression"].DefaultValue = "1=2"; } else { AuthorizationDS.PositionDataTable positions = new AuthorizationBLL().GetPositionByStuffUser(table[0].StuffUserId); AuthorizationDS.StuffUserRow user = table[0]; Session.Clear(); Session["StuffUser"] = table[0]; if (positions != null && positions.Count >= 1) { this.Session["SelectedPosition"] = positions[0]; Session["Position"] = positions[0]; } int stuffuserID = table[0].StuffUserId; this.odsMyAwaiting.SelectParameters["queryExpression"].DefaultValue = "charindex('P" + stuffuserID.ToString() + "P',InTurnUserIds)>0"; } } else { this.odsMyAwaiting.SelectParameters["queryExpression"].DefaultValue = "1=2"; } } }