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); } }