Example #1
0
        protected void changebutton_Click(object sender, EventArgs e)
        {
            String oldpass  = oldpassword.Text.ToString();
            String newpass  = newpassword.Text.ToString();
            String confpass = confirmpassword.Text.ToString();
            bool   cekPW    = RepositoryUser.cekPass(oldpass);

            if (cekPW)
            {
                if (validation(newpass))
                {
                    if (newpass == confpass)
                    {
                        RepositoryUser.InsertNewPassword(oldpass, newpass);
                        Response.Redirect("ProfileMemberPage.aspx");
                    }
                    else
                    {
                        Response.Write("<script>alert('Your new password does not match with the confirmation password !')</script>");
                    }
                }
                else
                {
                    Response.Write("<script>alert('New password must atleast consists of 5 words.')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('Your old password does not match with your current login password !')</script>");
            }
        }