Exemple #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DateTime fechaSelect = new DateTime();
                fechaSelect = dpFechaSalida.SelectedDate.Value;
                NeVuelo valFechaHora = new NeVuelo();
                int     resp;
                resp = valFechaHora.validarFechaHora(fechaSelect, hora);

                switch (resp)
                {
                case -1:
                    MessageBox.Show("Debe seleccionar un fecha futura");
                    break;

                case -2:
                    MessageBox.Show("Hora despegue debe tener 4 horas de anticipacion");
                    break;

                case 0:
                    if (radioButtonIrf.IsChecked == false & radioButtonVrf.IsChecked == false)
                    {
                        MessageBox.Show("Verifique que no existan datos vacios"); return;
                    }

                    else if (radioButtonIrf.IsChecked == true)
                    {
                        Sesion.SetValue("condicionVuelo", idCondicionVuelo);
                    }
                    else if (radioButtonVrf.IsChecked == true)
                    {
                        Sesion.SetValue("condicionVuelo", idCondicionVuelo);
                    }

                    ciudadOrigen           = new Ciudad();
                    ciudadDestino          = new Ciudad();
                    ciudadOrigen.IdCiudad  = Convert.ToInt32(comboBoxOrigen.SelectedValue.ToString());
                    ciudadDestino.IdCiudad = Convert.ToInt32(comboBoxDestino.SelectedValue.ToString());
                    string origen      = comboBoxOrigen.Text;
                    string destino     = comboBoxDestino.Text;
                    double kmDistancia = new double();
                    kmDistancia = neVueloGetCiudad.getDintancia(ciudadOrigen, ciudadDestino);
                    Sesion.SetValue("kmDistancia", kmDistancia);
                    Ingrear_vuelo_avion next = new Ingrear_vuelo_avion();
                    this.Hide();
                    next.ShowDialog();
                    break;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Verifique que no existan datos vacios");
            }
        }
 private void button_Click(object sender, RoutedEventArgs e)
 {
     this.Hide();
     windowsVueloAvion.ShowDialog();
 }