Esempio n. 1
0
        //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        //Used for Money Movements and Open/Close Terminal/Day Sessions

        public static bool PrintCashDrawerOpenAndMoneyInOut(SYS_ConfigurationPrinters pPrinter, String pTicketTitle, decimal pMovementAmount, decimal pTotalAmountInCashDrawer, string pMovementDescription)
        {
            bool result = false;

            if (pPrinter != null)
            {
                try
                {
                    switch (GetPrinterToken(pPrinter.PrinterType.Token))
                    {
                    //Impressora SINOCAN em ambiente Windows
                    case "THERMAL_PRINTER_WINDOWS":
                    //Impressora SINOCAN em ambiente Linux
                    case "THERMAL_PRINTER_LINUX":
                    //Impressora SINOCAN em ambiente WindowsLinux/Socket
                    case "THERMAL_PRINTER_SOCKET":
                    //Impressora SINOCAN em ambiente WindowsLinux/USB
                    case "THERMAL_PRINTER_USB":
                        ThermalPrinterInternalDocumentCashDrawer thermalPrinterInternalDocumentCashDrawer = new ThermalPrinterInternalDocumentCashDrawer(pPrinter, pTicketTitle, pTotalAmountInCashDrawer, pMovementAmount, pMovementDescription);
                        thermalPrinterInternalDocumentCashDrawer.Print();
                        break;
                    }
                    result = true;
                }
                catch (Exception ex)
                {
                    _log.Warn(ex.Message, ex);
                    throw new Exception(ex.Message);
                }
            }
            return(result);
        }
 public static void Print(sys_configurationprinters pPrinter)
 {
     try
     {
         //Test Print Document
         string  ticketTitle             = "Saida de Caixa";
         decimal totalAmountInCashDrawer = 1280.28m;
         decimal movementAmount          = 28.82m;
         string  movementDescription     = "Pagar Fornecedor";
         ThermalPrinterInternalDocumentCashDrawer thermalPrinterInternalDocumentCashDrawer = new ThermalPrinterInternalDocumentCashDrawer(pPrinter, ticketTitle, totalAmountInCashDrawer, movementAmount, movementDescription);
         thermalPrinterInternalDocumentCashDrawer.Print();
         Console.WriteLine(string.Format("ThermalPrinterInternalDocumentCashDrawer Printed: {0}", ticketTitle));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }