Exemplo n.º 1
0
 public Viaje(string unDestino, DateTime unaLlegada, string unOrigen, DateTime unaSalida, Tren unTren)
 {
     destino = unDestino;
     llegada = unaLlegada;
     origen  = unOrigen;
     salida  = unaSalida;
     tren    = unTren;
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Controller unControlador = new Controller();

            Pasajero jose    = new Pasajero("Zudaire", "41007286", false, "José");
            Pasajero bonjovi = new Pasajero("Bongiovi", "1234567", true, "John");

            DateTime hora1 = new DateTime(2020, 10, 16, 8, 0, 0);
            DateTime hora2 = new DateTime(2020, 10, 16, 8, 30, 0);

            Tren unTren = new Tren();

            Viaje unViaje = new Viaje("Pergamino", hora1, "Retiro", hora2, unTren);

            Pasajero[] pasajeros = { jose, bonjovi };

            unControlador.comprarPasajes(false, unViaje, pasajeros);

            foreach (Viaje viaje in unControlador.getViajes())
            {
                Console.WriteLine(viaje.getDestino());
            }
            Console.ReadLine();
        }