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; }
private void Generacion_Viaje_Load(object sender, EventArgs e) { timePicker1.Format = DateTimePickerFormat.Time; timePicker2.Format = DateTimePickerFormat.Time; timePicker1.ShowUpDown = true; timePicker2.ShowUpDown = true; datePicker1.Format = DateTimePickerFormat.Custom; datePicker2.Format = DateTimePickerFormat.Custom; datePicker1.CustomFormat = "dd/MMM/yyyy"; datePicker2.CustomFormat = "dd/MMM/yyyy"; Llenador.LlenadorDeTablas lleni = new Llenador.LlenadorDeTablas(); lleni.llenarDGV_ABMRutas(dataGridView1); dataGridView1.Rows[0].Selected = false; //6 7 y 8 son primera clase, ejecutivo y turista comboBox1.Enabled = false; errorProvider2.Clear(); errorProvider1.SetError(comboBox1, "Debe seleccionar una ruta"); button1.Enabled = false; datePicker1.MinDate = DateTimeHandler.devolverFechaDB(); timePicker1.MinDate = DateTimeHandler.devolverFechaDB(); datePicker1.Value = DateTimeHandler.devolverFechaDB(); timePicker1.Value = DateTimeHandler.devolverFechaDB(); }
private void dataGridView1_SelectionChanged(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 0) return; select = dataGridView1.SelectedRows[0]; comboBox1.SelectedIndex = -1; comboBox1.Items.Clear(); comboBox1.Refresh(); Llenador.LlenadorDeTablas lleni = new Llenador.LlenadorDeTablas(); String cond = "(1=0"; if (select.Cells[6].Value.ToString().CompareTo("Si")>0) { cond = cond + "or AERONAVE_SERVICIO = 1"; } if (select.Cells[7].Value.ToString().CompareTo("Si") > 0) { cond = cond + "or AERONAVE_SERVICIO = 2"; } if (select.Cells[8].Value.ToString().CompareTo("Si") > 0) { cond = cond + "or AERONAVE_SERVICIO = 3"; } cond = cond + ") and AERONAVE_ESTADO = 1 and not exists(select * from THE_CVENGERS.TALLER where TALLER_AERONAVE_ID = AERONAVE_ID and THE_CVENGERS.fechaReal() between TALLER_FECHA_ENTRADA and TALLER_FECHA_SALIDA)"; lleni.llenarComboBoxConCondicion(ref comboBox1, "AERONAVE", "AERONAVE_MATRICULA_AVION", cond); errorProvider1.Clear(); errorProvider2.SetError(comboBox1, "Este campo solo muestra los aviones que proveen el servicio de la ruta seleccionada"); comboBox1.Enabled = true; }
private void ModificarRol_Load(object sender, EventArgs e) { this.Text = rol; if (rol == "Administrador" || rol == "Cliente") { label1.Enabled = false; textBox1.Enabled = false; button3.Enabled = false; errorProvider1.SetError(label1, "El nombre de los roles 'Administrador' y 'Cliente' no puede ser modificado"); } Llenador.LlenadorDeTablas llenu = new Llenador.LlenadorDeTablas(); llenu.llenarListBoxConCondicion(ref listBox1, "FUNCIONALIDAD f, THE_CVENGERS.FUNCIONXROL fxr, THE_CVENGERS.ROL r", "FUNC_NOMBRE", "fxr.FXR_FUNC_ID = f.FUNC_ID and fxr.FXR_ROL_ID = r.ROL_ID and r.ROL_NOMBRE = '" + rol + "'"); llenu.llenarListBoxSacandoLosDelOtro(ref listBox2,ref listBox1, "FUNCIONALIDAD", "FUNC_NOMBRE"); textBox1.Text = rol; button1.Enabled = false; button2.Enabled = false; }