public FormPrincipal(ref ListaVuelos listaVuelos, ref Grafo grafoVuelos)
        {
            InitializeComponent();

            listVuelos       = listaVuelos;
            this.grafoVuelos = grafoVuelos;
        }
        public FormVuelos(ref ListaVuelos listVuelos)
        {
            InitializeComponent();

            this.listVuelos          = listVuelos;
            listBoxVuelos.DataSource = listVuelos;
        }
        public FormRegistoVenta(ref ListaVuelos listVuelos, char origen, char destino, Pasajero pasajero)
        {
            InitializeComponent();

            this.listVuelos           = listVuelos;
            this.indiceSeleccionado   = new int();
            this.pasajeroAux          = pasajero;
            this.textBoxNombre.Text   = pasajero.Nombre;
            this.textBoxApellido.Text = pasajero.Apellido;
            this.textBoxEdad.Text     = pasajero.Edad.ToString();

            this.textBoxNombre.Enabled   = false;
            this.textBoxApellido.Enabled = false;
            this.textBoxEdad.Enabled     = false;

            for (int i = 0; i < listVuelos.Count; i++)
            {
                if (listVuelos[i].getOrigen() == origen && listVuelos[i].getDestino() == destino)
                {
                    indiceSeleccionado = i;
                }
            }

            identificadorAsiento = -1;
            labelVuelo.Text      = "Vuelo " + listVuelos[indiceSeleccionado].getCodigo() +
                                   "\nOrigen: " + listVuelos[indiceSeleccionado].getOrigen() +
                                   "\nDestino: " + listVuelos[indiceSeleccionado].getDestino() +
                                   "\nTiempo de Vuelo: " + listVuelos[indiceSeleccionado].getTiempo().ToString() + " min" +
                                   "\nCosto: $" + listVuelos[indiceSeleccionado].getCosto().ToString();

            if (identificadorAsiento == -1)
            {
                buttonVenta.Enabled = false;
            }
        }
Esempio n. 4
0
        public FormPasajeros(ref ListaVuelos listVuelos)
        {
            InitializeComponent();

            this.listVuelos = listVuelos;
            actualizaListView();
        }
        public FormCiudadesABC(ref Grafo listCiudades, ref ListaVuelos listaVuelos)
        {
            InitializeComponent();

            this.grafoVuelos = listCiudades;
            this.listaVuelos = listaVuelos;
            actualizarListBox();
        }
Esempio n. 6
0
        public FormVuelosABC(ref ListaVuelos listVuelos, ref Grafo grafoVuelos)
        {
            InitializeComponent();

            this.grafoVuelos = grafoVuelos;
            this.listVuelos  = listVuelos;
            actualizarListViewVuelos();
        }
Esempio n. 7
0
 public void guardarPasajeros(ListaVuelos listVuelos)
 {
     System.IO.StreamWriter writer = new System.IO.StreamWriter("Pasajeros.txt");
     foreach (Vuelo vuelo in listVuelos)
     {
         foreach (Pasajero pasajero in vuelo.getListPasajeros())
         {
             writer.WriteLine(pasajero.toStringOut());
         }
     }
     writer.Close();
 }
Esempio n. 8
0
        public FormDijkstra(Grafo grafoVuelos, ref ListaVuelos listaVuelos)
        {
            InitializeComponent();
            this.grafoVuelos = grafoVuelos;
            this.listaVuelos = listaVuelos;
            List <char> listC  = new List <char>();
            List <char> listC2 = new List <char>();

            for (int i = 0; i < grafoVuelos.Count; i++)
            {
                listC.Add(grafoVuelos[i].getOrigen());
                listC2.Add(grafoVuelos[i].getOrigen());
            }
            listC2.RemoveAt(0);
            this.listBoxVertices.DataSource = listC;
            this.listBoxDestinos.DataSource = listC2;
        }
