protected void ButtonSubmit_Click(object sender, EventArgs e)
        {
            CustomerUtility customer = new CustomerUtility();

            customer.userName = TextBoxUserName.Text;
            customer.fName    = TextBoxFname.Text;
            customer.lName    = TextBoxLname.Text;
            customer.email    = TextBoxEmail.Text;
            customer.country  = DropDownListCountry.SelectedItem.ToString();
            customer.password = TextBoxPassword.Text;
            customer.age      = Convert.ToInt32(TextBoxAge.Text);
            if (RadioButtonFemale.Checked)
            {
                customer.gender = 'F';
            }
            else
            {
                customer.gender = 'M';
            }
            if (!customer.checkUserExist())
            {
                customer.insertData();
                LabelWelcome.Text      = "You have register with BSU pizaa sucsusfully";
                LabelWelcome.ForeColor = Color.Red;
                Response.AddHeader("refresh", "3;url=Login.aspx");
            }
            else
            {
                LabelWelcome.Text      = "User already exist";
                LabelWelcome.ForeColor = Color.Red;
                Response.AddHeader("refresh", "3;url=Login.aspx");
            }
        }//close Buttonsubmit
示例#2
0
        protected void ButtonSubmit_Click(object sender, EventArgs e)
        {
            CustomerUtility customer = new CustomerUtility();

            customer.userName = TextBoxUName.Text;
            customer.fName    = TextBoxFName.Text;
            customer.lName    = TextBoxLName.Text;
            customer.email    = TextBoxEmail.Text;
            customer.country  = DDL_Coutnry.SelectedItem.ToString();
            customer.password = TB_Password.Text;
            customer.age      = TB_Age.Text;
            if (RB_Female.Checked)
            {
                customer.gender = 'F';
            }
            else
            {
                customer.gender = 'M';
            }
            if (customer.isRegistered())
            {
                Label10.Text      = "This user already exists, please log in";
                Label10.ForeColor = System.Drawing.Color.Red;
                Response.AddHeader("refresh", "4;url=Login.aspx");
            }
            else
            {
                customer.insertData();
                Label10.Text      = "You have registered with BSU Pizza successfully!";
                Label10.ForeColor = System.Drawing.Color.Red;
                Response.AddHeader("refresh", "2; url=Login.aspx");
            }
        }