public void Run()
        {
            // read movies from file
            foreach (Movie movie in this.movieRepository.GetAll())
            {
                this._out.WriteLine(movie.Key + ": " + movie.Name);
            }

            _out.Write("Enter customer name: ");
            string customerName = _in.ReadLine();

            _out.WriteLine("Choose movie by number followed by rental days, just ENTER for bill:");

            List<Rental> rentals = this.InputRentals();
            var rentalRecord = new RentalRecord(customerName, rentals);
            string result = "Rental Record for " + rentalRecord.CustomerName + "\n";

            foreach (var rental in rentalRecord.Rentals)
            {
                // show figures for this rental
                result += "\t" + rental.GetMovieName() + "\t" + rental.GetAmount().ToString("0.0", CultureInfo.InvariantCulture) + "\n";
            }

            // add footer lines
            result += "You owed " + rentalRecord.GetTotalAmount().ToString("0.0", CultureInfo.InvariantCulture) + "\n";
            result += "You earned " + rentalRecord.GetFrequentRenterPoints() + " frequent renter points\n";

            _out.Write(result);
        }
 public void PrintRentalRecord(RentalRecord rentalRecord)
 {
     @out.WriteLine("Rental Record for " + rentalRecord.CustomerName);
     foreach (var rental in rentalRecord.Rentals)
     {
         // show figures for this rental
         @out.WriteLine(
             "\t" + rental.GetMovieName() + "\t" + rental.GetAmount().ToString("0.0", CultureInfo.InvariantCulture));
     }
 }
        public void Run()
        {
            console.PrintMovies(movieRepository.GetAll());

            string customerName = console.InputCustomerName();

            List<Rental> rentals = console.InputRentals();
            var rentalRecord = new RentalRecord(customerName, rentals);

            console.PrintRentalRecord(rentalRecord);
            console.PrintFooter(rentalRecord);
        }
 public void PrintFooter(RentalRecord rentalRecord)
 {
     // add footer lines
     @out.WriteLine("You owed " + rentalRecord.GetTotalAmount().ToString("0.0", CultureInfo.InvariantCulture));
     @out.WriteLine("You earned " + rentalRecord.GetFrequentRenterPoints() + " frequent renter points");
 }