Example #1
0
        public IDictionary <string, DateTime> Dates()
        {
            var dates = new Dictionary <string, DateTime>
            {
                { "startDate", Stops.Any() ? Stops.Select(s => s.Arrival.Date).Min() : new DateTime() },
                { "endDate", Stops.Any() ? Stops.Select(s => s.Departure.Date).Max() : new DateTime() }
            };

            return(dates);
        }
Example #2
0
        //TODO: Add new fetures: 1. Year of Trip (start) 2. TripStart and End Date 3. Number of days
        public IDictionary <string, int> Statistics()
        {
            var statistics = new Dictionary <string, int>
            {
                { "countriesCount", Countries().Count() },
                { "stopsCount", Stops.Count },
                { "userCount", Users().Count() },
                { "numberOfFlights", Flights.Count },
                { "worldHeritages", WorldHeritages().Count() },
                { "yearOfTrip", Stops.Any() ? Stops.Select(s => s.Arrival.Year).Max() : 0 },
                { "numberOfDays", Stops.Any() ? Convert.ToInt32(System.Math.Floor((Stops.Select(s => s.Departure).Max() - Stops.Select(s => s.Arrival).Min()).TotalDays)) : 0 }
            };

            return(statistics);
        }
Example #3
0
 //Currently all elevators access all floors
 internal bool CanAccessFloor(int floorNumber)
 {
     return(Stops.Any(stop => stop.Floor == floorNumber));
 }