private void button1_Click(object sender, EventArgs e)
        {
            string route;

            if (listViewFlights.SelectedItems.Count > 0)
            {
                foreach (ListViewItem item in listViewFlights.SelectedItems)
                {
                    route = item.Text;
                    FlightReservation flightReservation = new FlightReservation(flights, route);
                    flightReservation.ShowDialog();
                    if (flightReservation.getSell())
                    {
                        this.Close();
                    }
                }
            }
            else
            {
                MessageBox.Show("Seleccione un vuelo", "Advertencia",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Ejemplo n.º 2
0
        private void buttonBuy_Click(object sender, EventArgs e)
        {
            Passenger passenger = new Passenger();

            if (listViewDijkstra.Items.Count > 0)
            {
                obtenerRecorrido(ref recorridoOD);
                Console.WriteLine(recorridoOD);
                for (int i = 0; i < recorridoOD.Length - 1; i++)
                {
                    string ruta = "SK1";
                    ruta += recorridoOD[i];
                    ruta += recorridoOD[i + 1];

                    FlightReservation fg = new FlightReservation(flights, ruta, passenger, i);
                    fg.ShowDialog();
                    passenger = fg.getPassengerD();
                }
            }
            else
            {
                // no hay vuelo
            }
        }