Exemple #1
0
 public void AddAll()
 {
     foreach (Flight flight in flights)
     {
         VisitCounter visit = SearchVist(flight);
         visit.GetFlights().Add(flight);
     }
 }
Exemple #2
0
 public void Origin(String origin)
 {
     foreach (Flight flight in flights)
     {
         if (flight.GetOrigin().GetName().Equals(origin))
         {
             VisitCounter visit = SearchVist(flight);
             visit.GetFlights().Add(flight);
         }
     }
 }
Exemple #3
0
 public void Destination(String destination)
 {
     foreach (Flight flight in flights)
     {
         if (flight.GetDestination().GetName().Equals(destination))
         {
             VisitCounter visit = SearchVist(flight);
             visit.GetFlights().Add(flight);
         }
     }
 }
Exemple #4
0
 public void DelayedFlights(Boolean delay)
 {
     foreach (Flight flight in flights)
     {
         if (flight.GetDelay() > 0) ///buscar
         {
             VisitCounter visit = SearchVist(flight);
             visit.GetFlights().Add(flight);
         }
     }
 }
Exemple #5
0
 public void Date(DateTime date)
 {
     foreach (Flight flight in flights)
     {
         if (flight.GetDate().Equals(date))
         {
             VisitCounter visit = SearchVist(flight);
             visit.GetFlights().Add(flight);
         }
     }
 }
Exemple #6
0
        public VisitCounter SearchVist(Flight flight)
        {
            VisitCounter visit = null;

            foreach (VisitCounter counter in visits)
            {
                if (counter.GetFlights()[0].SameRelationWithCity(flight))
                {
                    visit = counter;
                }
            }
            if (visit == null)
            {
                visit = new VisitCounter();
                visits.Add(visit);
            }
            return(visit);
        }