public string TemplateCotizacionPdf(string generalTemplate, CotizacionOrden cotizacion) { string productosTable = string.Empty; foreach (var item in cotizacion.detalleCotizacion) { productosTable += TemplateConstans.cotizacionTemplate .Replace("{Serie}", item.Serie) .Replace("{Descripcion}", item.Descripcion) .Replace("{Capacidad}", item.capacidad.ToString()) .Replace("{PUnitario}", "S/ " + item.Precio.ToString()); } string emailMessage = generalTemplate .Replace("{anio}", cotizacion.Anio.ToString()) .Replace("{dia}", cotizacion.Dia) .Replace("{mes}", cotizacion.Mes) .Replace("{Direccion}", cotizacion.Direccion) .Replace("{FullName}", cotizacion.Nombre) .Replace("{ProductosTable}", productosTable) .Replace("{D.N.I}", cotizacion.dni) .Replace("{TipoDocumento}", cotizacion.tipoDocumento) .Replace("{subTotal}", "S/ " + cotizacion.SubTotal) .Replace("{total}", "S/ " + cotizacion.SubTotal); return(emailMessage); }
public string CotizacionHtmlPdf(CotizacionOrden cotizacion) { //string generalTemplate = ReadPhysicalFile(cotizacion.PathPdf); string generalTemplate = ""; using (WebClient client = new WebClient()) { generalTemplate = client.DownloadString("https://firebasestorage.googleapis.com/v0/b/proyectovents.appspot.com/o/Cotizacion.html?alt=media&token=8c2158e7-0762-4ea4-be47-41f6e4f43d2b.html"); } string bodyMessage = TemplateCotizacionPdf(generalTemplate, cotizacion); return(bodyMessage); }