Ejemplo n.º 1
0
        protected void btnReset_Click(object sender, EventArgs e)
        {
            UserBAL  userBAL = new UserBAL();
            UserBE   user    = new UserBE();
            LoggedIn master  = (LoggedIn)this.Master;

            if (txtOldPass.Text == commonBAL.Decrypt(((UserBE)Session["LoggedInUser"]).EncPass.ToString(), false))
            {
                user.UserId  = Convert.ToInt32(((UserBE)Session["LoggedInUser"]).UserId);
                user.EncPass = commonBAL.Encrypt(txtNewPass.Text, false);
                if (txtNewPass.Text == txtconfirmPass.Text)
                {
                    if (userBAL.ResetPassword(user))
                    {
                        master.ShowMessage("Password Changed Successfully", true);
                    }
                    else
                    {
                        master.ShowMessage("Unsuccessful", false);
                    }
                }
                else
                {
                    master.ShowMessage("Password Mismatched", false);
                }
            }
            else
            {
                master.ShowMessage("Incorrect Old Password", false);
            }
        }
        protected void LoadUserDetails(ForgotPasswordBE forgotBE)
        {
            DataTable dtUserDetails = new DataTable();
            CommonBAL commonBAL     = new CommonBAL();

            dtUserDetails = (DataTable)Session["PasswordRequest"];

            forgotBE.FirstName = dtUserDetails.Rows[0]["FirstName"].ToString();
            forgotBE.EncPass   = commonBAL.Decrypt(dtUserDetails.Rows[0]["EncPass"].ToString(), false);
            forgotBE.UserName  = dtUserDetails.Rows[0]["UserName"].ToString();



            // string Password = commonBAL.Decrypt(forgotBE.EncPass, false);
        }