Пример #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!";
        }
    }