private void button2_Click(object sender, EventArgs e) { if (txtPass.Text != txtConfirm.Text) { MessageBox.Show("The Password is not identical!"); txtPass.Clear(); txtConfirm.Clear(); return; } int p = 0; if (RBnormal.Checked == true) { p = 3; } else if (RBsub.Checked == true) { p = 2; } else { MessageBox.Show("Please Select What you want to register as."); return; } if (ControllerObj.Add_New_Acc(txtUserName.Text, txtPass.Text, p) != 0) { MessageBox.Show("You have successfully registerd"); } else { MessageBox.Show("Sorry this username is already exist"); } }