public ActionResult ProcessSearchFormInput(SearchForm model) { // this method works out what the search type is. // from here we can then work out how we do the search. // for now we are going to pretend it is a package search // this call will prep the search FlightServiceClient flightServiceClient = new FlightServiceClient(); var flightSearchResult = flightServiceClient.StartSearch(new FlightSearch { IsPackage = true, SearchType = "Package" }); // save this into session SessionService sessionService = new SessionService(); sessionService.SetItem(SessionEnum.FlightSearch, flightSearchResult.FlightSearchId.ToString(), flightSearchResult); // this will change depending on the search type return Redirect("search/package-flight-wait/?id=" + flightSearchResult.FlightSearchId); }
public ActionResult ProcessFlightSearch(FlightSearch flightSearch) { if (ModelState.IsValid) { // for now we are going to pretend it is a package search // this call will prep the search FlightServiceClient flightServiceClient = new FlightServiceClient(); var flightSearchResult = flightServiceClient.StartSearch(flightSearch); // save this into session SessionService sessionService = new SessionService(); sessionService.SetItem(SessionEnum.FlightSearch, flightSearchResult.FlightSearchId.ToString(), flightSearchResult); // this will change depending on the search type return(Redirect("search/package-flight-wait/?id=" + flightSearchResult.FlightSearchId)); } else { return(View("flightSearch")); } }
public ActionResult ProcessFlightSearch(FlightSearch flightSearch) { if (ModelState.IsValid) { // for now we are going to pretend it is a package search // this call will prep the search FlightServiceClient flightServiceClient = new FlightServiceClient(); var flightSearchResult = flightServiceClient.StartSearch(flightSearch); // save this into session SessionService sessionService = new SessionService(); sessionService.SetItem(SessionEnum.FlightSearch, flightSearchResult.FlightSearchId.ToString(), flightSearchResult); // this will change depending on the search type return Redirect("search/package-flight-wait/?id=" + flightSearchResult.FlightSearchId); } else { return View("flightSearch"); } }
public ActionResult ProcessSearchFormInput(SearchForm model) { // this method works out what the search type is. // from here we can then work out how we do the search. // for now we are going to pretend it is a package search // this call will prep the search FlightServiceClient flightServiceClient = new FlightServiceClient(); var flightSearchResult = flightServiceClient.StartSearch(new FlightSearch { IsPackage = true, SearchType = "Package" }); // save this into session SessionService sessionService = new SessionService(); sessionService.SetItem(SessionEnum.FlightSearch, flightSearchResult.FlightSearchId.ToString(), flightSearchResult); // this will change depending on the search type return(Redirect("search/package-flight-wait/?id=" + flightSearchResult.FlightSearchId)); }