public ActionResult Trips(string inputPrice, string inputDepartureDate, string inputReturnDate, string inputHeight) { connection = UtilityMethods.Environment.GetConnectionString(); connectionString = connection[0]; ViewBag.ServerMessage = connection[1]; TripSqlDal tripSqlDal = new TripSqlDal(connectionString); List <Trip> trips = tripSqlDal.TripsFromInput(inputPrice, inputDepartureDate, inputReturnDate, inputHeight); if (trips.Count == 0) { Trip trip = new Trip(inputPrice, inputDepartureDate, inputReturnDate, inputHeight); trips.Add(trip); } ViewBag.Latitude = trips[0].FixLatLong(trips[0].LocationName, trips[0].Latitude); ViewBag.Longitude = trips[0].Longitude; return(View("Trips", trips)); }
//private string connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=Scraper;Integrated Security=True"; public ActionResult Index() { connection = UtilityMethods.Environment.GetConnectionString(); connectionString = connection[0]; ViewBag.ServerMessage = connection[1]; TripSqlDal tripSqlDal = new TripSqlDal(connectionString); List <Trip> trips = tripSqlDal.TripsFromInput("500", "", "", "5"); if (trips.Count == 0) { if (trips.Count == 0) { Trip trip = new Trip("500", "", "", "5"); trips.Add(trip); } } ViewBag.Latitude = trips[0].FixLatLong(trips[0].LocationName, trips[0].Latitude); ViewBag.Longitude = trips[0].Longitude; return(View("Index", trips)); }