Exemplo n.º 1
0
        async void FlightListItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            FlightsModel selectedModel = (FlightsModel)e.SelectedItem;

            var userRes = await DisplayAlert("Arrival Flight", $"Do you want to change your arrival flight as Flight No. {selectedModel.ArrFlight}", "Yes", "No");

            if (userRes)
            {
                ArrFlightLabel.TextColor = Color.Black;
                ArrFlightLabel.Text      = selectedModel.ArrFlight;

                var arrTime = GeneratePayloadDate(selectedModel.AirpArrTime);

                Constants._arrFlight     = selectedModel.ArrFlight;
                Constants._arrFlightTIme = arrTime;

                PostServiceManager postServiceManager = new PostServiceManager();
                FlightPayload      payload            = new FlightPayload(
                    Settings.HotelCode,
                    Constants._reservation_id,
                    "500",
                    Settings.HotelCode,
                    Constants._reservation_id,
                    Constants._arrFlight,     // arr flight
                    Constants._arrFlightTIme, //arr time
                    Constants._depFlight,     //dep flight
                    Constants._depFlightTIme, //dep time
                    "0000000000",
                    "",
                    "",
                    ""

                    );

                var serviceRes = await postServiceManager.SetFlightDetails(payload);

                if (serviceRes == "Success")
                {
                    await DisplayAlert("Success!", "Flight is set successfully", "OK");
                }
                else
                {
                    await DisplayAlert("Error!", "Flight setting is failed", "OK");
                }


                Debug.WriteLine(selectedModel.ArrFlight);

                await Navigation.PopAsync(true);
            }
        }
Exemplo n.º 2
0
        public async Task <String> SetFlightDetails(FlightPayload flightPayload)
        {
            string url    = "/sap/opu/odata/sap/ZTMS_MODIFY_RESERVATION_SRV/reserListSet";
            String result = await this.GetODataService(url, JsonConvert.SerializeObject(flightPayload));

            //If result is success
            if (result == "success")
            {
                return("Success");
            }

            else
            {
                return("Sorry. Unable to set flight!");
            }
        }