Ejemplo n.º 1
0
        protected void ButtonSubmit_Click(object sender, EventArgs e)
        {
            CustomerUtil customer = new CustomerUtil();

            customer.userName = TextBoxUsername.Text;
            customer.fName    = TextBoxFName.Text;
            customer.lName    = TextBoxLName.Text;
            customer.email    = TextBoxEmail.Text;
            customer.password = TextBoxPassword.Text;
            customer.age      = TextBoxAge.Text;
            if (RadioButtonFemale.Checked)
            {
                customer.gender = 'F';
            }
            else
            {
                customer.gender = 'M';
            }
            if (!customer.checkIfUserExists())
            {
                customer.insertData();
                LabelWelcome.Text      = "You have registered with Indiana Youth Services successfully!";
                LabelWelcome.ForeColor = System.Drawing.Color.Red;
                Response.AddHeader("refresh", "4; url=Login.aspx");
            }
            else
            {
                LabelWelcome.Text      = "User already exists!";
                LabelWelcome.ForeColor = System.Drawing.Color.Red;
                Response.AddHeader("refresh", "4; url=Registration.aspx");
            }
        }