private string Reporte(string folio)
        {
            try
            {
                List <ProductoCompleto> listaProductos = new List <ProductoCompleto>();
                string[] pedido, usuario, cliente;

                try
                {
                    pedido = Sql.BuscarDatos("SELECT * FROM venta WHERE id_venta = '" + folio + "'")[0];
                }
                catch (Exception)
                {
                    pedido = new string[] { " ", " ", " ", " ", " ", " ", " ", " ", " " };
                }

                try
                {
                    usuario = Sql.BuscarDatos("SELECT usuario, nombre, apellido_paterno, apellido_materno" +
                                              " FROM usuarios WHERE id_usuario = '" + pedido[1] + "'")[0];
                }
                catch (Exception)
                {
                    usuario = new string[] { " ", " ", " ", " " };
                }

                try
                {
                    cliente = Sql.BuscarDatos("SELECT nombres, apellido_paterno, apellido_materno, rfc, telefono, domicilio, correo_electronico " +
                                              " FROM clientes WHERE id_cliente = '" + pedido[2] + "'")[0];
                }
                catch (Exception)
                {
                    cliente = new string[] { " ", " ", " ", " ", " ", " ", " " };
                }

                foreach (string datos in pedido[5].Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    string[] temp = datos.Split(new char[] { ':' });
                    if (Sql.Existe("SELECT codigo, nombre FROM productos WHERE codigo = '" + temp[0] + "' "))
                    {
                        string[] producto = Sql.BuscarDatos("SELECT codigo, nombre FROM productos WHERE codigo = '" + temp[0] + "' ")[0];
                        listaProductos.Add(new ProductoCompleto(producto[0], producto[1], float.Parse(temp[1]), int.Parse(temp[3]), float.Parse(temp[2])));
                    }
                    else
                    {
                        listaProductos.Add(new ProductoCompleto("Codigo elim.", "Productos elim.", float.Parse(temp[1]), int.Parse(temp[3]), float.Parse(temp[2])));
                    }
                }

                Venta venta = new Venta(int.Parse(pedido[0]), new Usuarios(usuario[0], usuario[1] + " " + usuario[2] + " " + usuario[3]),
                                        new Clientes(cliente[0], cliente[1], cliente[2], cliente[3], cliente[4], cliente[5], cliente[6]),
                                        bool.Parse(pedido[3]), pedido[4], listaProductos, float.Parse(pedido[6]),
                                        float.Parse(pedido[7]), float.Parse(pedido[8]));

                InfoReporte rep = GuardarInfoReporte.Leer();
                string[,] data = { { "Cotización Tienda", "Fecha: ",   "RFC: ",         "Dirección: ",         "Telefono: ",         "Atendido por: "             },
                                   { folio,               venta.Fecha, rep.Reporte.rfc, rep.Reporte.direccion, rep.Reporte.telefono, venta.Usuario.NombreCompleto } };

                PDFFile pdf = new PDFFile("reportes", "reporte-");
                pdf.CrearPDF();

                for (int i = 0; i < 2; i++)
                {
                    if (i == 1)
                    {
                        data[0, 0] = "Cotización cliente";
                        pdf.NuevoRenglon();
                        pdf.CrearCabecera(data);
                    }
                    else
                    {
                        pdf.NuevoRenglon();
                        pdf.CrearCabecera(data);
                    }

                    pdf.AgregarInfoCliente(venta.Cliente);
                    pdf.AgregarProductos(venta, false);
                    pdf.AgregarAnotaciones(" ");
                    pdf.NuevaPagina();
                }
                data[0, 0] = "Almacen";
                pdf.CrearCabecera(data);
                pdf.AgregarInfoCliente(venta.Cliente);
                pdf.AgregarProductos(venta, true);
                pdf.AgregarAnotaciones(" ");
                pdf.Cerrar();

                return(pdf.Ruta);
            }
            catch (Exception) { }
            return(null);
        }
        private string ReporteCotizacion(string id_cotizacion)
        {
            try
            {
                List <ProductoCompleto> listaProductos = new List <ProductoCompleto>();
                string[] cotizacion, usuario, cliente;

                try
                {
                    cotizacion = Sql.BuscarDatos("SELECT * FROM cotizacion WHERE id_cotizacion = '" + id_cotizacion + "'")[0];
                }
                catch (Exception)
                {
                    cotizacion = new string[] { " ", " ", " ", " ", " ", " ", " ", " ", " " };
                }

                try
                {
                    usuario = Sql.BuscarDatos("SELECT usuario, nombre, apellido_paterno, apellido_materno" +
                                              " FROM usuarios WHERE id_usuario = '" + cotizacion[1] + "'")[0];
                }
                catch (Exception)
                {
                    usuario = new string[] { " ", " ", " ", " " };
                }

                try
                {
                    cliente = Sql.BuscarDatos("SELECT nombres, apellido_paterno, apellido_materno, rfc, telefono, domicilio, correo_electronico " +
                                              " FROM clientes WHERE id_cliente = '" + cotizacion[2] + "'")[0];
                }
                catch (Exception)
                {
                    cliente = new string[] { " ", " ", " ", " ", " ", " ", " " };
                }

                foreach (string datos in cotizacion[3].Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    string[] temp     = datos.Split(new char[] { ':' });
                    string[] producto = Sql.BuscarDatos("SELECT codigo, nombre FROM productos WHERE codigo = '" + temp[0] + "'")[0];
                    listaProductos.Add(new ProductoCompleto(producto[0], producto[1], float.Parse(temp[1]), int.Parse(temp[3]), float.Parse(temp[2])));
                }

                Cotizacion cotizar = new Cotizacion(int.Parse(cotizacion[0]), new Usuarios(usuario[0], usuario[1] + " " + usuario[2] + " " + usuario[3]),
                                                    new Clientes(cliente[0], cliente[1], cliente[2], cliente[3], cliente[4], cliente[5], cliente[6]),
                                                    cotizacion[5], listaProductos, float.Parse(cotizacion[4]));

                InfoReporte rep = GuardarInfoReporte.Leer();
                string[,] data = { { "Precotización",                  "Fecha: ",                "RFC: ",         "Dirección: ", "Telefono: ", "Atendido por: " },
                                   { cotizar.Id_cotizacion.ToString(), cotizar.Fecha.ToString(), rep.Reporte.rfc,
                                                                       rep.Reporte.direccion, rep.Reporte.telefono, cotizar.Usuario.NombreCompleto } };

                PDFFile pdf = new PDFFile("reportes", "reporte-");

                pdf.CrearPDF();
                pdf.CrearCabecera(data);
                pdf.AgregarInfoCliente(cotizar.Cliente);
                pdf.AgregarProductos(cotizar);
                pdf.AgregarAnotaciones(" ");
                pdf.Cerrar();
                return(pdf.Ruta);
            }
            catch (Exception) { }
            return(null);
        }