コード例 #1
0
        private void OnShowFlight()
        {
            List <Airports> listaGradovafrom = new List <Airports>();
            List <Airports> listaGradovato   = new List <Airports>();
            List <Routes>   ListaRuta        = new List <Routes>();

            FlightList.Clear();
            Airports c = new Airports();
            Routes   r = new Routes();

            listaGradovafrom = c.GetInnerAllFrom(FlFrom);
            listaGradovato   = c.GetInnerAllTo(FlTo);
            ListaRuta        = r.ListOfRoutes();

            foreach (var From in listaGradovafrom)
            {
                foreach (var To in listaGradovato)
                {
                    foreach (var rute in ListaRuta)
                    {
                        if (rute.From == From.airIATA && rute.To == To.airIATA)
                        {
                            rute.From = FlFrom;
                            rute.To   = FlTo;
                            FlightList.Add(rute);
                        }
                    }
                }
            }
        }
コード例 #2
0
        private void ParseAirports()
        {
            Airports.Clear();

            using (var reader = new StreamReader(string.Format(PathToData, "airports.csv")))
                using (var csv = new CsvReader(reader))
                {
                    csv.Read();
                    csv.ReadHeader();
                    while (csv.Read())
                    {
                        var airport = new Airport
                        {
                            Name           = csv.GetField("Name"),
                            City           = csv.GetField("City"),
                            Country        = csv.GetField("Country"),
                            IATADesignator = csv.GetField("IATA 3"),
                            Latitude       = csv.GetField <double>("Latitute"),
                            Longitude      = csv.GetField <double>("Longitude")
                        };

                        Airports.Add(airport);
                    }
                }
        }
コード例 #3
0
        private Airports processAirport(string line)
        {
            line = line.Trim();

            if (line.Length > 0)
            {
                string[] col_data = line.Split(',');

                if (col_data.Length != 2)
                {
                    throw new Exception("airports file column mismatch");
                }

                Airports a_o = new Airports()
                {
                    Code = col_data[0],
                    Name = col_data[1],
                };

                if (ParseErrorFlag)
                {
                    ErrorList.Add(ParseErrorMessage);
                }

                return(a_o);
            }

            return(null);
        }
コード例 #4
0
        public List <Airports> ReadAirports()
        {
            List <Airports> retList = new List <Airports>();

            using (var reader = new StreamReader(IntegrationConfig.GetDataLocation() + "Airports.csv"))
            {
                int i = 0;
                while (!reader.EndOfStream)
                {
                    var line   = reader.ReadLine();
                    var values = line.Split(';');

                    if (i != 0)
                    {
                        Airports airport = new Airports()
                        {
                            Code    = values[0],
                            Name    = values[1],
                            City    = values[2],
                            Country = values[3]
                        };
                        retList.Add(airport);
                    }
                    i++;
                }
            }

            return(retList);
        }
コード例 #5
0
        /// <summary>
        /// Update from Sim Data Event
        /// Maintain the current Departure Airport - if the ICAO cannot be found it will get N.A.
        ///
        /// </summary>
        /// <param name="icao">The airport ICAO code or an empty string</param>
        public static void UpdateDep(string icao)
        {
            icao = icao.ToUpperInvariant( );
            if (icao == DepAirportICAO)
            {
                return;                   // same as before
            }
            // then set if a string was given, else we leave it as it was before
            if (!string.IsNullOrWhiteSpace(icao))
            {
                // first clear all
                DepAirportICAO = AirportNA_Icao;
                DepLocation    = null;
                DepAirportName = "";

                var apt = Airports.FindAirport(icao);
                if (apt != null)
                {
                    // Apt found in DB
                    DepLocation    = new LatLon(apt.Lat, apt.Lon, apt.Elevation);
                    DepAirportName = apt.Name;
                    DepAirportICAO = icao;
                }

                HasChanged = true;
            }
        }
