Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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"));
            }
        }
Exemplo n.º 3
0
        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");
            }
        }
Exemplo n.º 4
0
        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));
        }