Esempio n. 9
0
        public Grafo(ListaVuelos listaV, char b)
        {
            List <char> listaC = new List <char>();

            nodosKruskal = new ListaAristas();
            cantAristas  = new int();
            int x = new int();
            int y = new int();

            for (int i = 0; i < listaV.Count; i++)
            {
                if (!listaC.Contains((listaV[i].getOrigen())))
                {
                    listaC.Add(listaV[i].getOrigen());
                }
                if (!listaC.Contains((listaV[i].getDestino())))
                {
                    listaC.Add(listaV[i].getDestino());
                }
            }
            for (int i = 0; i < listaC.Count; i++)
            {
                ListaAristas listaA = new ListaAristas();
                for (int j = 0; j < listaV.Count; j++)
                {
                    if (listaC[i] == listaV[j].getOrigen())
                    {
                        for (int k = 0; k < this.Count; k++)
                        {
                            if (this[k].getOrigen() == listaV[j].getDestino())
                            {
                                x = this[k].X;
                                y = this[k].Y;
                            }
                        }
                        Arista a = new Arista(listaC[i], listaV[j].getDestino(), listaV[j].getTiempo(), x, y);
                        listaA.Add(a);
                        cantAristas++;
                    }
                }

                Vertice v = new Vertice(listaC[i], listaA);
                this.Add(v);
            }
        }
        public FormRegistoVenta(ref ListaVuelos listVuelos, int indiceSeleccionado)
        {
            InitializeComponent();

            this.listVuelos         = listVuelos;
            this.indiceSeleccionado = indiceSeleccionado;
            identificadorAsiento    = -1;
            labelVuelo.Text         = "Vuelo " + listVuelos[indiceSeleccionado].getCodigo() +
                                      "\nOrigen: " + listVuelos[indiceSeleccionado].getOrigen() +
                                      "\nDestino: " + listVuelos[indiceSeleccionado].getDestino() +
                                      "\nTiempo de Vuelo: " + listVuelos[indiceSeleccionado].getTiempo().ToString() + " min" +
                                      "\nCosto: $" + listVuelos[indiceSeleccionado].getCosto().ToString();

            if (identificadorAsiento == -1)
            {
                buttonVenta.Enabled = false;
            }
        }
Esempio n. 11
0
        private void textBoxBusqueda_TextChanged(object sender, EventArgs e)
        {
            ListaVuelos listVAux = new ListaVuelos();

            for (int i = 0; i < listVuelos.Count; i++)
            {
                if (textBoxBusqueda.Text == Convert.ToString(listVuelos[i].getDestino()) || textBoxBusqueda.Text == Convert.ToString(listVuelos[i].getOrigen()))
                {
                    listVAux.Add(listVuelos[i]);
                }
            }

            if (textBoxBusqueda.Text == "")
            {
                actualizarListViewVuelos();
            }

            listBoxVuelos.DataSource = null;
            listBoxVuelos.DataSource = listVAux;
        }
Esempio n. 12
0
        public void cargarPasajeros(ref ListaVuelos listaVuelos)
        {
            System.IO.StreamReader reader = new System.IO.StreamReader("Pasajeros.txt");
            string   cad;
            Pasajero pasajero;

            while (!reader.EndOfStream)
            {
                cad      = reader.ReadLine();
                pasajero = new Pasajero(cad);
                for (int i = 0; i < listaVuelos.Count; i++)
                {
                    if (listaVuelos[i].getCodigo() == pasajero.getRuta())
                    {
                        listaVuelos[i].getListPasajeros().Add(pasajero);
                    }
                }
            }

            reader.Close();
        }
Esempio n. 13
0
        static void Main()
        {
            ListaVuelos    listVuelos    = new ListaVuelos();
            ListaPasajeros listPasajeros = new ListaPasajeros();

            listVuelos.cargarVuelos();
            listPasajeros.cargarPasajeros(ref listVuelos);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Grafo grafoVuelos = new Grafo(listVuelos);

            grafoVuelos.cargarVertices();

            FormPrincipal menuPrincipal = new FormPrincipal(ref listVuelos, ref grafoVuelos);

            menuPrincipal.ShowDialog();
            grafoVuelos.guardarVertices();
            listVuelos.guardarVuelos();
            listPasajeros.guardarPasajeros(listVuelos);
        }