예제 #1
0
        public void Enviar(OrdenCompra o)
        {
            string numOC = "OC-" + 1000000 + o.IdOrden;
                GenerarPDF pdf = new GenerarPDF();
                Correo c = new Correo();
                //[email protected]
                string path = "\\" + numOC + ".pdf";

                string body = formato(o).ToString();
                string msg = "<html><body>Estimados :<br> Se adjunta la Orden de compra , Atenderla porfavor. <br>Saludos.<br>MadeInHouse <br>Seccion Compras </body></html>"; ;
                pdf.createPDF(body, path, false);
                c.EnviarCorreo("ORDEN DE COMPRA AL " + DateTime.Now.ToString(), o.Proveedor.Email, msg, Environment.CurrentDirectory + path);
                pdf.Borrar(Environment.CurrentDirectory + path);
        }
예제 #2
0
 public string GenerarNotaCredito(Devolucion d, int num, List<DevolucionProducto> lstProductos)
 {
     string pathString = Environment.CurrentDirectory + @"\Archivos\NotasCredito";
     System.IO.Directory.CreateDirectory(pathString);
     GenerarPDF pdf = new GenerarPDF();
     string body = formatoBP(d, num, lstProductos).ToString();
     string date = DateTime.Now.ToString("yyyyMMddHHmmss");
     pdf.createPDF(body, "\\Archivos\\NotasCredito\\Nota"+date+".pdf", true);
     return "\\Archivos\\NotasCredito\\Nota" + date + ".pdf";
 }
 public void GenerarPDFFacturaServicios(Venta v)
 {
     string pathString = Environment.CurrentDirectory + @"\Archivos\DocumentosPago";
     System.IO.Directory.CreateDirectory(pathString);
     GenerarPDF pdf = new GenerarPDF();
     string body = formatoFS(v).ToString();
     string date = DateTime.Now.ToString("yyyyMMddHHmmss");
     pdf.createPDF(body, "\\Archivos\\DocumentosPago\\FS" + date + ".pdf", true);
 }
        public void GenerarPDF()
        {
            if (g != null)
            {
                    try
                    {
                        GenerarPDF pdf = new GenerarPDF();
                        Correo c = new Correo();
                        //[email protected]
                        string path = "//GuiaRemision-" + g.CodGuiaRem + ".pdf";
                        pdf.Borrar(Environment.CurrentDirectory + path);
                        string body = formato().ToString();
                        pdf.createPDF(body, path, true);

                        //c.EnviarCorreo("ORDEN DE COMPRA AL " + DateTime.Now.ToString(), OrdenSelected.Proveedor.Email, msg, Environment.CurrentDirectory + path);

                    }
                    catch (Exception e)
                    {
                        _windowManager.ShowDialog(new AlertViewModel(_windowManager, "No se pudo imprimir Guia \nRevisar conexiones"));
                    }

            }
        }
        public void GenerarPDF()
        {
            if (OrdenSelected != null)
            {

                if (OrdenSelected.Estado == 2)
                {
                    try
                    {
                        string numOC = "OC-" + 1000000 + OrdenSelected.IdOrden;
                        OrdenSelected.LstProducto = new OrdenCompraxProductoSQL().Buscar(OrdenSelected.IdOrden) as List<ProductoxOrdenCompra>;
                        GenerarPDF pdf = new GenerarPDF();
                        Correo c = new Correo();
                        //[email protected]
                        string path = "\\" + numOC+".pdf";

                        string body = formato(OrdenSelected).ToString();
                        string msg = "<html><body>Estimados :<br> Se adjunta la Orden de compra , Atenderla porfavor. <br>Saludos.<br>MadeInHouse <br>Seccion Compras </body></html>";
                        pdf.createPDF(body, path,false);
                        c.EnviarCorreo("ORDEN DE COMPRA AL " + DateTime.Now.ToString(), OrdenSelected.Proveedor.Email, msg, Environment.CurrentDirectory + path);
                        pdf.Borrar(Environment.CurrentDirectory + path);

                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("Ocurrio un error en el formato");
                    }
                }
                else
                {
                    MessageBox.Show("Solo se puede enviar correos de Ordenes de compra EMITIDAS.", "AVISO", MessageBoxButton.OK, MessageBoxImage.Exclamation);

                }
            }
        }