Exemple #1
0
        public string TemplateFacturPdf(string generalTemplate, FacturaOrden factura)
        {
            string productosTable = string.Empty;

            foreach (var item in factura.detalleOrden)
            {
                productosTable += TemplateConstans.facturaTemplate
                                  .Replace("{Serie}", item.Serie)
                                  .Replace("{Descripcion}", item.Descripcion)
                                  .Replace("{PUnitario}", "S/ " + item.PUnitario.ToString());
            }

            string emailMessage = generalTemplate
                                  .Replace("{TipoDocumento}", factura.TipoDocumento)
                                  .Replace("{D.N.I}", factura.DNI)
                                  .Replace("{anio}", factura.Anio.ToString())
                                  .Replace("{dia}", factura.Dia)
                                  .Replace("{mes}", factura.Mes)
                                  .Replace("{Direccion}", factura.Direccion)
                                  .Replace("{FullName}", factura.FullName)
                                  .Replace("{ProductosTable}", productosTable)
                                  .Replace("{subTotal}", "S/ " + factura.SubTotal)
                                  .Replace("{total}", "S/ " + factura.Total);

            return(emailMessage);
        }
Exemple #2
0
        public string FacturaHtmlPdf(FacturaOrden factura)
        {
            //string generalTemplate = ReadPhysicalFile(factura.PathPdf);
            string generalTemplate = "";

            using (WebClient client = new WebClient())
            {
                generalTemplate = client.DownloadString("https://firebasestorage.googleapis.com/v0/b/proyectovents.appspot.com/o/Factura.html?alt=media&token=1eccb03e-d258-4967-9f09-bfa33778a5e2.html");
            }
            string bodyMessage = TemplateFacturPdf(generalTemplate, factura);

            return(bodyMessage);
        }
Exemple #3
0
        public string BoletaHtmlPdf(FacturaOrden factura)
        {
            //string generalTemplate = ReadPhysicalFile(factura.PathPdf);
            string generalTemplate = "";

            using (WebClient client = new WebClient())
            {
                generalTemplate = client.DownloadString("https://firebasestorage.googleapis.com/v0/b/proyectovents.appspot.com/o/Boleta.html?alt=media&token=74db8166-a42a-4f02-9f49-2bbf4a70f626.html");
            }
            string bodyMessage = TemplateFacturPdf(generalTemplate, factura);

            return(bodyMessage);
        }