Example #1
0
 public void TextoIzquierda(string par1)
 {
     this.max = par1.Length;
     if (this.max > 40)
     {
         this.cort   = this.max - 40;
         this.parte1 = par1.Remove(40, this.cort);
     }
     else
     {
         this.parte1 = par1;
     }
     this.ticket = this.parte1 + "\n";
     RawPrinterHelper.SendStringToPrinter(this.impresora, this.ticket);
 }
Example #2
0
 public void TextoCentro(string par1)
 {
     this.ticket = "";
     this.max    = par1.Length;
     if (this.max > 40)
     {
         this.cort   = this.max - 40;
         this.parte1 = par1.Remove(40, this.cort);
     }
     else
     {
         this.parte1 = par1;
     }
     this.max = (40 - this.parte1.Length) / 2;
     for (int i = 0; i < this.max; i++)
     {
         this.ticket += " ";
     }
     this.ticket = this.ticket + this.parte1 + "\n";
     RawPrinterHelper.SendStringToPrinter(this.impresora, this.ticket);
 }
Example #3
0
 public void AgregaArticulo(string par1, int cant, double precio, double total)
 {
     if (cant.ToString().Length <= 3 && precio.ToString("c").Length <= 10 && total.ToString("c").Length <= 11)
     {
         this.max = par1.Length;
         if (this.max > 16)
         {
             this.cort   = this.max - 16;
             this.parte1 = par1.Remove(16, this.cort);
         }
         else
         {
             this.parte1 = par1;
         }
         this.ticket = this.parte1;
         this.max    = 3 - cant.ToString().Length + (16 - this.parte1.Length);
         for (int i = 0; i < this.max; i++)
         {
             this.ticket += " ";
         }
         this.ticket += cant.ToString();
         this.max     = 10 - precio.ToString("c").Length;
         for (int j = 0; j < this.max; j++)
         {
             this.ticket += " ";
         }
         this.ticket += precio.ToString("c");
         this.max     = 11 - total.ToString().Length;
         for (int k = 0; k < this.max; k++)
         {
             this.ticket += " ";
         }
         this.ticket = this.ticket + total.ToString("c") + "\n";
         RawPrinterHelper.SendStringToPrinter(this.impresora, this.ticket);
         return;
     }
     MessageBox.Show("Valores fuera de rango");
     RawPrinterHelper.SendStringToPrinter(this.impresora, "Error, valor fuera de rango\n");
 }
Example #4
0
 public void AgregaTotales(string par1, double total)
 {
     this.max = par1.Length;
     if (this.max > 25)
     {
         this.cort   = this.max - 25;
         this.parte1 = par1.Remove(25, this.cort);
     }
     else
     {
         this.parte1 = par1;
     }
     this.ticket = this.parte1;
     this.parte2 = total.ToString("c");
     this.max    = 40 - (this.parte1.Length + this.parte2.Length);
     for (int i = 0; i < this.max; i++)
     {
         this.ticket += " ";
     }
     this.ticket = this.ticket + this.parte2 + "\n";
     RawPrinterHelper.SendStringToPrinter(this.impresora, this.ticket);
 }
Example #5
0
 public void EncabezadoVenta()
 {
     this.ticket = "Articulo        Can    P.Unit    Importe\n";
     RawPrinterHelper.SendStringToPrinter(this.impresora, this.ticket);
 }
Example #6
0
 public void LineasTotales()
 {
     this.ticket = "                             -----------\n";
     RawPrinterHelper.SendStringToPrinter(this.impresora, this.ticket);
 }
Example #7
0
 public void LineasIgual()
 {
     this.ticket = "========================================\n";
     RawPrinterHelper.SendStringToPrinter(this.impresora, this.ticket);
 }
Example #8
0
 public void LineasAsterisco()
 {
     this.ticket = "****************************************\n";
     RawPrinterHelper.SendStringToPrinter(this.impresora, this.ticket);
 }
Example #9
0
        public void AbreCajon()
        {
            string szString = "\u001bp\0\u000f\u0096";

            RawPrinterHelper.SendStringToPrinter(this.impresora, szString);
        }