public HttpResponse All() { if (!this.IsUserLoggedIn()) { return(this.Redirect("/Users/Login")); } var model = new List <TripsViewModel>(); var trips = service.GetAll(); foreach (var trip in trips) { model.Add(new TripsViewModel { DepartureTime = trip.DepartureTime.ToString(), EndPoint = trip.EndPoint, Id = trip.Id, Seats = trip.Seats, StartPoint = trip.StartPoint }); } return(this.View(model.ToArray())); }
public HttpResponse All() { if (!this.IsUserLoggedIn()) { return(this.Redirect("/Users/Login")); } var viewModel = tripsService.GetAll(); return(this.View(viewModel, "All")); }
public HttpResponse All() { if (!this.IsUserLoggedIn()) { return(this.Redirect("/Users/Login")); } var allTrips = tripsService.GetAll(); return(this.View(allTrips)); }
public HttpResponse All() { if (this.IsUserLoggedIn()) { var allTrips = tripService.GetAll(); return(this.View(allTrips)); } return(this.View($"/")); }