protected void imgbtn_Click1(object sender, EventArgs e) { ForgotPasswordDAL obj = new ForgotPasswordDAL(); DataTable dt = obj.SelectUserForgotPassword(strConnection, txtEmail.Text.Trim()); if (dt.Rows.Count > 0 && txtEmail.Text.Trim() == dt.Rows[0]["Email"].ToString()) { string body = "<a href='" + "http://transportnew.cogxim.com/ForgotPasswrd.aspx?QryRestPswd=" + dt.Rows[0]["RandomNum"].ToString() + "&uid=" + dt.Rows[0]["ID"].ToString() + "&usid=" + dt.Rows[0]["UID"].ToString() + "' target='_blank'>Click here to reset password</a>"; string EmailBody = string.Empty;// tblEmailTemplate EmailTemplates = obj.SelectUserMailTemplates("ForgotPassword"); EmailBody = EmailTemplates.Body.ToString(); EmailBody = EmailBody.Replace("$$UrlLink$$", body); string FromMail = System.Configuration.ConfigurationManager.AppSettings["FROMEMAIL"].ToString(); if (SendEMailMsg(txtEmail.Text.Trim(), "", "", "Forgot Password", EmailBody)) { txtEmail.Text = ""; lblMessage.Visible = true; lblMessage.ForeColor = System.Drawing.Color.Green; lblMessage.Text = "A confirm link send to your mail id, Please check your mailid."; } } else { lblMessage.Visible = true; lblMessage.ForeColor = System.Drawing.Color.Red; lblMessage.Text = "Mail ID does not exist"; } }
public bool SaveForgotPassDetails(ForgotPasswordBE forgotpass) { ForgotPasswordDAL forgotDAL = new ForgotPasswordDAL(); if (forgotDAL.SaveForgotPassDetails(forgotpass)) { return(true); } else { return(false); } }
public bool ForgotPassword(ref DataTable dt, ForgotPasswordBE forgotpass) { ForgotPasswordDAL forgotDAL = new ForgotPasswordDAL(); if (forgotDAL.ForgotPassword(ref dt, forgotpass)) { return(true); } else { return(false); } }
protected void btnResetPassword_OnClick(object sender, EventArgs e) { ForgotPasswordDAL obj = new ForgotPasswordDAL(); string password = WebTransport.Classes.EncryptDecryptPass.encryptPassword(txtPassword.Text.Trim()); DataTable dt = obj.UpdateUserPassword(strConnection, ViewState["UID"].ToString(), ViewState["USID"].ToString(), password); if (dt.Rows.Count > 0) { if (dt.Rows[0]["BIT"].ToString() == "1") { lblMessage.Visible = true; lblMessage.ForeColor = System.Drawing.Color.Green; multiResetPassword.ActiveViewIndex = 0; lblMessage.Text = dt.Rows[0]["MSG"].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["QryRestPswd"] != null && Request["uid"] != null && Request["usid"] != null) { string UID = Request["uid"].ToString(); string USID = Request["usid"].ToString(); string QryRestPswd = Request["QryRestPswd"].ToString(); if (UID != "" && USID != "" && QryRestPswd != "") { ViewState["UID"] = UID.ToString(); ViewState["USID"] = USID.ToString(); ForgotPasswordDAL obj = new ForgotPasswordDAL(); DataTable dt = obj.CheckUserForgotLink(strConnection, UID, USID, QryRestPswd); if (dt.Rows.Count > 0) { string Message = dt.Rows[0]["MSG"].ToString(); if (dt.Rows[0]["BIT"].ToString() == "1") { multiResetPassword.ActiveViewIndex = 1; } if (Message != "") { lblMessage.Visible = true; lblMessage.ForeColor = System.Drawing.Color.Red; lblMessage.Text = Message.ToString(); } } } } else { multiResetPassword.ActiveViewIndex = 0; txtEmail.Focus(); } } }