public Boolean GenerarPDF(Modelo.Factura factura, Ruta ruta) { string respuesta = ""; try { factura.ImagenCbbBytes = ruta.GetImageByte(ruta.RutaCBB); factura.Sucursal.LogoBytes = ruta.GetImageByte(HttpContext.Current.Server.MapPath(String.Format(Ruta.RutaImagenes, factura.Sucursal.Id, factura.Sucursal.Rfc, factura.Sucursal.Logo))); var facturaReporte = ServicioReporte.GenerarPDF(ref respuesta, factura, this._logger); if (facturaReporte != null) { facturaReporte.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, ruta.RutaPDF); } return(true); } catch (Exception e) { this._logger.EscribirError(e.ToString()); return(false); } }
public Boolean GenerarPDF(ref string error, Cotizacion cotizacion, Ruta ruta) { try { cotizacion.Sucursal.LogoBytes = ruta.GetImageByte(HttpContext.Current.Server.MapPath(String.Format(Ruta.RutaImagenes, cotizacion.Sucursal.Id, cotizacion.Sucursal.Rfc, cotizacion.Sucursal.Logo))); var cotizacionReporte = ServicioCotizacionReporte.GenerarPDF(ref error, cotizacion, this._logger); if (cotizacionReporte != null) { cotizacionReporte.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, ruta.RutaCotizacionPDF); } return(true); } catch (Exception e) { this._logger.EscribirError(e.ToString()); return(false); } }