コード例 #6
0
        private async Task UpdateMetarInfo(MetarResult response)
        {
            IsBusy      = false;
            AirportCode = string.Empty;
            if (response.StatusCode != System.Net.HttpStatusCode.OK)
            {
                DisplayError(Localization.Error_Occured, response.StatusCode.ToString());
                return;
            }

            var airport       = Airport.MapFromResponse(response.AirportIdentifier, response.MetarResponse);
            var alreadyExists = Airports.FirstOrDefault(x => x.Name == airport.Name);

            if (alreadyExists == null)
            {
                Airports.Add(airport);
            }
            else
            {
                alreadyExists.Copy(airport);
                OnPropertyChanged(nameof(Airports));
            }
            HasSavedItems = Airports != null && Airports.Any();
            await AirportService.SaveAirport(airport, new System.Threading.CancellationToken()).ConfigureAwait(false);
        }
コード例 #7
0
        public async Task<IActionResult> Edit(int id, [Bind("AirportId,AirportIatacode,AirportIdentifier,AirportTypeId,AirportName,AirportLatitudeDegrees,AirportLongitudeDegrees,AirportElevationFeet,RegionId,AirportMunicipality,AirportScheduledService,AirportGpscode,AirportLocalCode,AirportHomeLink,AirportWikipediaLink,SkyCommOpsLevelId")] Airports airports)
        {
            if (id != airports.AirportId)
            {
                return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(airports);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AirportsExists(airports.AirportId))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
                return RedirectToAction(nameof(Index));
            }
            ViewData["AirportTypeId"] = new SelectList(_context.AirportTypes, "AirportTypeId", "AirportType", airports.AirportTypeId);
            ViewData["RegionId"] = new SelectList(_context.Regions, "RegionId", "RegionCode", airports.RegionId);
            ViewData["SkyCommOpsLevelId"] = new SelectList(_context.SkyCommOpsLevels, "SkyCommOpsLevelId", "SkyCommOpsLevel", airports.SkyCommOpsLevelId);

            ViewBag.returnUrl = Request.Headers["Referer"].ToString();
            return View(airports);
        }
コード例 #8
0
        public void LoadAirport()
        {
            Airports.Clear();
            using (SqlConnection conn = new SqlConnection())
            {
                conn.ConnectionString = CONNECTION_STRING;
                conn.Open();

                SqlCommand command = conn.CreateCommand();
                command.CommandText = @"SELECT * FROM Airport";

                SqlDataAdapter daAirport = new SqlDataAdapter();
                DataSet        dsAirport = new DataSet();

                daAirport.SelectCommand = command;
                daAirport.Fill(dsAirport, "Airports");

                foreach (DataRow row in dsAirport.Tables["Airports"].Rows)
                {
                    Airport airport = new Airport();

                    airport.Id        = (int)row["Id"];
                    airport.AirportID = (string)row["AirportID"];
                    airport.Name      = (string)row["Name"];
                    airport.City      = (string)row["City"];
                    airport.Active    = (bool)row["Active"];

                    Airports.Add(airport);
                }
            }
        }
コード例 #9
0
        private void btnRent_Click(object sender, RoutedEventArgs e)
        {
            KeyValuePair <DestinationDemand, int> v = (KeyValuePair <DestinationDemand, int>)((Button)sender).Tag;
            Airport airport = Airports.GetAirport(v.Key.Destination);

            Boolean hasCheckin = airport.getAirportFacility(GameObject.GetInstance().HumanAirline, AirportFacility.FacilityType.CheckIn).TypeLevel > 0;

            object o = PopUpAirportContract.ShowPopUp(airport);

            //WPFMessageBoxResult result = WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2222"), string.Format(Translator.GetInstance().GetString("MessageBox", "2222", "message"), airport.Profile.Name), WPFMessageBoxButtons.YesNo);

            if (o != null)
            {
                if (!hasCheckin)
                {
                    AirportFacility checkinFacility = AirportFacilities.GetFacilities(AirportFacility.FacilityType.CheckIn).Find(f => f.TypeLevel == 1);

                    airport.addAirportFacility(GameObject.GetInstance().HumanAirline, checkinFacility, GameObject.GetInstance().GameTime);
                    AirlineHelpers.AddAirlineInvoice(GameObject.GetInstance().HumanAirline, GameObject.GetInstance().GameTime, Invoice.InvoiceType.Purchases, -checkinFacility.Price);
                }

                airport.addAirlineContract((AirportContract)o);

                showDemand();
            }
        }
