Esempio n. 1
0
 protected virtual Result OnPrintReceiptWithQRCode(ArrayList content, string mimgcontent)
 {
     ReceiptPrinter.SetPrintPosition(0);
     ReceiptPrinter.Status retstr = ReceiptPrinter.PrintString(content);
     //ReceiptPrinter.Status retstr = ReceiptPrinter.Status.SUCC;
     ReceiptPrinter.Status retimg = ReceiptPrinter.PrintImage(mimgcontent);
     ReceiptPrinter.Status ret    = (retimg == ReceiptPrinter.Status.SUCC) ? retstr : retimg;
     if (ret == ReceiptPrinter.Status.SUCC || ret == ReceiptPrinter.Status.PAPER_FEW)
     {
         ReceiptPrinter.FeedLine(8);
         ReceiptPrinter.CutPage();
         if (ret == ReceiptPrinter.Status.SUCC)
         {
             return(Result.Success);
         }
         else
         {
             return(Result.PaperFew);
         }
     }
     else if (ret == ReceiptPrinter.Status.OUT_OF_PAPER)
     {
         return(Result.OutOfPaper);
     }
     else
     {
         return(Result.Fail);
     }
 }
Esempio n. 2
0
 protected virtual Result OnPrintReceipt(ArrayList content)
 {
     ReceiptPrinter.SetPrintPosition(0);
     ReceiptPrinter.Status ret = ReceiptPrinter.PrintString(content);
     if (ret == ReceiptPrinter.Status.SUCC || ret == ReceiptPrinter.Status.PAPER_FEW)
     {
         ReceiptPrinter.FeedLine(8);
         ReceiptPrinter.CutPage();
         if (ret == ReceiptPrinter.Status.SUCC)
         {
             return(Result.Success);
         }
         else
         {
             return(Result.PaperFew);
         }
     }
     else if (ret == ReceiptPrinter.Status.OUT_OF_PAPER)
     {
         return(Result.OutOfPaper);
     }
     else
     {
         return(Result.Fail);
     }
 }
Esempio n. 3
0
        protected virtual Result OnPrintReceipt(ArrayList content)
        {
            ReceiptPrinter.Status ret = ReceiptPrinter.OpenPrint();
            if (ret != ReceiptPrinter.Status.SUCC && ret != ReceiptPrinter.Status.PAPER_FEW)
            {
                Log.Warn("´ò¿ª´òÓ¡»ú¹ÊÕÏ!ret=" + ret.ToString());
                return(Result.Fail);
            }

            ReceiptPrinter.SetPrintPosition(0);
            ret = ReceiptPrinter.PrintString(content);
            if (ret == ReceiptPrinter.Status.SUCC || ret == ReceiptPrinter.Status.PAPER_FEW)
            {
                ReceiptPrinter.FeedLine(8);
                ReceiptPrinter.CutPage();
                ReceiptPrinter.ClosePrint();

                if (ret == ReceiptPrinter.Status.SUCC)
                {
                    return(Result.Success);
                }
                else
                {
                    return(Result.PaperFew);
                }
            }
            else if (ret == ReceiptPrinter.Status.OUT_OF_PAPER)
            {
                return(Result.OutOfPaper);
            }
            else
            {
                return(Result.Fail);
            }
        }