/// <summary> /// Clear the feedback data and reloanch the main page the button pressed. /// </summary> private async void FinishButtonPressed() { bool isCompleted = await GetDeviceInformation(); if (isCompleted) { FeedbackCart.ClearSavedData(); await Navigation.PopToRootAsync(); //Thread.CurrentThread.Abort(); } else { FeedbackCart.ClearSavedData(); await Navigation.PopToRootAsync(); } }
/// <summary> /// Entries the unfocused. /// </summary> /// <param name="roomNoEntry">Room no entry.</param> private async void EntryUnfocused(Entry roomNoEntry) { //Reset Data FeedbackSerializer.ResetRatingNVCs(); FeedbackCart.ClearSavedData(); FeedbackCart._hotelIdentifier = Settings.HotelIdentifier; RemoveFormLayoutChildren(); GenerateIndicator(); _indicator.IsVisible = true; _indicator.IsRunning = true; string date = DateTime.Now.ToString("yyyy-MM-dd"); Dictionary <string, ReservationDetailsModel> ReservationDetailsDictionary = await ReservationDetailsDeserializer.DeserializeReservationDetails(Settings.HotelCode, roomNoEntry.Text, date).ConfigureAwait(true); if (ReservationDetailsDictionary != null) { ReservationNumber = ReservationDetailsDictionary["1"].BookingId; MobileNumber = ReservationDetailsDictionary["1"].Telephone; EmailAddress = ReservationDetailsDictionary["1"].Email; FeedbackCart._resNum = ReservationDetailsDictionary["1"].BookingId; FeedbackCart._country = ReservationDetailsDictionary["1"].Country; FeedbackCart._arrDate = ReservationDetailsDictionary["1"].ArrivalDate; FeedbackCart._depDate = ReservationDetailsDictionary["1"].DepartureDate; FeedbackCart._guestPhone = ReservationDetailsDictionary["1"].Mobile; FeedbackCart._guestEmail = ReservationDetailsDictionary["1"].Email; RemoveFormLayoutChildren(); GenerateGuestNameLabel(); for (int i = 1; i <= ReservationDetailsDictionary.Count; i++) { GenerateGuestNameLabels(ReservationDetailsDictionary[i.ToString()].Name, roomNoEntry.Text, ReservationDetailsDictionary[i.ToString()].GuestId, i, ReservationNumber); } if (string.IsNullOrEmpty(ReservationDetailsDictionary["1"].BookingId)) { await Application.Current.MainPage.DisplayAlert("No Reservations!", "Please check your room number.", "OK"); roomNoEntry.Focus(); roomNoEntry.Text = ""; ReservationNumber = ""; MobileNumber = ""; EmailAddress = ""; } Console.WriteLine(ReservationNumber); _indicator.IsVisible = false; _indicator.IsRunning = false; _formLayout.Children.Remove(_indicator); } else { roomNoEntry.Focus(); _indicator.IsVisible = false; _indicator.IsRunning = false; _formLayout.Children.Remove(_indicator); } }