private void Imprimir_barcode_z4000()
        {
            #region »» Variables ««
            String CRTLF = Convert.ToString(Equivalencias.Chr(13)) + Convert.ToString(Equivalencias.Chr(10));

            String X11 = "^XA^MCY^XZ";
            String X12 = "^XA";
            String X13 = "^LRN^FWN^CFD,24^LH0,0";
            String X14 = "^CI0^PR2^MNY^MTT^MMT^MD0^PON^PMN";
            String X15 = "^XZ";
            String X16 = "^XA";

            String X55 = "^PQ1,0,1,Y";
            String X66 = "^XZ";
            String X77 = "^XA";

            /*** Variables para Tickets ***/

            String TW101 = "^FT29,28^A0N,20,19^FH\n^FD";
            String TW102 = "^FT29,54^A0N,20,19^FH\n^FD";
            String TW103 = "^FT29,81^A0N,20,19^FH\n^FD";
            String TW104 = "^FT29,106^A0N,20,19^FH\n^FD";
            String TW105 = "^FT102,28^A0N,20,19^FH\n^FD";
            String TW106 = "^FT102,54^A0N,20,19^FH\n^FD";
            String TW107 = "^FT102,81^A0N,20,19^FH\n^FD";
            String TW108 = "^FT102,106^A0N,20,19^FH\n^FD";
            String TW109 = "^BY2,3,48^FT37,167^BAN,,N,N^FD";
            String TW110 = "^FT124,191^A0N,20,19^FH\n^FD";

            String TW201 = "^FT459,28^A0N,20,19^FH\n^FD";
            String TW202 = "^FT459,54^A0N,20,19^FH\n^FD";
            String TW203 = "^FT459,81^A0N,20,19^FH\n^FD";
            String TW204 = "^FT459,106^A0N,20,19^FH\n^FD";
            String TW205 = "^FT532,28^A0N,20,19^FH\n^FD";
            String TW206 = "^FT532,54^A0N,20,19^FH\n^FD";
            String TW207 = "^FT532,81^A0N,20,19^FH\n^FD";
            String TW208 = "^FT532,106^A0N,20,19^FH\n^FD";
            String TW209 = "^BY2,3,48^FT467,167^BAN,,N,N^FD";
            String TW210 = "^FT554,191^A0N,20,19^FH\n^FD";

            #endregion

            String pTEXTO = "";
            Int16 nConFile = 0;
            int xStick = 0;
            String xComa = "";
            xStick = xStick + 1;

            String xTW01 = "", xTW02 = "", xTW03 = "", xTW04 = "", xTW05 = "",
                      xTW06 = "", xTW07 = "", xTW08 = "", xTW09 = "", xTW10 = "";

            for (int i = 0; i < dgb_codigos.RowCount; i++)
            {
                Int32 xcanti = Convert.ToInt32(dgb_codigos.GetRowCellValue(i, "cantidad").ToString());
                Int32 xnum = 1;
                while (xnum <= xcanti)
                {
                    xTW01 = "Linea :";
                    xTW02 = "Marca :";
                    xTW03 = "Modelo:";
                    xTW04 = "Serie :";

                    xTW05 = dgb_codigos.GetRowCellValue(i, "lineaname").ToString();
                    xTW06 = dgb_codigos.GetRowCellValue(i, "gruponame").ToString();
                    xTW07 = dgb_codigos.GetRowCellValue(i, "subgrupoartic").ToString();
                    xTW08 = dgb_codigos.GetRowCellValue(i, "nserie").ToString();
                    xTW09 = dgb_codigos.GetRowCellValue(i, "productid").ToString();
                    xTW10 = dgb_codigos.GetRowCellValue(i, "productid").ToString();

                    switch (xStick)
                    {
                        case 1:
                            /*** Inicializa Impresora ***/
                            pTEXTO = pTEXTO + X11 + CRTLF;
                            pTEXTO = pTEXTO + X12 + CRTLF;
                            pTEXTO = pTEXTO + X13 + CRTLF;
                            pTEXTO = pTEXTO + X14 + CRTLF;
                            pTEXTO = pTEXTO + X15 + CRTLF;
                            pTEXTO = pTEXTO + X16 + CRTLF;

                            pTEXTO = pTEXTO + TW101 + xTW01 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW102 + xTW02 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW103 + xTW03 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW104 + xTW04 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW105 + xTW05 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW106 + xTW06 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW107 + xTW07 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW108 + xTW08 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW109 + xTW09 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW110 + xTW10 + "^FS" + CRTLF;

                            xStick = xStick + 1;
                            break;
                        case 2:
                            pTEXTO = pTEXTO + TW201 + xTW01 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW202 + xTW02 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW203 + xTW03 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW204 + xTW04 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW205 + xTW05 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW206 + xTW06 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW207 + xTW07 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW208 + xTW08 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW209 + xTW09 + "^FS" + CRTLF;
                            pTEXTO = pTEXTO + TW210 + xTW10 + "^FS" + CRTLF;

                            pTEXTO = pTEXTO + X55 + CRTLF;
                            pTEXTO = pTEXTO + X66 + CRTLF;
                            pTEXTO = pTEXTO + X77 + CRTLF;

                            xStick = 1;
                            break;
                    }
                    xnum = xnum + 1;
                }
            }

            if (xStick == 2)
            {
                pTEXTO = pTEXTO + X55 + CRTLF;
                pTEXTO = pTEXTO + X66 + CRTLF;
                pTEXTO = pTEXTO + X77 + CRTLF;
            }

            //*** creando archivo de texto

            try
            {
                // Llamamos al Formulario de Vista Previa
                Ayudas.Frm_vistaprevia frm = new Ayudas.Frm_vistaprevia();
                frm.detalle = pTEXTO.ToString();
                frm.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message.ToString());
            }
        }
        private void Imprimir_barcode_EPL()
        {
            #region »» Variables ««
            String CRTLF = Convert.ToString(Equivalencias.Chr(13)) + Convert.ToString(Equivalencias.Chr(10));

            String X11 = "I8,A";
            String X12 = "q812";
            String X13 = "OD";
            String X14 = "JF";
            String X15 = "WN";
            String X16 = "ZT";
            String X17 = "Q208,25";
            String X18 = "N";

            String X88 = "P1";
            String X89 = "N";

            /*** Variables para Tickets ***/

            String xComi = "\"";

            String TW101 = "A787,173,2,2,1,1,N," + xComi; 		//Linea:"
            String TW102 = "A699,173,2,2,1,1,N," + xComi;		//MONITOR"
            String TW103 = "A787,149,2,2,1,1,N," + xComi;		//Marca:"
            String TW104 = "A699,149,2,2,1,1,N," + xComi;		//LG"
            String TW105 = "A787,125,2,2,1,1,N," + xComi;		//Modelo:"
            String TW106 = "A699,125,2,2,1,1,N," + xComi;		//FLATRON L17753T"
            String TW107 = "A787,101,2,2,1,1,N," + xComi;		//Serie:"
            String TW108 = "A699,101,2,2,1,1,N," + xComi;		//703NDRFAT5379"
            String TW109 = "B787,79,2,9,2,4,54,N," + xComi;    //0010047001002"
            String TW110 = "A691,21,2,2,1,1,N," + xComi;	    //0010047001002"

            String TW201 = "A369,173,2,2,1,1,N," + xComi;		//Linea:"
            String TW202 = "A281,173,2,2,1,1,N," + xComi;		//MONITOR"
            String TW203 = "A369,149,2,2,1,1,N," + xComi;		//Marca:"
            String TW204 = "A281,149,2,2,1,1,N," + xComi;		//LG"
            String TW205 = "A369,125,2,2,1,1,N," + xComi;		//Modelo:"
            String TW206 = "A281,125,2,2,1,1,N," + xComi;		//FLATRON L17753T"
            String TW207 = "A369,101,2,2,1,1,N," + xComi;		//Serie:"
            String TW208 = "A281,101,2,2,1,1,N," + xComi;		//703NDRFAT5379"
            String TW209 = "B369,79,2,9,2,4,54,N," + xComi;	//0010047001002"
            String TW210 = "A273,21,2,2,1,1,N," + xComi;		//0010047001002"

            #endregion

            String pTEXTO = "";
            int xStick = 0;

            xStick = xStick + 1;

            /*** Inicializa Impresora ***/
            pTEXTO = pTEXTO + X11 + CRTLF;
            pTEXTO = pTEXTO + X12 + CRTLF;
            pTEXTO = pTEXTO + X13 + CRTLF;
            pTEXTO = pTEXTO + X14 + CRTLF;
            pTEXTO = pTEXTO + X15 + CRTLF;
            pTEXTO = pTEXTO + X16 + CRTLF;
            pTEXTO = pTEXTO + X17 + CRTLF;
            pTEXTO = pTEXTO + X18 + CRTLF;

            for (int i = 0; i < dgb_codigos.RowCount; i++)
            {
                String xTW01 = "", xTW02 = "", xTW03 = "", xTW04 = "", xTW05 = "",
                       xTW06 = "", xTW07 = "", xTW08 = "", xTW09 = "", xTW10 = "";

                Int32 xcanti = Convert.ToInt32(dgb_codigos.GetRowCellValue(i, "cantidad").ToString());
                Int32 xnum = 1;
                while (xnum <= xcanti)
                {
                    xTW01 = "Linea :";
                    xTW02 = dgb_codigos.GetRowCellValue(i, "lineaname").ToString();
                    xTW03 = "Marca :";
                    xTW04 = dgb_codigos.GetRowCellValue(i, "gruponame").ToString();
                    xTW05 = "Modelo:";
                    xTW06 = dgb_codigos.GetRowCellValue(i, "subgrupoartic").ToString();
                    xTW07 = "Serie :";
                    xTW08 = dgb_codigos.GetRowCellValue(i, "nserie").ToString();
                    xTW09 = dgb_codigos.GetRowCellValue(i, "productid").ToString();
                    xTW10 = dgb_codigos.GetRowCellValue(i, "productid").ToString();

                    switch (xStick)
                    {
                        case 1:

                            pTEXTO = pTEXTO + TW101 + xTW01 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW102 + xTW02 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW103 + xTW03 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW104 + xTW04 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW105 + xTW05 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW106 + xTW06 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW107 + xTW07 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW108 + xTW08 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW109 + xTW09 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW110 + xTW10 + xComi + CRTLF;

                            xStick = xStick + 1;
                            break;
                        case 2:
                            pTEXTO = pTEXTO + TW201 + xTW01 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW202 + xTW02 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW203 + xTW03 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW204 + xTW04 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW205 + xTW05 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW206 + xTW06 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW207 + xTW07 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW208 + xTW08 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW209 + xTW09 + xComi + CRTLF;
                            pTEXTO = pTEXTO + TW210 + xTW10 + xComi + CRTLF;
                            pTEXTO = pTEXTO + X88 + CRTLF;
                            pTEXTO = pTEXTO + X89 + CRTLF;

                            xStick = 1;
                            break;
                    }
                    xnum = xnum + 1;
                }
            }

            if (xStick == 2)
            {
                pTEXTO = pTEXTO + X88 + CRTLF;
                pTEXTO = pTEXTO + X89 + CRTLF;
            }

            //*** creando archivo de texto

            try
            {
               // Llamamos al Formulario de Vista Previa
                Ayudas.Frm_vistaprevia frm = new Ayudas.Frm_vistaprevia();
                frm.detalle = pTEXTO.ToString();
                frm.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message.ToString());
            }
        }