private void GetAirlines()
 {
     Service.BeginGetAirlines(SelectedAirport.Id, CreateAsyncCallback(ar => Service.EndGetAirlines(ar),
         result =>
         {
             var selectedAirline = SelectedAirline; 
             Airlines = new ObservableCollection<Airline>(result);
             SelectedAirline = selectedAirline != null
                            ? Airlines.FirstOrDefault(a => a.Id == selectedAirline.Id)
                            : null;
         }),
         null);
 }
Exemple #2
0
     private void FixupAirline(Airline previousValue, bool skipKeys = false)
     {
         if (IsDeserializing)
         {
             return;
         }
 
         if (Airline != null)
         {
             AirlineId = Airline.Id;
         }
 
         else if (!skipKeys)
         {
             AirlineId = null;
         }
 
         if (ChangeTracker.ChangeTrackingEnabled)
         {
             if (ChangeTracker.OriginalValues.ContainsKey("Airline")
                 && (ChangeTracker.OriginalValues["Airline"] == Airline))
             {
                 ChangeTracker.OriginalValues.Remove("Airline");
             }
             else
             {
                 ChangeTracker.RecordOriginalValue("Airline", previousValue);
             }
             if (Airline != null && !Airline.ChangeTracker.ChangeTrackingEnabled)
             {
                 Airline.StartTracking();
             }
         }
     }
Exemple #3
0
     public bool Equals(Airline other)
     {
         if (ReferenceEquals(null, other)) return false;
         if (ReferenceEquals(this, other)) return true;
 		if (other.Id == 0 && Id == 0)
 			return false;
 		else
 			return other.Id == Id;
     }