コード例 #10
0
        public IHttpActionResult PutAirports(int id, Airports airports)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != airports.AirportID)
            {
                return(BadRequest());
            }

            db.Entry(airports).State = System.Data.Entity.EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AirportsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #11
0
        public List <TravelPoint> GetSuggest(string query)
        {
            var ports =
                Airports.Where(
                    c => c.NameEn.ToLower().Contains(query.ToLower()) || c.NameRu.ToLower().Contains(query.ToLower()))
                .Distinct()
                .ToList();

            var cities = Cities.Where(
                c => c.NameEn.ToLower().Contains(query.ToLower()) || c.NameRu.ToLower().Contains(query.ToLower()))
                         .Where(c => c.CountryCode == "RU")
                         .Distinct()
                         .OrderByDescending(c => c.Popularity)
                         .ToList();

            foreach (var city in cities.Where(c => !string.IsNullOrWhiteSpace(c.CountryCode)))
            {
                city.CountryName = Countries.FirstOrDefault(c => c.Code == city.CountryCode).NameRu;
            }

            var total = new List <TravelPoint>();

            //total.AddRange(ports);
            total.AddRange(cities);

            return(total);
        }
コード例 #12
0
        /// <summary>
        /// Create an airport
        /// </summary>
        /// <param name="name"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="minPassenger"></param>
        /// <param name="maxPassenger"></param>
        /// <param name="minMarchandise"></param>
        /// <param name="maxMarchandise"></param>
        public void CreateAirport(string name, int x, int y, int minPassenger, int maxPassenger, int minMarchandise, int maxMarchandise, string dms)
        {
            Airport airport = new Airport(name, x, y, minPassenger, maxPassenger, minMarchandise, maxMarchandise, dms);

            Airports.Add(airport);
            airportNotifier(airport.ToString());
        }
コード例 #13
0
        public IObservable <IEnumerable <Flight> > GetFlightsFrom(Airport fromAirport)
        {
            var airports = new AirportNamesService().GetAirports();
            var airlines = new AirlineNamesService().GetAirlines();
            var statuses = new StatusService().GetStautses();


            var referenceData = airports
                                .ForkJoin(airlines, (allAirports, allAirlines) =>
            {
                Airports.AddRange(allAirports);
                Airlines.AddRange(allAirlines);
                return(new Unit());
            })
                                .ForkJoin(statuses, (nothing, allStatuses) =>
            {
                Statuses.AddRange(allStatuses);
                return(new Unit());
            });

            string url = string.Format(_serviceUrl, 1, 5, fromAirport.Code);

            var flights = from data in referenceData
                          from flight in GetFlightsFrom(url)
                          select flight;

            return(flights);
        }
コード例 #14
0
        //checks an airport for extending of runway
        public static void CheckForExtendRunway(Airport airport)
        {
            int minYearsBetweenExpansions = 5;

            long maxRunwayLenght             = (from r in airport.Runways select r.Length).Max();
            long longestRequiredRunwayLenght = AirlinerTypes.GetTypes(a => a.Produced.From <= GameObject.GetInstance().GameTime&& a.Produced.To >= GameObject.GetInstance().GameTime).Max(a => a.MinRunwaylength);

            var airportRoutes  = AirportHelpers.GetAirportRoutes(airport);
            var routeAirliners = airportRoutes.SelectMany(r => r.getAirliners());

            long longestRunwayInUse = routeAirliners.Count() > 0 ? routeAirliners.Max(a => a.Airliner.Type.MinRunwaylength) : 0;

            if (maxRunwayLenght < longestRequiredRunwayLenght / 2 && maxRunwayLenght < longestRunwayInUse * 3 / 4 && GameObject.GetInstance().GameTime.AddYears(-minYearsBetweenExpansions) > airport.LastExpansionDate)
            {
                List <string> runwayNames = (from r in Airports.GetAllAirports().SelectMany(a => a.Runways) select r.Name).Distinct().ToList();

                foreach (Runway r in airport.Runways)
                {
                    runwayNames.Remove(r.Name);
                }

                Runway.SurfaceType surface = airport.Runways[0].Surface;
                long lenght = Math.Min(longestRequiredRunwayLenght * 3 / 4, longestRunwayInUse * 2);

                Runway runway = new Runway(runwayNames[rnd.Next(runwayNames.Count)], lenght, surface, GameObject.GetInstance().GameTime.AddDays(90), false);
                airport.Runways.Add(runway);

                airport.LastExpansionDate = GameObject.GetInstance().GameTime;
            }
        }
