private void Abm_Aeronave_Load(object sender, EventArgs e) { Llenador.LlenadorDeTablas lleni = new Llenador.LlenadorDeTablas(); lleni.llenarComboBox(ref comboBox1,"FABRICANTE","FABRICANTE_NOMBRE"); lleni.llenarComboBox(ref comboBox2, "SERVICIO","SERVICIO_NOMBRE"); comboBox1.SelectedIndex = 0; comboBox2.SelectedIndex = 0; }
private void boton_Modificar_Aeronave_Click(object sender, EventArgs e) { groupBox3.Visible = true; groupBox3.Refresh(); groupBox2.Enabled = false; this.Refresh(); Llenador.LlenadorDeTablas lleni = new Llenador.LlenadorDeTablas(); lleni.llenarComboBox(ref comboBox4, "FABRICANTE", "FABRICANTE_NOMBRE"); lleni.llenarComboBox(ref comboBox3, "SERVICIO", "SERVICIO_NOMBRE"); SqlCommand sqlCmd = new SqlCommand("select * from THE_CVENGERS.AERONAVE, THE_CVENGERS.SERVICIO, THE_CVENGERS.FABRICANTE where AERONAVE_FABRICANTE_AVION = FABRICANTE_ID and AERONAVE_SERVICIO = SERVICIO_ID and AERONAVE_MATRICULA_AVION ='" + ((Avion)listBox1.SelectedItem).getMatricula() + "'", Conexion.getConexion()); SqlDataReader sqlReader; sqlReader = sqlCmd.ExecuteReader(); sqlReader.Read(); textBox8.Text = sqlReader["AERONAVE_MATRICULA_AVION"].ToString(); textBox7.Text = sqlReader["AERONAVE_MODELO_AVION"].ToString(); comboBox4.SelectedIndex = comboBox4.Items.IndexOf(sqlReader["FABRICANTE_NOMBRE"].ToString()); comboBox3.SelectedIndex = comboBox3.Items.IndexOf(sqlReader["SERVICIO_NOMBRE"].ToString()); textBox6.Value = decimal.Parse(sqlReader["AERONAVE_CANTIDAD_BUTACAS"].ToString()); textBox5.Value = decimal.Parse(sqlReader["AERONAVE_ESPACIO_ENCOMIENDAS"].ToString()); matAnt = sqlReader["AERONAVE_ID"].ToString(); sqlReader.Close(); sqlCmd.CommandText = "select MAX(BUTACA_PISO) 'p' from THE_CVENGERS.BUTACA where BUTACA_AERONAVE =" + matAnt; sqlReader = sqlCmd.ExecuteReader(); sqlReader.Read(); numericUpDown1.Value = decimal.Parse(sqlReader["p"].ToString()); sqlReader.Close(); indiceSele = listBox1.SelectedIndex; }