Example #1
0
    // BUTTON TO CHANGE THE LASTNAME OF THE USER !!!!
    protected void btnChangeLastname_Click(object sender, EventArgs e)
    {
        if (txtLastname.Text != "")
        {
            tbl_user person = new tbl_user();
            BLLChange bllchange = new BLLChange();
            person.user_tiwtter = (string)(System.Web.HttpContext.Current.Session["twitter"]);
            person.user_password = (string)(System.Web.HttpContext.Current.Session["password"]);
            person.user_lastname = txtLastname.Text;

            try
            {
                bllchange.newLast(person);
                lblFeedback2.Text = "Lastname changed!";
                txtLastname.Text = "";
            }

            catch (Exception)
            {
                lblFeedback2.Text = "Something went wrong, try again!";
            }

        }

        else
        {
            lblFeedback2.Text = "Please fill in your new Lastname please!";
        }
    }
Example #2
0
    // BUTTON TO CHANGE THE Password OF THE USER !!!!
    protected void btnChangePassword_Click(object sender, EventArgs e)
    {
        if (txtPassword.Text != "")
        {
            if (txtPassword.Text == txtPasswordCheck.Text)
            {

                tbl_user person = new tbl_user();
                BLLChange bllchange = new BLLChange();
                person.user_tiwtter = (string)(System.Web.HttpContext.Current.Session["twitter"]);
                person.user_password = txtPassword.Text;

                try
                {
                    bllchange.newPass(person);
                    lblFeedback2.Text = "Password changed!";
                    txtPassword.Text = "";
                }

                catch (Exception)
                {
                    lblFeedback2.Text = "Something went wrong, try again!";
                }
            }

            else
            {

                lblFeedback2.Text = "The passwords are not the same!";

            }

        }

        else
        {
            lblFeedback2.Text = "Please fill in your new Password please!";
        }
    }