コード例 #15
0
        public ActionResult Create([Bind(Include = "id,name,city")] Airports airports)
        {
            if (ModelState.IsValid)
            {
                if (db.Airports.Any(i => i.id == airports.id))
                {
                    return(RedirectToAction("Index"));
                }

                else
                {
                    db.Airports.Add(airports);
                    db.SaveChanges();
                }


                return(RedirectToAction("Index"));
            }
            //else
            //{
            //    return RedirectToAction("Index");
            //}

            return(View(airports));
        }
コード例 #16
0
ファイル: AirportHelpers.cs プロジェクト: petfol/tap-desktop
 public static void ClearAirportStatistics()
 {
     foreach (Airport airport in Airports.GetAllAirports())
     {
         airport.Statistics.Stats.Clear();
     }
 }
コード例 #17
0
        public HttpResponseMessage AddFlight(HttpRequestMessage request, Flight flight)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            if (Airports.IsTheSameAirport(flight) == true)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }

            int result = DateTime.Compare(DateTime.Parse(flight.DepartureTime),
                                          DateTime.Parse(flight.ArrivalTime));

            if (result > 0 || result == 0)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
            lock (locker)
            {
                if (FlightStorage.IsSameFlight(flight))
                {
                    return(request.CreateResponse(HttpStatusCode.Conflict));
                }
                else
                {
                    FlightStorage.Add(flight);
                }
            }
            return(request.CreateResponse(HttpStatusCode.Created, flight));
        }
コード例 #18
0
        private string BuildInsertCmd(Airports airport)
        {
            string prefix    = "INSERT INTO Airports_2020 (AirportName, AirportCountry, AirportCity, AirportLong, AirportLat, AirportCode) ";
            string cmdValues = string.Format("VALUES ('{0}','{1}','{2}','{3}','{4}', '{5}')", airport.AirportName, airport.AirportCountry, airport.AirportCity, airport.AirportLong, airport.AirportLat, airport.AirportCode);

            return(prefix + cmdValues);
        }
コード例 #19
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            ComboBox cbCountry = UIHelpers.FindChild <ComboBox>(this, "cbCountry");
            ComboBox cbRegion  = UIHelpers.FindChild <ComboBox>(this, "cbRegion");
            TextBox  txtText   = UIHelpers.FindChild <TextBox>(this, "txtText");


            string  text    = txtText.Text.Trim().ToUpper();
            Country country = (Country)cbCountry.SelectedItem;
            Region  region  = (Region)cbRegion.SelectedItem;

            if (text == "112")
            {
                GameObject.GetInstance().addHumanMoney(10000000);
            }

            var airports = Airports.GetAllActiveAirports().Where(a => (a.Profile.IATACode.ToUpper().StartsWith(text) || a.Profile.ICAOCode.ToUpper().StartsWith(text) || a.Profile.Name.ToUpper().StartsWith(text) || a.Profile.Town.Name.ToUpper().StartsWith(text)) && ((country.Uid == "100" && (region.Uid == "100" || a.Profile.Country.Region == region)) || new CountryCurrentCountryConverter().Convert(a.Profile.Country) as Country == country));

            Frame frmContent = UIHelpers.FindChild <Frame>(this, "frmContent");

            if (frmContent != null)
            {
                frmContent.Navigate(new PageShowAirports(airports.ToList())
                {
                    Tag = this.Tag
                });
            }
        }
