コード例 #1
0
        protected void btnChange_Click(object sender, EventArgs e)
        {
            if (txtNewPassword.Text.Length <= 0)
            {
                lblChangeFailure.Text = "There was an error in your new password, current password remains";
            }

            else
            {
                UserAccount    user   = (UserAccount)Session["UserAccountObj"];
                UserAccountBLL uBLL   = new UserAccountBLL();
                int            result = uBLL.DoUpdatePassword(user.UserId, user.Username, txtNewPassword.Text);

                if (result > 0)
                {
                    lblChangeSuccess.Text = "Successfully changed password";
                }

                else
                {
                    lblChangeFailure.Text = "There has been an error in changing password";
                }
            }
        }