Ejemplo n.º 1
0
 private void Page_Unloaded(object sender, RoutedEventArgs e)
 {
     returnCashImageGif.Stop();
     returnCashImageGif.Close();
     returnCashImageGif.Source = null;
     ElectronicJournal.OrderFinalised();
 }
Ejemplo n.º 2
0
        private void btnNumber_Click(object sender, RoutedEventArgs e)
        {
            TVMUtility.PlayClick();
            Button btn   = (Button)sender;
            int    count = Int32.Parse(btn.Content.ToString());

            StockOperations.SelStockStatus();

            Ticket.peopleCount = 1;
            Ticket.ticketCount = 1;

            if (Ticket.journeyType == JourneyType.Group_Ticket)
            {
                int minGroupCount = Convert.ToInt32(Parameters.TVMDynamic.GetParameter("sys_MinGroupCount"));
                int maxGroupCount = Convert.ToInt32(Parameters.TVMDynamic.GetParameter("sys_MaxGroupCount"));
                if (count >= minGroupCount && count <= maxGroupCount)
                {
                    if (count <= StockOperations.qrSlip)
                    {
                        Ticket.peopleCount = count;
                        ElectronicJournal.NumberOfTicket(count.ToString());
                        NavigationService.Navigate(new Pages.OrderPreviewPage());
                        //    PageControl.ShowPage(Pages.paymentTypePage);
                    }
                    else if (StockOperations.qrSlip == 0)
                    {
                        //MessageBoxOperations.ShowMessage("Paper Count..", "Not enough paper, You can buy " + StockOperations.qrSlip.ToString()+ " tickets.", MessageBoxButtonSet.OK);
                        MessageBoxOperations.ShowMessage(MultiLanguage.GetText("paperCount"), MultiLanguage.GetText("noQrSlip"), MessageBoxButtonSet.OK);
                    }
                    else
                    {
                        MessageBoxOperations.ShowMessage(MultiLanguage.GetText("paperCount"), MultiLanguage.GetText("notEnoughPaper") + ", " + MultiLanguage.GetText("youCanBuy") + " " + StockOperations.qrSlip.ToString() + MultiLanguage.GetText("tickets"), MessageBoxButtonSet.OK);
                    }
                }
            }
            else
            {
                int maxTicket = Convert.ToInt32(Parameters.TVMDynamic.GetParameter("sys_MaxTicket"));
                if (count >= 1 && count <= maxTicket)
                {
                    if (count <= StockOperations.qrSlip)
                    {
                        Ticket.ticketCount = count;
                        ElectronicJournal.NumberOfTicket(count.ToString());
                        NavigationService.Navigate(new Pages.OrderPreviewPage());
                        //PageControl.ShowPage(Pages.paymentTypePage);
                    }
                    else if (StockOperations.qrSlip == 0)
                    {
                        //MessageBoxOperations.ShowMessage("Paper Count..", "Not enough paper, You can buy " + StockOperations.qrSlip.ToString()+ " tickets.", MessageBoxButtonSet.OK);
                        MessageBoxOperations.ShowMessage(MultiLanguage.GetText("paperCount"), MultiLanguage.GetText("noQrSlip"), MessageBoxButtonSet.OK);
                    }
                    else
                    {
                        MessageBoxOperations.ShowMessage(MultiLanguage.GetText("paperCount"), MultiLanguage.GetText("notEnoughPaper") + ", " + MultiLanguage.GetText("youCanBuy") + " " + StockOperations.qrSlip.ToString() + MultiLanguage.GetText("tickets"), MessageBoxButtonSet.OK);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 private void gridGrp_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     TVMUtility.PlayClick();
     Ticket.journeyType = JourneyType.Group_Ticket;
     ElectronicJournal.ItemSelected("GROUP");
     GoToNextStep();
     NavigationService.Navigate(new Pages.StationPage());
 }
Ejemplo n.º 4
0
        private void btnStation_Click(object sender, RoutedEventArgs e)
        {
            TVMUtility.PlayClick();
            int selectedStationId = 0;

            selectedStationId = Convert.ToInt32(((Button)sender).Tag.ToString());//Stations.GetStation().id;
            //if (Stations.stationList.ContainsKey(selectedStationId))
            //    SetStation(selectedStationId);
            Ticket.endStation   = Stations.GetStation(selectedStationId);
            Ticket.startStation = Stations.currentStation;
            ElectronicJournal.DestinationSelected(Ticket.endStation.name.ToString());
            Constants.IsMapPageActive = false;
            NavigationService.Navigate(new Pages.TicketCountPage());
            //PageControl.ShowPage(Pages.journeyPage);
        }
Ejemplo n.º 5
0
 private void SetEndStation(int selectedStationId)
 {
     if (selectedStationId != Stations.currentStation.id)
     {
         Ticket.endStation   = Stations.GetStation(selectedStationId);
         Ticket.startStation = Stations.currentStation;
         ElectronicJournal.DestinationSelected(Ticket.endStation.name.ToString());
         Constants.IsMapPageActive = true;
         NavigationService.Navigate(new Pages.TicketCountPage());
         //PageControl.ShowPage(Pages.journeyPage);
     }
     else
     {
         lblWarning.Visibility = Visibility.Visible;
         lblWarning.Content    = "This station can not be selected!";
     }
 }
Ejemplo n.º 6
0
        private void btnCash_Click(object sender, RoutedEventArgs e)
        {
            TVMUtility.PlayClick();
            PRINTER_STATE ReceiptPrinter = CustomTL60Printer.Instance.getStatusWithUsb();

            if (ReceiptPrinter == PRINTER_STATE.OK)
            {
                Constants.NoReceiptMode = false;
            }
            else
            {
                Constants.NoReceiptMode = true;
            }
            PRINTER_STATE QRStatus = QRPrinter.Instance.CheckQrPrinterStatus();//CustomKPM150HPrinter.Instance.getStatusWithUsb();

            if (QRStatus != PRINTER_STATE.OK)
            {
                Custom.MessageBoxResult messageBoxResult = MessageBoxOperations.ShowMessage("QR Printer", "QR Printer Error.", MessageBoxButtonSet.OK);
                if (messageBoxResult == Custom.MessageBoxResult.OK)
                {
                    ElectronicJournal.OrderCancelled();
                    NavigationService.Navigate(new Pages.MainPage());
                    return;
                }
            }
            else
            {
                if (StockOperations.qrSlip >= Ticket.ticketCount)
                {
                    ElectronicJournal.AmountPayable(Ticket.totalPrice.ToString());
                    ElectronicJournal.MediaSelected("CASH");
                    NavigationService.Navigate(new Pages.PayByCashPage());
                }
                else
                {
                    Custom.MessageBoxResult messageBoxResult = MessageBoxOperations.ShowMessage("QR Printer", "QR Printer Low Paper.", MessageBoxButtonSet.OK);
                    if (messageBoxResult == Custom.MessageBoxResult.OK)
                    {
                        ElectronicJournal.OrderCancelled();
                        NavigationService.Navigate(new Pages.MainPage());
                        return;
                    }
                }
            }
        }
Ejemplo n.º 7
0
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     TVMUtility.PlayClick();
     grdNoChangeMode.Visibility = Visibility.Hidden;
     if (nochageMode && noReceiptprinter)
     {
         grdNoReceiptPrinterMode.Visibility = Visibility.Visible;
         i++;
         if (i == 2)
         {
             i = 0;
             ElectronicJournal.OrderStarted();
             NavigationService.Navigate(new Pages.JourneyTypePage());
         }
     }
     else
     {
         ElectronicJournal.OrderStarted();
         NavigationService.Navigate(new Pages.JourneyTypePage());
     }
 }
Ejemplo n.º 8
0
        async void PrintReceipt()
        {
            try
            {
                //foreach (var selectedTickets in Ticket.listTickets)
                //{
                //    var qr = Utility.PrepareQRImage(selectedTickets.TicketGUID);
                //    CustomTL60Printer.Instance.PrintQRTicket(selectedTickets, qr);
                //}
                if (CustomTL60Printer.Instance.getStatusWithUsb() == Enums.PRINTER_STATE.OK)
                {
                    ElectronicJournal.ReceiptPrintStarted();
                    CustomTL60Printer.Instance.TicketReceipt(RecAmt, ChaAmt);
                    ElectronicJournal.ReceiptPrintOver();
                }
                await Task.Delay(1000);

                switch (Ticket.journeyType)
                {
                case JourneyType.Group_Ticket:
                case JourneyType.SJT:
                case JourneyType.RJT:
                    PrintQR();
                    break;

                case JourneyType.Day_Pass:
                case JourneyType.Weekend_Pass:
                    RPT();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                log.Error("Error PrintReciptPage -> PrintReceipt() : " + ex.ToString());
            }
            //NavigationService.Navigate(new Pages.MainPage());
        }
Ejemplo n.º 9
0
 private void btnFinish_Click(object sender, RoutedEventArgs e)
 {
     TVMUtility.PlayClick();
     ElectronicJournal.OrderCancelled();
     NavigationService.Navigate(new Pages.MainPage());
 }
Ejemplo n.º 10
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                initialTimer();
                LedOperations.GreenText("PAY USING CASH");
                lblInfo.Content   = MultiLanguage.GetText("startPaymentProc");
                btnBack.Content   = MultiLanguage.GetText("back");
                btnFinish.Content = MultiLanguage.GetText("cancel");
                btnCash.Content   = MultiLanguage.GetText("cash");
                PRINTER_STATE ReceiptPrinter = CustomTL60Printer.Instance.getStatusWithUsb();
                if (ReceiptPrinter == PRINTER_STATE.OK)
                {
                    Constants.NoReceiptMode = false;
                }
                else
                {
                    Constants.NoReceiptMode = true;
                }

                var result = Parameters.TVMDynamic.GetAfcConnStatus();
                if (!result)
                {
                    ElectronicJournal.OrderCancelled();
                    Custom.MessageBoxResult messageBoxResult = MessageBoxOperations.ShowMessage("Communication", "LAN communication Error.", MessageBoxButtonSet.OK);
                    if (messageBoxResult == Custom.MessageBoxResult.OK)
                    {
                        NavigationService.Navigate(new Pages.MainPage());
                    }
                    return;
                }

                PRINTER_STATE QRStatus = QRPrinter.Instance.CheckQrPrinterStatus();//CustomKPM150HPrinter.Instance.getStatusWithUsb();
                if (QRStatus != PRINTER_STATE.OK)
                {
                    ElectronicJournal.OrderCancelled();
                    Custom.MessageBoxResult messageBoxResult = MessageBoxOperations.ShowMessage("QR Printer", "QR Printer Error.", MessageBoxButtonSet.OK);
                    if (messageBoxResult == Custom.MessageBoxResult.OK)
                    {
                        NavigationService.Navigate(new Pages.MainPage());
                    }
                    return;
                }
                else
                {
                    if (StockOperations.qrSlip > Ticket.ticketCount || StockOperations.qrSlip > Ticket.peopleCount)
                    {
                        Dispatcher.BeginInvoke(new Action(() =>
                        {
                            try
                            {
                                if (Ticket.PrepareTicket())
                                {
                                    DefaultTicketInfo();
                                    ArrangTicketInfo();
                                    btnCash.Visibility = Visibility.Visible;
                                    Message();
                                }
                            }
                            catch (Exception ex)
                            {
                            }
                        }), DispatcherPriority.Background);
                    }
                    else
                    {
                        ElectronicJournal.OrderCancelled();
                        Custom.MessageBoxResult messageBoxResult = MessageBoxOperations.ShowMessage("QR Printer", "QR Printer Paper Less.", MessageBoxButtonSet.OK);
                        if (messageBoxResult == Custom.MessageBoxResult.OK)
                        {
                            NavigationService.Navigate(new Pages.MainPage());
                        }
                        return;
                    }
                }
                BNRManager.Instance.PollingAction();
            }
            catch (Exception ex)
            {
                log.Error("Error OrderPreviewPage -> Page_Loaded() : " + ex.ToString());
            }
        }