예제 #1
0
        private void btnTestQrPrinter_Click(object sender, RoutedEventArgs e)
        {
            TVMUtility.PlayClick();
            PRINTER_STATE QRStatus = QRPrinter.Instance.CheckQrPrinterStatus();

            if (QRStatus == PRINTER_STATE.OK)
            {
                if (StockOperations.qrSlip > 0)
                {
                    long trxId = Convert.ToInt64(TransactionInfo.SelTrxId((long)TransactionType.TT_REMOVE_QR));
                    StockOperations.InsStock(trxId, (int)StockType.QRSlip, (int)DeviceType.QRPrinter, (int)UpdateType.Decrease, 1);

                    QRPrinter.Instance.PrintQR("TestTestTestTestTestTestTestTestTest", "Test", "Test", "Test", "Test", 0, 0, "Test");
                    //CustomKPM150HPrinter.Instance.PrintTestQRTicket(qr);
                    MessageBoxOperations.ShowMessage("QR Printer Test", "Test completed successfully.", MessageBoxButtonSet.OK);
                }
                else
                {
                    MessageBoxOperations.ShowMessage("ERROR", "No paper in Qr printer." + QRStatus, MessageBoxButtonSet.OK);
                }
            }
            else
            {
                MessageBoxOperations.ShowMessage("ERROR", "Qr Printer Error." + QRStatus, MessageBoxButtonSet.OK);
            }
        }
예제 #2
0
        private void btnTestReceiptPrinter_Click(object sender, RoutedEventArgs e)
        {
            TVMUtility.PlayClick();
            PRINTER_STATE ReceiptPrinter = CustomTL60Printer.Instance.getStatusWithUsb();

            if (ReceiptPrinter == PRINTER_STATE.OK)
            {
                CustomTL60Printer.Instance.TestReceiptPrinter();
                MessageBoxOperations.ShowMessage("Receipt Printer Test", "Test completed successfully.", MessageBoxButtonSet.OK);
            }
            else
            {
                MessageBoxOperations.ShowMessage("ERROR", "Receipt Printer Error." + ReceiptPrinter, MessageBoxButtonSet.OK);
            }
        }
예제 #3
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;
                    }
                }
            }
        }
예제 #4
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());
            }
        }
예제 #5
0
        private void AsyncIntHopperFunc()
        {
            try
            {
                Dispatcher.Invoke(DispatcherPriority.Background, new Action(async() =>
                {
                    BNRManager.Instance.GetCassetteStatus();

                    await Task.Delay(1000);

                    CoinHopper1();

                    await Task.Delay(1000);

                    CoinHopper2();

                    await Task.Delay(1000);

                    CoinHopper3();
                    await Task.Delay(1000);

                    Dispencer();
                    await Task.Delay(1000);

                    UpdDevStat();
                    await Task.Delay(8000);

                    PRINTER_STATE QRStatus = QRPrinter.Instance.CheckQrPrinterStatus();//CustomKPM150HPrinter.Instance.getStatusWithUsb();
                    if (QRStatus == PRINTER_STATE.OK)
                    {
                        outOfServiceLbl.Content         = "QRPrinter Status :";
                        outOfServiceGreenLbl.Visibility = System.Windows.Visibility.Visible;
                        outOfServiceRedLbl.Visibility   = System.Windows.Visibility.Collapsed;
                        outOfServiceGreenLbl.Content    = "OK";
                    }
                    else
                    {
                        outOfServiceLbl.Content         = "QRPrinter Status :";
                        outOfServiceGreenLbl.Visibility = System.Windows.Visibility.Collapsed;
                        outOfServiceRedLbl.Visibility   = System.Windows.Visibility.Visible;
                        outOfServiceGreenLbl.Content    = "Not OK";
                    }
                    await Task.Delay(1000);
                    PRINTER_STATE ReceiptPrinter = CustomTL60Printer.Instance.getStatusWithUsb();
                    if (ReceiptPrinter == PRINTER_STATE.OK)
                    {
                        outOfServiceLbl.Content         = "Receipt Printer Status :";
                        outOfServiceGreenLbl.Visibility = System.Windows.Visibility.Visible;
                        outOfServiceRedLbl.Visibility   = System.Windows.Visibility.Collapsed;
                        outOfServiceGreenLbl.Content    = "OK";
                    }
                    else
                    {
                        outOfServiceLbl.Content         = "Receipt Printer Status :";
                        outOfServiceGreenLbl.Visibility = System.Windows.Visibility.Collapsed;
                        outOfServiceRedLbl.Visibility   = System.Windows.Visibility.Visible;
                        outOfServiceGreenLbl.Content    = "Not OK";
                    }
                    await Task.Delay(1000);
                    KMY200DoorAlarm.Instance.SetAlarm();
                    outOfServiceLbl.Content         = "Alarm Activated :";
                    outOfServiceGreenLbl.Visibility = System.Windows.Visibility.Visible;
                    outOfServiceRedLbl.Visibility   = System.Windows.Visibility.Collapsed;
                    outOfServiceGreenLbl.Content    = "OK";
                    await Task.Delay(2000);
                    NavigationService.Navigate(new Pages.MainPage());
                }));
            }
            catch (Exception ex)
            {
                log.Error("Error OutOfServicePage -> asyncFunc() :" + ex.ToString());
            }
        }