public void insertarPilotoLicencia(PilotoLicencia pilotolicencia) { OracleConnection ora = new OracleConnection("DATA SOURCE=TOSHIBA-PC:1521/XE;PASSWORD=ORACLE01;USER ID=DESARROLLO"); ora.Open(); OracleCommand comando = new OracleCommand("INSERTARPILOTOLICENCIA", ora); comando.CommandType = CommandType.StoredProcedure; comando.Parameters.Add("IDPILOTO", OracleDbType.Int32).Value = pilotolicencia.IDPILOTO; comando.Parameters.Add("IDTIPOLICENCIA", OracleDbType.Int32).Value = pilotolicencia.IDTIPOLICENCIA; comando.ExecuteNonQuery(); }
private void btnAgregarPilotoLicencia_Click(object sender, EventArgs e) { try { Piloto pilo = new Piloto(); TipoLicencia tl = new TipoLicencia(); pilo = Singleton.opPiloto.buscarPilotoPorNombre(cbonombrePiloto.Text); var idpilo = pilo.idPiloto.ToString(); tl = Singleton.optipolicencia.buscarPorDescripcion(cboTipoLicencia.Text); var idtl = tl.IDTIPOLICENCIA.ToString(); PilotoLicencia pl = new PilotoLicencia() { IDPILOTO = Convert.ToInt32(idpilo), IDTIPOLICENCIA = Convert.ToInt32(idtl) }; Singleton.opPilotoLicencia.insertarPilotoLicencia(pl); MessageBox.Show("Piloto licencia insertado correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { } }
public void ActualizarPilotoLicencia(PilotoLicencia pilotoLicencia) { _db.Update(); }