private void FrmInicial_Load(object sender, EventArgs e) { for (progress = 0; progress < 100; progress++) { this.Show(); prbCargaInicial.Value = progress; Show(); } conexion.ConnectionString = "server=localhost; database=check - on; Uid=root; Pwd = ; SslMode=none;"; conexion.Open(); if (progress == 100) { this.Hide(); FrmLogin frmLogin = new FrmLogin(); frmLogin.ShowDialog(); this.Close(); } }
private void btnRegistrar_Click(object sender, EventArgs e) { conexion.ConnectionString = "server=localhost; database=check - on; Uid=root; Pwd = ; SslMode=none;"; MySqlCommand comando = new MySqlCommand(); try { comando.CommandType = CommandType.Text; comando.CommandText = "insert into passenger(NamePassenger, LastNamePassenger, CC_Passenger, IdDivaice) values('" + txtNombres.Text + "', '" + txtApellidos.Text + "', '" + txtCedula.Text + "', '" + txtCodMaleta.Text + "')"; comando.Connection = conexion; comando.CommandText = "insert into layover(CC_Passenger) values('" + txtCedula.Text + "')"; conexion.Open(); comando.ExecuteNonQuery(); conexion.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } this.Hide(); FrmLogin frmLogin = new FrmLogin(); }
private void buttonRegistrar_Click(object sender, EventArgs e) { conexion.ConnectionString = "server=localhost; database=check - on; Uid=root; Pwd = ; SslMode=none;"; MySqlCommand comando = new MySqlCommand(); try { comando.CommandType = CommandType.Text; comando.CommandText = "insert into user(IdUser, CC_User, Password, NameUser, LastNameUser, TypeUser) values(" + txtId_User.Text + ", " + txtCedula.Text + ", '" + txtContrasena.Text + "', '" + txtNombre.Text + "' , '" + txtApellido.Text + "' ,'" + cmbTipoUsuario.Text + "')"; comando.Connection = conexion; conexion.Open(); comando.ExecuteNonQuery(); conexion.Close(); }catch (Exception ex) { MessageBox.Show(ex.Message); } this.Hide(); FrmLogin frmLogin = new FrmLogin(); frmLogin.ShowDialog(); }