示例#1
0
        private async void cancelPassenger()
        {
            try
            {
                bool isDeleted = await Application.Current.MainPage.DisplayAlert("Dikkat", "Yolcuyu iptal etmek istediğinize emin misiniz?", "OK", "Vazgeç");

                if (isDeleted)
                {
                    Passenger.UserId = App.User.Id;
                    int updatedId = await _passengerService.DeleteAsync(Passenger.Id);

                    if (updatedId > 0)
                    {
                        MessageNotificationHelper.ShowMessageSuccess("Yolcu iptal etme başariyla gerçekleşti.");
                        await NavigationHelper.PopAsyncSingle();
                    }
                    else
                    {
                        MessageNotificationHelper.ShowMessageFail("Yolcu iptal etmede hata oluştu.");
                    }
                }
            }
            catch (MobileException exception)
            {
                MessageNotificationHelper.ShowMessageFail(exception.Message);
            }
            catch (Exception exception)
            {
                MessageNotificationHelper.ShowMessageError(exception.GetBaseException().Message);
            }
        }