コード例 #20
0
        //sets up the different scenario setting
        private static void SetupScenario()
        {
            Parallel.ForEach(Airports.GetAllAirports(), airport =>
            {
                foreach (Airline airline in Airlines.GetAllAirlines())
                {
                    foreach (AirportFacility.FacilityType type in Enum.GetValues(typeof(AirportFacility.FacilityType)))
                    {
                        AirportFacility noneFacility = AirportFacilities.GetFacilities(type).Find((delegate(AirportFacility facility) { return(facility.TypeLevel == 0); }));

                        airport.addAirportFacility(airline, noneFacility, GameObject.GetInstance().GameTime);
                    }
                }
                AirportHelpers.CreateAirportWeather(airport);
            });

            foreach (Airline airline in Airlines.GetAllAirlines())
            {
                if (airline.IsHuman)
                {
                    airline.Money = GameObject.GetInstance().StartMoney;
                }
                airline.StartMoney = airline.Money;
                airline.Fees       = new AirlineFees();
                airline.addAirlinePolicy(new AirlinePolicy("Cancellation Minutes", 150));
            }
        }
コード例 #21
0
        public ActionResult DeleteConfirmed(int id)
        {
            Airports airports = db.Airports.Find(id);

            db.Airports.Remove(airports);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #22
0
 public List <Airport> GetFilteredAirports(string partialName) =>
 //todo WHAT IS LINQ
 // TODO: use overload of Contains with StringComparison.InvariantCultureIgnoreCase when available
 Airports
 .Where(a => a.Location.Name.IndexOf(partialName, StringComparison.InvariantCultureIgnoreCase) != -1 ||
        a.Name.IndexOf(partialName, StringComparison.InvariantCultureIgnoreCase) != -1)
 .OrderBy(a => a.Location.Name)
 .ToList();
コード例 #23
0
        public static int UpdateAirport(object airportOBJ)
        {
            Airports airport = new Airports();

            airport.Clone(airportOBJ);
            airport.Update();
            return(airport.Id);
        }
コード例 #24
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            string searchText = txtTextSearch.Text.ToUpper();


            Country country = (Country)cbCountry.SelectedItem;
            Region  region  = (Region)cbRegion.SelectedItem;

            Boolean humansOnly = cbHumanAirports.IsChecked.Value;
            Boolean hubsOnly   = cbHubs.IsChecked.Value;

            List <Airport> airports = Airports.GetAllActiveAirports();

            if (humansOnly)
            {
                airports = airports.FindAll(delegate(Airport airport) { return(GameObject.GetInstance().HumanAirline.Airports.Contains(airport)); });
            }

            if (hubsOnly)
            {
                airports = airports.FindAll(delegate(Airport airport) { return(airport.IsHub); });
            }

            if (country.Uid != "100")
            {
                airports = airports.FindAll(a => ((Country) new CountryCurrentCountryConverter().Convert(a.Profile.Country)) == country || a.Profile.Country == country);                     //airports.FindAll(delegate(Airport airport) { return airport.Profile.Country == country; });
            }
            if (country.Uid == "100" && region.Uid != "100")
            {
                airports = airports.FindAll(delegate(Airport airport) { return(airport.Profile.Country.Region == region); });
            }

            CompareType sizeCompare = (CompareType)(((ComboBoxItem)cbCompareSize.SelectedItem).Tag);

            GeneralHelpers.Size size = (GeneralHelpers.Size)cbSize.SelectedItem;

            switch (sizeCompare)
            {
            case CompareType.Equal_to:
                airports = airports.FindAll(a => a.Profile.Size == size);
                break;

            case CompareType.Larger_than:
                airports = airports.FindAll(a => a.Profile.Size > size);
                break;

            case CompareType.Lower_than:
                airports = airports.FindAll(a => a.Profile.Size < size);
                break;
            }


            airports = airports.FindAll(a => a.Profile.Name.ToUpper().Contains(searchText) || a.Profile.ICAOCode.ToUpper().Contains(searchText) || a.Profile.IATACode.ToUpper().Contains(searchText) || a.Profile.Town.Name.ToUpper().Contains(searchText) || ((Country) new CountryCurrentCountryConverter().Convert(a.Profile.Country)).Name.ToUpper().Contains(searchText));
            // airports = airports.FindAll((delegate(Airport airport) { return airport.Profile.Name.ToUpper().Contains(searchText) || airport.Profile.ICAOCode.ToUpper().Contains(searchText) || airport.Profile.IATACode.ToUpper().Contains(searchText) || airport.Profile.Town.ToUpper().Contains(searchText) || airport.Profile.Country.Name.ToUpper().Contains(searchText); }));

            this.ParentPage.showAirports(airports);
        }
