Example #1
0
 //muestra en pantalla los datos del viaje seleccionado
 private void button2_Click(object sender, EventArgs e)
 {
     if (comboBox1.Text != "")
     {
         viaje viaje = comboBox1.SelectedItem as viaje;
         ORIGENtextBox1.Text    = viaje.dev_origen();                            //ORIGEN
         DESTINOtextBox1.Text   = viaje.dev_destino();                           //DESTINO
         textBox1.Text          = viaje.dev_fecha();                             //FECHA
         textBox2.Text          = viaje.dev_hora();                              //HORA
         CATEGORIAtextBox2.Text = viaje.dev_categoria();                         //CATEGORÍA
         EPRESAtextBox3.Text    = viaje.dev_empresa();                           //EMPRESA
         textBox3.Text          = viaje.dev_colectivo();                         //COLECTIVO ASIGNADO
         textBox4.Text          = (viaje.devolver_km()).ToString("N2") + " Km."; //DISTANCIA
     }
 }
Example #2
0
        //carga en los campos la información del viaje seleccionado
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            button2.Enabled = true;

            viaje selec = comboBox1.SelectedItem as viaje;

            textBox1.Text = selec.dev_origen();                          //ORIGEN
            textBox2.Text = selec.dev_destino();                         //DESTINO
            textBox3.Text = selec.dev_categoria();                       //CATEGORIA
            textBox4.Text = selec.dev_empresa();                         //EMPRESA
            textBox5.Text = selec.dev_fecha();                           //FECHA
            textBox6.Text = selec.dev_hora();                            //HORA
            textBox7.Text = (selec.asientos_libres().Last()).ToString(); //ASIENTO COMPRADO
            textBox8.Text = selec.devolver_tipo();                       //TIPO DE PASAJE
        }