コード例 #1
0
        protected void ButtonSubmit_Click(object sender, EventArgs e)
        {
            CustomerUtil c = new CustomerUtil();

            c.UserName = TextBoxUserName.Text;
            c.FName    = TextBoxFName.Text;
            c.LName    = TextBoxLName.Text;
            c.Email    = TextBoxEmail.Text;
            c.Country  = DropDownListCountry.SelectedItem.ToString();
            c.Password = TextBoxPassword.Text;
            c.Age      = TextBoxAge.Text;
            if (RadioButtonFemale.Checked)
            {
                c.Gender = "F";
            }
            else
            {
                c.Gender = "M";
            }
            if (c.CheckUserExist() == false)
            {
                c.InsertData();
                LabelWelcome.Text      = "You just registered with server!";
                LabelWelcome.ForeColor = Color.Red;
                Response.AddHeader("refresh", "4, url=Home.aspx");
            }//close if
            else
            {
                LabelWelcome.Text      = "User already Existed!!";
                LabelWelcome.ForeColor = Color.Red;
                Response.AddHeader("refresh", "4, url=Login.aspx");
            }
        }