Beispiel #1
0
        string CodigoBarra2(string c_Dato)
        {
            string c_nomarchivo = "";

            string texto = c_Dato;

            c_nomarchivo = DateTime.Now.ToString("hhmmss") + "_" + c_Dato + ".bmp";
            //BarcodePDF417 codigobarras = new BarcodePDF417();
            Barcode128 codigobarras = new Barcode128();

            //codigobarras.Options = BarcodePDF417.PDF417_USE_ASPECT_RATIO;
            //codigobarras.ErrorLevel = 8;
            //codigobarras.SetText(texto);

            //codigobarras.TextAlignment = Element.ALIGN_CENTER;
            codigobarras.Code          = c_Dato;
            codigobarras.StartStopText = false;
            codigobarras.CodeType      = iTextSharp.text.pdf.Barcode128.EAN13;
            codigobarras.Extended      = true;

            System.Drawing.Bitmap bm = new Bitmap(codigobarras.CreateDrawingImage(Color.Black, Color.White));

            c_nomarchivo = @"c:\ssf-net\tmp\ticket\" + c_nomarchivo;
            Cls_IO o_io = new Cls_IO();

            o_io.Fil_EliminarArchivo(c_nomarchivo);
            bm.Save(c_nomarchivo);
            return(c_nomarchivo);
        }
Beispiel #2
0
        string CodigoBarra(int n_IdEmpresa, string c_Dato)
        {
            string c_nomarchivo = "";

            string texto = c_Dato;

            c_nomarchivo = DateTime.Now.ToString("hhmmss") + "_" + n_IdEmpresa.ToString("00000000") + ".bmp";
            BarcodePDF417 codigobarras = new BarcodePDF417();

            codigobarras.Options = BarcodePDF417.PDF417_USE_ASPECT_RATIO;

            codigobarras.ErrorLevel = 8;
            codigobarras.SetText(texto);
            System.Drawing.Bitmap bm = new Bitmap(codigobarras.CreateDrawingImage(Color.Black, Color.White));

            c_nomarchivo = @"c:\ssf-net\tmp\ticket\" + c_nomarchivo;
            Cls_IO o_io = new Cls_IO();

            o_io.Fil_EliminarArchivo(c_nomarchivo);
            bm.Save(c_nomarchivo);
            return(c_nomarchivo);
        }
Beispiel #3
0
        void LeerPedidoCEN(string c_ArchivoPedido)
        {
            Helper.Comunes.Funciones funFunciones = new Helper.Comunes.Funciones();
            Cls_IO funIo = new Cls_IO();
            int    n_fil = 0;
            int    n_row = 0;

            string[] arrTmp;
            string[] arrDatos = new string[100];
            string[,] a_Detalle = new string[50, 3];
            string[] a_Cabecera = new string[8];
            arrDatos = funIo.LeerLineaArchivo(c_ArchivoPedido);
            int n_NumeroElementos = Convert.ToInt32(arrDatos.GetLongLength(0)) - 1;   // OBTENEMOS EL NUMERO DE ELEMENTOS DEL ARRAY

            string c_numped = "";
            string c_fchemi = "";
            string c_fchent = "";

            string c_punent = "";
            string c_punven = "";
            string c_codcli = "";
            string c_impigv = "";
            string c_imptot = "";
            string c_moneda = "";

            string c_codite = "";
            string c_cantid = "";
            string c_precio = "";

            // CARGAMOS LA CABECERA DEL PEDIDO
            for (n_fil = 0; n_fil <= n_NumeroElementos - 1; n_fil++)
            {
                if (n_fil == 0)
                {       // NUMERO DEL PEDIDO
                    var arrayENC = arrDatos[n_fil].Split(',');
                    if (arrayENC.Length > 0)
                    {
                        c_numped = arrayENC[5];
                    }
                    else
                    {
                        c_numped = arrDatos[n_fil].ToString().Substring(44, 21);
                    }
                }

                if (n_fil == 1)
                {
                    c_fchemi = arrDatos[n_fil].ToString().Substring(4, 8);                          // FECHA DE EMISION
                    c_fchent = arrDatos[n_fil].ToString().Substring(19, 8);                         // FECHA DE ENTREGA
                }

                //BYOC,7750892001588,,,7751324010802
                //1234567890123456789012345678901234567890
                if (n_fil == 2)
                {
                    c_punven = arrDatos[n_fil].ToString().Substring(21, 13);
                }                                                                                    // PUNTO DE VENTA
                if (n_fil == 4)
                {
                    c_punent = arrDatos[n_fil].ToString().Substring(5, 13);
                }                                                                                   // PUNTO DE ENTREGA
                if (n_fil == 6)
                {
                    c_impigv = arrDatos[n_fil].ToString().Substring(7, 6);
                }                                                                                   // IMPORTE IGV
                if (n_fil == 7)
                {
                    c_moneda = arrDatos[n_fil].ToString().Substring(4, 3);
                }                                                                                   // MONEDA
                if (n_fil == 9)                                                                     // IMPORTE TOTAL
                {
                    arrTmp   = arrDatos[n_fil].Split(',');
                    c_imptot = arrTmp[1]; // arrDatos[n_fil].ToString().Substring(4, 8);
                }

                if (n_fil == 10)
                {
                    break;
                }
            }

            a_Cabecera[0] = c_numped;
            a_Cabecera[1] = c_fchemi;
            a_Cabecera[2] = c_fchent;
            a_Cabecera[3] = c_punven;
            a_Cabecera[4] = c_impigv;
            a_Cabecera[5] = c_moneda;
            a_Cabecera[6] = c_imptot;
            a_Cabecera[7] = c_punent;

            n_row = 0;

            // CARGAMOS EL DETALLE DEL PEDIDO
            for (n_fil = 10; n_fil <= n_NumeroElementos - 1; n_fil++)
            {
                c_codite = ""; c_cantid = ""; c_precio = "";
                c_codite = arrDatos[n_fil];
                if (funFunciones.NulosC(c_codite) != "")
                {
                    if (arrDatos[n_fil].ToString().Substring(0, 3) == "LIN")
                    {
                        //BE_VTA_PEDIDOCENDET entDet = new BE_VTA_PEDIDOCENDET();

                        //c_codite = arrDatos[n_fil].ToString().Substring(6, 13);     // CODIGO DEL ITEM
                        string[] a_Dato2 = arrDatos[n_fil].Split(',');
                        c_codite = a_Dato2[2];


                        string[] a_Dato = arrDatos[n_fil + 1].Split(',');           // CANTIDAD DEL ITEM
                        c_cantid = a_Dato[1];

                        a_Dato   = arrDatos[n_fil + 3].Split(',');                  // PRECIO UNITARIO
                        c_precio = a_Dato[3];

                        a_Detalle[n_row, 0] = c_codite;
                        a_Detalle[n_row, 1] = c_cantid;
                        a_Detalle[n_row, 2] = c_precio;

                        //entDet.c_coditecen = c_codite;
                        //entDet.c_codunimedcen = "";
                        //entDet.n_canpro = Convert.ToDouble(c_cantid);
                        //entDet.n_precio = Convert.ToDouble( c_precio);
                        //a_DetalleCEN.
                        n_fil = n_fil + 4;
                        n_row = n_row + 1;
                    }
                    else
                    {
                        //n_fil = n_fil + 1;
                        //break;
                    }

                    //n_row = n_row + 1;
                }
            }

            a_CabeceraCEN = a_Cabecera;
            a_DetalleCEN  = a_Detalle;
        }