async void ConfirmBookingCancel(object sender, System.EventArgs e) { if (!string.IsNullOrEmpty(selectedBooking.bookingID)) { var cancel = await service.CancelBooking(App.Current.Properties["defaultPid"].ToString(), selectedBooking.bookingID, null); if (cancel != null) { if (cancel.status_code == System.Net.HttpStatusCode.NoContent) { await DisplayAlert("Success", "The booking has been successfully cancelled", "OK"); //TBD needs to be replaced with dropdown alert await LoadData(); Filter(); bookingCancelModal.IsVisible = false; } else { await DisplayAlert("Error", cancel.message, "OK"); } } else { await DisplayAlert("Error", Config.CommonErrorMsg, "OK"); } } }
async void ConfirmBookingCancel(object sender, System.EventArgs e) { var service = new RestService(); CancelBookingRequest request = new CancelBookingRequest() { refundMethod = paymentMethodList[paymentSegment.SelectedSegment], remarks = remarksText.Text, }; if (!string.IsNullOrEmpty(checkNumberText.Text)) { request.chequeNo = checkNumberText.Text; } if (!string.IsNullOrEmpty(bankText.Text)) { bank = bankText.Text; } var result = await service.CancelBooking(App.Current.Properties["defaultPid"].ToString(), bookingId, request); if (result != null) { if (result.status_code == System.Net.HttpStatusCode.NoContent) { await DisplayAlert("Success", "The booking has been cancelled successfully!", "OK"); bookingCancelModal.IsVisible = false; await Navigation.PopAsync(true); } else { await DisplayAlert("Error", result.message, "OK"); } } else { await DisplayAlert("Error", Config.CommonErrorMsg, "OK"); } }