コード例 #1
0
        private void BuyTicket()
        {
            Logger.MethodCalled("DetailsPage.BuyTicket");
            btnContinue.IsActivated    = true;
            btnBack.IsActivated        = true;
            DefaultButtons.Visibility  = Visibility.Visible;
            ContinueButtons.Visibility = Visibility.Collapsed;

            // İptal edilen veya satın alınan biletler hariç satın alma işlemi
            if (Database.TempData.Ticket.PNR.ExpirationDate < DateTime.Now)
            {
                TicketPassengerItem.HideCheckBoxes();
                App.ShowProgress("rezervasyon opsiyon tarihiniz geçmiş", ProgressType.Warning, ProgressTime.Normal);
            }
            else
            {
                foreach (var p in TicketPassengerItem.UncheckedPassengerList)
                {
                    Database.TempData.Ticket.Passengers.Remove(p);
                }

                TicketPassengerItem.HideCheckBoxes();

                if (Database.TempData.Ticket.Type == TicketType.BusJourney)
                {
                    NavigationService.Navigate(new Uri("/Pages/Bus/CreditCardPage.xaml", UriKind.RelativeOrAbsolute));
                }
                else
                {
                    NavigationService.Navigate(new Uri("/Pages/Airplane/CreditCardPage.xaml", UriKind.RelativeOrAbsolute));
                }
            }
        }
コード例 #2
0
 private void BackPressed()
 {
     App.RemoveBackPressedEvent(BackPressed);
     _actionType = -1;
     DefaultButtons.Visibility  = Visibility.Visible;
     ContinueButtons.Visibility = Visibility.Collapsed;
     TicketPassengerItem.HideCheckBoxes();
 }
コード例 #3
0
 private void btnBack_Clicked(object sender, EventArgs e)
 {
     Logger.Clicked("btnBack");
     App.RemoveBackPressedEvent(BackPressed);
     _actionType = -1;
     DefaultButtons.Visibility  = Visibility.Visible;
     ContinueButtons.Visibility = Visibility.Collapsed;
     TicketPassengerItem.HideCheckBoxes();
 }
コード例 #4
0
        private void CancelTicket()
        {
            Logger.MethodCalled("DetailsPage.CancelTicket");
            if (Database.TempData.Ticket.Passengers.Count(x => x.LastAction.Type == ActionType.Buying) == 0) // (Database.TempData.Ticket.ActionType == ActionType.Reservation)
            {
                if (Database.TempData.Ticket.PNR.ExpirationDate < DateTime.Now)
                {
                    App.ShowProgress("rezervasyon opsiyon tarihiniz geçmiş", ProgressType.Warning, ProgressTime.Normal);
                    btnContinue.IsActivated    = true;
                    btnBack.IsActivated        = true;
                    DefaultButtons.Visibility  = Visibility.Visible;
                    ContinueButtons.Visibility = Visibility.Collapsed;
                    TicketPassengerItem.HideCheckBoxes();
                }
                else
                {
                    int totalCount        = Database.TempData.Ticket.Passengers.Count();
                    var checkedPassengers = TicketPassengerItem.CheckedPassengerList;
                    int checkedCount      = checkedPassengers.Count();

                    if (checkedCount != totalCount && Database.TempData.Ticket.Type != TicketType.BusJourney)
                    {
                        App.ShowProgress("biletler hepsi birlikte iptal edilebilir", ProgressType.Error, ProgressTime.Normal);
                    }
                    else if (checkedCount != totalCount && checkedCount > 1)
                    {
                        App.ShowProgress("bileti teker teker iptal edebilirsiniz", ProgressType.Error, ProgressTime.Normal);
                    }
                    else
                    {
                        btnContinue.IsActivated = false;
                        btnBack.IsActivated     = false;

                        foreach (var p in TicketPassengerItem.UncheckedPassengerList)
                        {
                            Database.TempData.Ticket.Passengers.Remove(p);
                        }

                        App.ShowProgress("bilet iptal edilecek, onaylıyor musunuz?", ProgressType.Plain, ProgressTime.Infinite, new List <string>()
                        {
                            "Evet, iptal et", "Hayır"
                        });
                        Header.HeaderConfirmed = (buttonId) =>
                        {
                            App.HideProgress();
                            if (buttonId == 0)
                            {
                                Logger.Clicked("btnConfirm");
                                App.ShowProgress("işlem gerçekleştiriliyor..");
                                ReservationRequests.CancelReservationRequest.OnCompleted = (response) =>
                                {
                                    var actionResult = response.Result;
                                    btnContinue.IsActivated    = true;
                                    btnBack.IsActivated        = true;
                                    DefaultButtons.Visibility  = Visibility.Visible;
                                    ContinueButtons.Visibility = Visibility.Collapsed;
                                    TicketPassengerItem.HideCheckBoxes();

                                    App.HideProgress();
                                    if (response.Status == ResponseStatus.Successful)
                                    {
                                        App.ShowProgress("rezervasyon başarıyla iptal edildi", ProgressType.Success, ProgressTime.Normal);
                                        Functions.UpdateTicket(Database.TempData.Ticket.PNR, NavigationService);
                                    }
                                    else
                                    {
                                        App.ShowProgress(response.Message, ProgressType.Error, ProgressTime.Normal);
                                    }
                                };
                                if (checkedCount != totalCount && checkedCount == 1)
                                {
                                    ReservationRequests.GetCancelReservation(Database.TempData.Ticket, checkedPassengers.First());
                                }
                                else
                                {
                                    ReservationRequests.GetCancelReservation(Database.TempData.Ticket);
                                }
                            }
                            else
                            {
                                Logger.Clicked("btnCancel");
                                btnContinue.IsActivated = true;
                                btnBack.IsActivated     = true;
                            }
                        };
                    }
                }
            }
            else // if (Database.TempData.Ticket.ActionType == ActionType.Buying)
            {
                DefaultButtons.Visibility  = Visibility.Visible;
                ContinueButtons.Visibility = Visibility.Collapsed;
                TicketPassengerItem.HideCheckBoxes();
                Header.HeaderConfirmed = (buttonId) =>
                {
                    if (buttonId == 0)
                    {
                        var callTask = new PhoneCallTask();
                        callTask.DisplayName = "Biletall Çağrı Merkezi";
                        callTask.PhoneNumber = "+908503603258";
                        callTask.Show();
                    }
                };
                App.ShowProgress("satış işlemleri bu sürümde iptal edilememektedir, Biletall Çağrı Merkezi'ni arayabilirsiniz", ProgressType.Plain, ProgressTime.Infinite, new List <string>()
                {
                    "Ara", "Vazgeç"
                });
            }
        }