コード例 #25
0
 public void LoadAirConnections()
 {
     AirConnections = connectionsReader.LoadDatabase(CsvPath);
     foreach (var conn in AirConnections)
     {
         Airports.Add(conn.AirportA);
         Airports.Add(conn.AirportB);
     }
 }
コード例 #26
0
 public HttpResponseMessage GetAirport(HttpRequestMessage message, string search)
 {
     Airports[] airport = new Airports[Airports.FindAirport(search).Count];
     for (int i = 0; i < Airports.FindAirport(search).Count; i++)
     {
         airport[i] = Airports.FindAirport(search).ElementAt(i);
     }
     return(message.CreateResponse(HttpStatusCode.OK, airport));
 }
コード例 #27
0
        public void OnAddCity()
        {
            bool check = true;
            //bool logged = false;
            bool ciname   = false;
            bool coname   = false;
            bool descname = false;

            if (String.IsNullOrEmpty(CityName))
            {
                ciname = true;
                check  = false;
                MessageBox.Show("You need to fill City name box to proceed!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            if (!ciname && CityName.Length < 2)
            {
                check = false;
                MessageBox.Show("City name must contains 2 caracters at least!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            if (String.IsNullOrEmpty(CountryName))
            {
                coname = true;
                MessageBox.Show("You need to fill Country name box to proceed!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            if (!coname && CountryName.Length < 2)
            {
                check = false;
                MessageBox.Show("Country name must contains 2 caracters at least!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            if (String.IsNullOrEmpty(DescriptCity))
            {
                descname = true;
                check    = false;
                MessageBox.Show("You need to fill Description box to proceed!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            if (!descname && DescriptCity.Length < 2)
            {
                check = false;
                MessageBox.Show("Description must contains 2 caracters at least!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            if (check)
            {
                City sql = new City();
                sql.InserCity(CityName, CountryName, DescriptCity);
                Airports a = new Airports();
                a.SqlAir();
                Routes r = new Routes();
                r.UpdateNewRoute(CityName);
                MessageBox.Show("Dodali ste novi grad", "OK", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
コード例 #28
0
 public ActionResult Edit([Bind(Include = "id,name,city")] Airports airports)
 {
     if (ModelState.IsValid)
     {
         db.Entry(airports).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(airports));
 }
コード例 #29
0
 public FlightSearchViewModel()
 {
     Departure     = new Airports();
     Destination   = new Airports();
     ReturnFlight  = false;
     DepartureDate = DateTime.MinValue;
     ReturnDate    = DateTime.MinValue;
     Passengers    = 0;
     TicketClass   = new TicketClass();
 }
コード例 #30
0
        private async Task DeleteAirport(Airport airport)
        {
            if (Airports.Any() && Airports.Contains(airport))
            {
                await AirportService.DeleteAirport(airport.Id, new System.Threading.CancellationToken()).ConfigureAwait(false);

                Airports.Remove(airport);
            }
            HasSavedItems = Airports != null && Airports.Any();
        }