/// <summary>
        /// Creates rideList and add it to the ride Repository per User
        /// </summary>
        /// <param name="userID">userID if the user</param>
        public void CreateRideRepository(string userID)
        {
            List <RideDetails> rideList = new List <RideDetails>();

            Console.WriteLine("Enter the number of rides");
            NO_OF_RIDES = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i < NO_OF_RIDES; i++)
            {
                Console.WriteLine("Enter the time and distance separated by space for ride " + (i + 1));
                int         time     = Convert.ToInt32(Console.ReadLine());
                double      distance = Convert.ToInt32(Console.ReadLine());
                RideDetails newRide  = new RideDetails(time, distance);
                rideList.Add(newRide);
            }

            RideRepository rideReop = new RideRepository();

            rideReop.AddUser(userID, rideList);
        }
Exemple #2
0
        public void AddToRideList(int time, double distance)
        {
            RideDetails newRide = new RideDetails(time, distance);

            rideList.Add(newRide);
        }