public ActionResult CarpoolHistory()
 {
     CarpoolService carpoolService = new CarpoolService();
     List<Carpool> carpools = carpoolService.FindMyCarpools();
     
     return View(carpools);
 }
 public ActionResult FindCarpoolsByDate(int movementId)
 {
     CarpoolService carpoolService = new CarpoolService();
     var movement = carpoolService.FindMovementById(movementId);
     List<Carpool> carpools;
     if (movement != null) {
         carpools = carpoolService.FindCarpoolsByDateTime(movement.MovementDateTime);
     } else {
         carpools = new List<Carpool>();
     }
     ViewData["newMovement"] = movement;
     return View("CarpoolList", carpools);       
 }
         public void TestGetCarpoolsByDate()
         {
             DateTime arrival;
             List<Carpool> carpools;

             arrival = DateTime.Now;

             carpoolservice = new CarpoolService();

             carpools = carpoolservice.FindCarpoolsByDateTime(arrival);

             foreach (Carpool carpool in carpools)
             {
                 Console.WriteLine(carpool.CarpoolId + ";" + carpool.Status + ";" + carpool.MaxSeats);
             }
         }
 public ActionResult AddMovementToCarpool(Carpool selectedCarpool, Movement newMovement)
 {
     CarpoolService carpoolService = new CarpoolService();
     Carpool newCarpool = carpoolService.AddMovementToCarpool(selectedCarpool, newMovement);
     return View(newCarpool);
 }
 public ActionResult Details(int id)
 {
     CarpoolService carpoolService = new CarpoolService();
     Carpool carpool = carpoolService.FindCarpoolById(id);
     return View(carpool);
 }