Example #1
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        if (Validator.gotBadWords(txtFName.Text) == false && Validator.IsitFilledin(txtFName.Text) == true)

        {
            PersonV2 temp = new PersonV2();
            temp.PersonFirst = txtFName.Text;
            temp.Person_ID   = Convert.ToInt32(lblPerson_ID.Text);

            lblFeedback.Text = temp.UpdateAPerson().ToString() + " Records Updated!";
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }
    }
Example #2
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        PersonV2 input = new PersonV2();

        input.Person_ID = Convert.ToInt32(lblPerson_ID.Text);

        if (Validator.gotBadWords(txtFName.Text) == false)

        {
            input.PersonFirst = txtFName.Text;
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }

        if (Validator.gotBadWords(txtMName.Text) == false)

        {
            input.PersonMiddle = txtMName.Text;
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }

        if (Validator.gotBadWords(txtLName.Text) == false)

        {
            input.PersonLast = txtLName.Text;
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }

        if (Validator.gotBadWords(txtStreet.Text) == false)

        {
            input.PersonStreet = txtStreet.Text;
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }

        if (Validator.gotBadWords(txtCity.Text) == false)

        {
            input.PersonCity = txtCity.Text;
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }

        if (Validator.gotBadWords(txtState.Text) == false)

        {
            input.PersonState = txtState.Text;
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }

        if (Validator.gotBadWords(txtZip.Text) == false)

        {
            input.PersonZip = txtZip.Text;
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }

        if (Validator.gotBadWords(txtNum.Text) == false)

        {
            input.PersonNum = txtNum.Text;
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }

        if (Validator.gotBadWords(txtMail.Text) == false)

        {
            input.PersonMail = txtMail.Text;
        }

        else
        {
            lblFeedback.Text = "Update Failed Try again.";
        }

        lblFeedback.Text = input.UpdateAPerson(1).ToString() + " Records Updated!";
    }