protected void btnNext_Click(object sender, EventArgs e) { try { if (!String.IsNullOrEmpty(txtEmail.Value)) { DataSet dsUsers = secBLLUser.Open_LoginInfo(txtEmail.Value, "", "ForgotPSWD"); if (dsUsers != null && dsUsers.Tables.Count > 0 && dsUsers.Tables[0].Rows.Count > 0) { Session["UserEmail"] = dsUsers.Tables[0].Rows[0]["UserEmail"].ToString(); Session["UserInfo"] = dsUsers.Tables[0].Rows[0]["UserCode"].ToString(); ScriptManager.RegisterStartupScript(this, this.GetType(), "GetDate", "GetDate();", true); } else { strResult = "Eval"; ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "GetAlert('" + strResult + "');", true); txtEmail.Focus(); } } else { strResult = "Empty"; ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "GetAlert('" + strResult + "');", true); txtEmail.Focus(); } } catch (Exception ex) { LError.LogError("GTKSSO.UI.ForgotPassword", "btnNext_Click", ex.Message.ToString().Replace("\r\n", ""), Session["UserInfo"].ToString(), true); } }
private void Open(string Code) { try { dsUsers = secBLLUser.Open_LoginInfo(Code, "", "Token"); if (dsUsers.Tables.Count > 0 && dsUsers.Tables[0] != null && dsUsers.Tables[0].Rows.Count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "GetDate", "GetDate();", true); } else { //Token is invalid. strResult = "INV"; ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "GetAlert('" + strResult + "');", true); } } catch (Exception ex) { LError.LogError("GTKSSO.UI.ResetPassword", "open", ex.Message.ToString().Replace("\r\n", ""), usercode, true); } }