76 lines
2.7 KiB
C#
76 lines
2.7 KiB
C#
using System;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using System.Collections;
|
|
using System.Web;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Web.UI.WebControls.WebParts;
|
|
using System.Web.UI.HtmlControls;
|
|
using ReportVS;
|
|
using ceTe.DynamicPDF.Merger;
|
|
using LogFilePDF;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
public partial class showPDFLetteraRistampa : System.Web.UI.Page
|
|
{
|
|
bool periodico;
|
|
string tipoReport;
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
int identificativoPDF = Convert.ToInt32(Request.QueryString.Get("pdfID"));
|
|
int pdfC6 = Convert.ToInt32(Request.QueryString.Get("pdfC6"));
|
|
string rete = Request.QueryString.Get("Rete");
|
|
string codiceFiscale = Request.QueryString.Get("CodiceFiscale");
|
|
|
|
this.readPDF(identificativoPDF, pdfC6, rete, codiceFiscale);
|
|
|
|
}
|
|
|
|
|
|
private void readPDF(int idPDF, int pdfC6,string rete,string codiceFiscale)
|
|
{
|
|
DocumentPDF documentPDF = new DocumentPDF();
|
|
|
|
List<Parametro> parametri = new List<Parametro>();
|
|
Parametro idq = new Parametro();
|
|
idq.ParameterName = "Id";
|
|
idq.DbType = DbType.Int32;
|
|
idq.Value = idPDF;
|
|
parametri.Add(idq);
|
|
|
|
DataTable dati = DataAccess.ExecuteDataTableStoredProcedure(DBProvider.SqlServer, "[dbo].[sp_getCheckPeriodico]", parametri);
|
|
periodico = false;
|
|
tipoReport = string.Empty;
|
|
if (dati.Rows.Count > 0)
|
|
{
|
|
periodico = (Convert.ToBoolean(dati.Rows[0]["FlagPeriodico"]));
|
|
tipoReport = dati.Rows[0]["TipoReport"].ToString();
|
|
}
|
|
|
|
byte[] letteraAccompagnamento;
|
|
|
|
if (!periodico)
|
|
letteraAccompagnamento = GestoreLettera.componiLetteraRistampa(codiceFiscale, rete, LetteraAccompagnamento.TipoReport.Diagnosi, idPDF, false);
|
|
else
|
|
if (tipoReport.ToUpper() == "DIAGNOSI")
|
|
letteraAccompagnamento = GestoreLettera.componiLetteraRistampa(codiceFiscale, rete, LetteraAccompagnamento.TipoReport.Diagnosi, idPDF, true);
|
|
else
|
|
letteraAccompagnamento = GestoreLettera.componiLetteraRistampa(codiceFiscale, rete, LetteraAccompagnamento.TipoReport.Monitoraggio, idPDF, true);
|
|
|
|
byte[] pdf = documentPDF.getDataFromDB(idPDF, pdfC6);
|
|
PdfDocument pdfLetteraAccompagnamento= new PdfDocument(letteraAccompagnamento);
|
|
PdfDocument pdfDoc = new PdfDocument(pdf);
|
|
MergeDocument mDoc = MergeDocument.Merge(pdfLetteraAccompagnamento, pdfDoc);
|
|
GestoreLogPDF gl = new GestoreLogPDF(idPDF);
|
|
gl.Applicativo = "HD";
|
|
|
|
gl.scriviLog(EventLog.C6_LetteraAccompagnamento);
|
|
mDoc.DrawToWeb();
|
|
}
|
|
}
|
|
|