public void SearchCommandExecute(string text)
 {
     SearchedAirlineCompany = wpfFacade.GetAirlineCompanyByName(text);
     Flights.Clear();
     if (SearchedAirlineCompany is null == false)
     {
         Flights.AddRange(wpfFacade.GetFlightsByAirlineCompanyId(SearchedAirlineCompany));
     }
 }
Esempio n. 2
0
        protected async override void OnInitialize()
        {
            Flights.AddRange(await bookedFlightsService.GetFlightsAsync());

            if (VoiceCommandName == "Status")
            {
                var booking = Flights.First(b => b.Name == Booking);

                SelectFlightAsync(booking, true);
            }
        }
Esempio n. 3
0
        public void Search()
        {
            Flights.Clear();

            var flights = Enumerable.Range(0, 10)
                          .Select(i => new FlightViewModel
            {
                Arrives = SelectedArrival,
                Departs = SelectedDeparture,
                Name    = String.Format("METRO {0}", i)
            });

            Flights.AddRange(flights);
        }
        private void OpenSavedAOI_Execute(object aoi)
        {
            if (aoi is AreaOfInterest aoiObj)
            {
                if (!AreasOfInterest.Any((a) => a.Name == aoiObj.Name))
                {
                    CmdCleanMap_Execute(null);
                    AreasOfInterest.Add(aoiObj);
                    Flights.AddRange(aoiObj.Flights);
                }

                NotifyPropertyChanged("AreasOfInterest");
                NotifyPropertyChanged("Flights");
                RenderMap();
            }
        }
Esempio n. 5
0
            public Scenario1()
            {
                Airplane1 = new Airplane {
                    Label = "Airplane1"
                };
                Airplane2 = new Airplane {
                    Label = "Airplane2"
                };

                Airplanes.Add(Airplane1);
                Airplanes.Add(Airplane2);

                Flights.AddRange(new Flight[]
                {
                    new Flight
                    {
                        Number   = "FLIGHT01",
                        Airplane = Airplane1,
                        Starts   = new DateTime(2018, 1, 1, 13, 57, 0),
                        Ends     = new DateTime(2018, 1, 1, 15, 33, 0),
                    },
                    new Flight
                    {
                        Number   = "FLIGHT02_COLLIDINGWITH01",
                        Airplane = Airplane1,
                        Starts   = new DateTime(2018, 1, 1, 14, 30, 0),
                        Ends     = new DateTime(2018, 1, 1, 17, 33, 0),
                    },
                    new Flight
                    {
                        Number   = "FLIGHT03",
                        Airplane = Airplane2,
                        Starts   = new DateTime(2018, 1, 1, 14, 30, 0),
                        Ends     = new DateTime(2018, 1, 1, 17, 33, 0),
                    }
                });

                foreach (var ap in Airplanes)
                {
                    ap.Flights = Flights.Where(x => x.Airplane == ap).ToList();
                }
            }
Esempio n. 6
0
 public void SetFligths(List <Flight> flights)
 {
     Flights.AddRange(flights);
 }