static void Main(string[] args)
        {
            Console.SetWindowSize(Console.WindowWidth, Console.WindowHeight + 3);

            var    flight_class_list = new List <FlightClass>();
            var    launcher          = new Launch();
            Thread thread_speech     = new Thread(launcher.Speech);
            Thread thread_launch     = new Thread(launcher.PlaneDrawing);
            var    c = flight_class_list.GetEnumerator();

            thread_speech.Start();
            thread_launch.Start();

            thread_launch.Join();

            Console.ForegroundColor = ConsoleColor.Gray;

            Flight[]    arrival  = new Flight[30];
            Flight[]    depature = new Flight[30];
            Passenger[] people   = new Passenger[30];
            for (int i = 0; i < 30; i++)
            {
                arrival[i]  = new Flight();
                depature[i] = new Flight();
                people[i]   = new Passenger();
            }

            Menu(ref arrival, ref depature, ref people, ref flight_class_list);
            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(Console.WindowWidth, Console.WindowHeight + 3);

            var    flight_class_list = new List <FlightClass>();
            var    flights           = new List <Flight>();
            var    passengers        = new List <Passenger>();
            var    launcher          = new Launch();
            Thread thread_speech     = new Thread(launcher.Speech);
            Thread thread_launch     = new Thread(launcher.PlaneDrawing);
            var    c = flight_class_list.GetEnumerator();

            thread_speech.Start();
            thread_launch.Start();

            thread_launch.Join();
            using (var ctx = new AirplaneContext())
            {
                //FlightClass stud = new FlightClass() { Name = "Flight Class2", Cost = 20 };

                //ctx.FlightClasses.Add(stud);
                ////ctx.Passengers.Attach(stud);
                ////ctx.ObjectStateManager.ChangeObjectState(overlaydb1, EntityState.Modified);
                //ctx.SaveChanges();

                //Flight flight = new Flight() { Flight_num = "first", City = "Kyiv", Airline = "National Airlines", Terminal = "A", Status = "boarding", Gate = 12 };
                //ctx.Flights.Add(flight);
                ////ctx.Passengers.Attach(stud);
                ////ctx.ObjectStateManager.ChangeObjectState(overlaydb1, EntityState.Modified);

                // ctx.SaveChanges();
            }


            using (var context = new AirplaneContext())
            {
                flight_class_list = context.FlightClasses.ToList <FlightClass>();

                flights = context.Flights.ToList <Flight>();

                passengers = context.Passengers.ToList <Passenger>();
            }



            Console.ForegroundColor = ConsoleColor.Gray;

            Flight[]    arrival  = new Flight[30];
            Flight[]    depature = new Flight[30];
            Passenger[] people   = new Passenger[30];
            for (int i = 0; i < 30; i++)
            {
                arrival[i]  = new Flight();
                depature[i] = new Flight();
                people[i]   = new Passenger();
            }

            int x = 0;

            foreach (Flight flight in flights)
            {
                arrival[x] = flight;
                x++;
            }
            x = 0;
            foreach (Passenger pers in passengers)
            {
                people[x] = pers;
                x++;
            }
            Menu(ref arrival, ref depature, ref people, ref flight_class_list);
            Console.ReadKey();
        }