public Models.ui.BookingUI ListAvailableCars(Models.ui.LocationsUI requestedTimePlace)
        {
            // Request comes in with 3 paramaters:
             DateTime fromDate = requestedTimePlace.fromDate;
             DateTime toDate = requestedTimePlace.toDate;
             string location = requestedTimePlace.location;

             // Load available cars
             var cars = db.listAvailableCars(location, fromDate, toDate);

             // Build result

             BookingUI carResults = new BookingUI();
             carResults.amount = cars.Count();

             foreach (var car in cars)
             {
                  CarObj c = new CarObj();
                  c.Car = car;
                  TimeSpan span = toDate - fromDate;
                  int numberOfDays = span.Days;
                  c.TotalCost = car.cost_per_day * numberOfDays;
                  carResults.Cars.Add(c);
             }
             carResults.toDate = toDate;
             carResults.fromDate = fromDate;
             carResults.id = 1;
             carResults.Location = location;
             return carResults;
        }
 public ActionResult Index(LocationsUI requestedTimePlace)
 {
     BookingUI carList = new BookingUI();
      carList = logic.ListAvailableCars(requestedTimePlace);
      return View(carList);
 }