コード例 #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (txtConfirmPassword.Text == txtNewPassword.Text)
            {
                AccountConnection account           = new AccountConnection();
                Qaelo.Models.SocietyModel.Society s = (Qaelo.Models.SocietyModel.Society)Session["SOCIETY"];

                //Test password

                if (account.correctSociety(s.Email, Secrecy.HashPassword(txtCurrentPassword.Text)) && account.updatePassword(s.Id, Secrecy.HashPassword(txtNewPassword.Text), Secrecy.HashPassword(txtCurrentPassword.Text)))
                {
                    lblSuccess.Text      = "Successfuly Updated Password";
                    lblErrorMessage.Text = "";
                }
                else
                {
                    lblErrorMessage.Text = "Incorrect Current Password";
                    lblSuccess.Text      = "";
                }
            }
            else
            {
                lblErrorMessage.Text = "New password and confirm Password Do not match ";
                lblSuccess.Text      = "";
            }
        }