private void lbl_form_user_registration_name_Click(object sender, EventArgs e) { User_registration newMember = new User_registration(); for (int i = 0; i < 7; i++) newMember.indicator[i] = true; newMember.Nm_usuario = txt_full_user_name.Text; newMember.Email = txt_user_mail_registration.Text; newMember.Nm_login = txt_access_name_registration.Text; newMember.Cd_senha = txt_password_registration.Text; newMember.Cd_senha_confirm = txt_confirm_password_registration.Text; if (combo_city.SelectedIndex > -1) { newMember.Nm_cidade = combo_city.SelectedItem.ToString(); } else { newMember.Nm_cidade = ""; } if (combo_type.SelectedIndex > -1) { newMember.Nm_tipo = combo_type.SelectedItem.ToString(); } else { newMember.Nm_tipo = ""; } for (int i = 0; i < newMember.indicator.Length; i++) { if (newMember.indicator[i] == false) { lbl_to_txt_invalid_fields.Visible = true; MessageBox.Show(i.ToString() + " - " + newMember.indicator[i].ToString()); return; } } Generics.try_connection(); string sQuery = "SELECT Usuario.nm_login,Usuario.email,Usuario.tp_usuario FROM Usuario WHERE (Usuario.nm_login = '******' OR Usuario.email = '" + txt_user_mail_registration.Text + "') AND Usuario.tp_usuario = '" + combo_type.SelectedItem.ToString() + "'"; if (Generics.select_especific_value(sQuery)) { lbl_to_txt_invalid_login_mail.Visible = true; } else { sQuery = "INSERT Usuario (nm_login,email,cd_senha,nm_usuario,nm_cidade,tp_usuario) VALUES ('" + txt_access_name_registration.Text + "','" + txt_user_mail_registration.Text + "','" + txt_password_registration.Text + "','" + txt_full_user_name.Text + "','" + combo_city.SelectedItem.ToString() + "','" + combo_type.SelectedItem.ToString() + "')"; Generics.select_NonQuery(sQuery); Generics.open_Login_Form(this); this.Close(); } }
private void frm_registration_Load(object sender, EventArgs e) { User_registration currentUser = new User_registration(); }