259 lines
11 KiB
C#
259 lines
11 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 System.Text;
|
|
using System.Collections.Generic;
|
|
|
|
public partial class reportStampa : System.Web.UI.Page
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public string checkPrivacy;
|
|
public string codiceFiscale;
|
|
public string codiceRete;
|
|
public string codicePB;
|
|
public string ambiente;
|
|
public int idReportCaller;
|
|
public string tipologiaReport;
|
|
public int identificativo;
|
|
public HttpCookie ck_tipologiaReport;
|
|
public HttpCookie ck_idReportCaller;
|
|
public string token;
|
|
public string nomeInizialeReport;
|
|
public string descrizioneInizialeReport;
|
|
public string baseCompleto;
|
|
public int rifPianificazione;
|
|
|
|
//==================================================
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
string command = "updateTop();";
|
|
|
|
ClientScript.RegisterStartupScript(typeof(string), "pppppp",
|
|
"<script language=\"javascript\" type=\"text/javascript\">" + "\n" +
|
|
"<!--" + "\n" +
|
|
command + "\n" +
|
|
"//-->" + "\n" +
|
|
"</script>");
|
|
|
|
token = Request.QueryString.Get("token").ToString();
|
|
codiceRete = Request.QueryString.Get("codiceRete").ToString();
|
|
codiceFiscale = Request.QueryString.Get("codiceFiscale").ToString();
|
|
codicePB = Request.QueryString.Get("codicePB").ToString();
|
|
|
|
//if (!Page.IsPostBack)
|
|
//{
|
|
//setto il cookie a 0 per resettare lo stato iniziale. Viene messo a 1 dalla pagina di Generator.aspx.cs
|
|
HttpCookie ck_endOfJob = new HttpCookie("endOfJob");
|
|
ck_endOfJob.Value = "0";
|
|
Response.Cookies.Add(ck_endOfJob);
|
|
|
|
ambiente = Request.QueryString.Get("ambiente");
|
|
|
|
if (ambiente == null || ambiente == "")
|
|
{
|
|
//lettura cookie..(e' gia' stato scritto altrove)
|
|
HttpCookie ck_ambiente = new HttpCookie("ambiente");
|
|
ck_ambiente = System.Web.HttpContext.Current.Request.Cookies["ambiente"];
|
|
if (ck_ambiente != null)
|
|
{
|
|
ambiente = ck_ambiente.Value.ToString();
|
|
}
|
|
}
|
|
|
|
nomeInizialeReport = Request.QueryString.Get("nomeInizialeReport");
|
|
descrizioneInizialeReport = Request.QueryString.Get("descrizioneInizialeReport");
|
|
baseCompleto = Request.QueryString.Get("baseCompleto");
|
|
checkPrivacy = Request.QueryString.Get("checkPrivacy");
|
|
|
|
|
|
tipologiaReport = Request.QueryString.Get("tipoReport");
|
|
//aggiungo il cookie con la TIPOLOGIAREPORT
|
|
if (tipologiaReport != null)
|
|
{
|
|
ck_tipologiaReport = new HttpCookie("tipologiaReport");
|
|
ck_tipologiaReport.Value = tipologiaReport;
|
|
Response.Cookies.Add(ck_tipologiaReport);
|
|
}
|
|
|
|
idReportCaller = Convert.ToInt32(Request.QueryString.Get("idReport"));
|
|
//aggiungo il cookie con idReport (chiamante) da attivare in caso di pressione del tasto INDIETRO
|
|
if (idReportCaller != 0)
|
|
{
|
|
ck_idReportCaller = new HttpCookie("idReportCaller");
|
|
ck_idReportCaller.Value = idReportCaller.ToString();
|
|
Response.Cookies.Add(ck_idReportCaller);
|
|
}
|
|
//}
|
|
|
|
if (codiceRete == null || codiceRete == "")
|
|
{
|
|
//lettura cookie..(e' gia' stato scritto altrove)
|
|
HttpCookie ck_codiceRete = new HttpCookie("codiceRete");
|
|
ck_codiceRete = System.Web.HttpContext.Current.Request.Cookies["codiceRete"];
|
|
if (ck_codiceRete != null)
|
|
{
|
|
codiceRete = ck_codiceRete.Value.ToString();
|
|
}
|
|
}
|
|
|
|
if (codicePB == null || codicePB == "")
|
|
{
|
|
//lettura cookie..(e' gia' stato scritto altrove)
|
|
HttpCookie ck_codicePB = new HttpCookie("codicePB");
|
|
ck_codicePB = System.Web.HttpContext.Current.Request.Cookies["codicePB"];
|
|
if (ck_codicePB != null)
|
|
{
|
|
codicePB = ck_codicePB.Value.ToString();
|
|
}
|
|
}
|
|
|
|
codiceFiscale = Request.QueryString.Get("codiceFiscale");
|
|
|
|
if (codiceFiscale == null || codiceFiscale == "")
|
|
{
|
|
//lettura cookie..(e' gia' stato scritto altrove)
|
|
HttpCookie ck_codiceFiscale = new HttpCookie("codiceFiscale");
|
|
ck_codiceFiscale = System.Web.HttpContext.Current.Request.Cookies["codiceFiscale"];
|
|
if (ck_codiceFiscale != null)
|
|
{
|
|
codiceFiscale = ck_codiceFiscale.Value.ToString();
|
|
}
|
|
}
|
|
|
|
LabelData.Text = DateTime.Now.ToShortDateString();
|
|
LabelOra.Text = DateTime.Now.ToLongTimeString();
|
|
|
|
if (tipologiaReport == null || tipologiaReport == "")
|
|
{
|
|
//lettura cookie..
|
|
ck_tipologiaReport = new HttpCookie("tipologiaReport");
|
|
ck_tipologiaReport = System.Web.HttpContext.Current.Request.Cookies["tipologiaReport"];
|
|
if (ck_tipologiaReport != null)
|
|
{
|
|
tipologiaReport = ck_tipologiaReport.Value;
|
|
}
|
|
|
|
}
|
|
|
|
this.LabelReport.Text = tipologiaReport;
|
|
|
|
if (idReportCaller == 0)
|
|
{
|
|
//lettura cookie..
|
|
ck_idReportCaller = new HttpCookie("idReportCaller");
|
|
ck_idReportCaller = System.Web.HttpContext.Current.Request.Cookies["idReportCaller"];
|
|
if (ck_idReportCaller != null)
|
|
{
|
|
idReportCaller = Convert.ToInt32(ck_idReportCaller.Value.ToString());
|
|
}
|
|
}
|
|
|
|
if (identificativo == 0)
|
|
{
|
|
//lettura cookie..(e' gia' stato scritto in diagnosiGenerator.aspx)
|
|
HttpCookie ck_identificativo = new HttpCookie("identificativo");
|
|
ck_identificativo = System.Web.HttpContext.Current.Request.Cookies["identificativo"];
|
|
if (ck_identificativo != null)
|
|
{
|
|
identificativo = Convert.ToInt32(ck_identificativo.Value.ToString());
|
|
}
|
|
}
|
|
|
|
if (IsPostBack)
|
|
{
|
|
if (Request.QueryString.Get("rifPianificazione") != null)
|
|
rifPianificazione = Convert.ToInt16(Request.QueryString.Get("rifPianificazione"));
|
|
}
|
|
}
|
|
//====================================================
|
|
protected void btn_Salva_Click(object sender, EventArgs e)
|
|
{
|
|
bool rc = updateNoteIntoDB();
|
|
if (!rc)
|
|
{
|
|
int tpReport = 0;
|
|
|
|
switch (tipologiaReport) //tipologia report "con cui sono stato invocato"
|
|
{
|
|
case "DIAGNOSI":
|
|
tpReport = 1;
|
|
break;
|
|
case "PIANIFICAZIONE":
|
|
tpReport = 2;
|
|
break;
|
|
case "PROPOSTA":
|
|
tpReport = 3;
|
|
break;
|
|
case "MONITORAGGIO":
|
|
tpReport = 4;
|
|
break;
|
|
}
|
|
|
|
|
|
//Response.Redirect("archivioDocumenti.aspx?codicePB=" + codicePB + "&codiceFiscale=" + codiceFiscale + "&codiceRete=" + codiceRete + "&token=" + token + "&checkPrivacy=" + checkPrivacy);
|
|
Response.Redirect("archivioDocumenti.aspx?codPB=" + codicePB + "&codCliente=" + codiceFiscale + "&tipoRete=" + codiceRete + "&token=" + token + "&checkPrivacy=" + checkPrivacy + "&tpReport=" + tpReport);
|
|
}
|
|
else
|
|
{
|
|
this.lbl_errors.Text = "Attenzione. Errore nel salvataggio delle note a corredo del documento.";
|
|
}
|
|
}
|
|
//======================================================
|
|
private bool updateNoteIntoDB()
|
|
{
|
|
List<Parametro> parametri = new List<Parametro>();
|
|
Parametro parametro = new Parametro();
|
|
parametro.ParameterName = "identificativo";
|
|
parametro.Value = identificativo;
|
|
parametro.DbType = DbType.Int32;
|
|
parametri.Add(parametro);
|
|
|
|
parametro = new Parametro();
|
|
parametro.ParameterName = "note";
|
|
parametro.Value = this.lbl_message.Text;
|
|
parametro.DbType = DbType.String;
|
|
parametri.Add(parametro);
|
|
|
|
int rc = DataAccess.ExecuteNonQueryStoredProcedure(DBProvider.SqlServer, "sp_updateNoteIntoReportPerClienteDati", parametri);
|
|
|
|
return false;
|
|
}
|
|
//====================================================
|
|
protected void btn_Indietro_Click(object sender, EventArgs e)
|
|
{
|
|
switch (tipologiaReport) //tipologia report "con cui sono stato invocato"
|
|
{
|
|
case "DIAGNOSI":
|
|
Response.Redirect("reportDiagnosi.aspx?codCliente=" + codiceFiscale + "&tipoRete=" + codiceRete + "&codPB=" + codicePB + "&token=" + token + "&ambiente=" + ambiente + "&lastReportPrinted=" + idReportCaller + "&nomeInizialeReport=" + nomeInizialeReport + "&descrizioneInizialeReport=" + descrizioneInizialeReport + "&baseCompleto=" + baseCompleto + "&checkPrivacy=" + checkPrivacy);
|
|
break;
|
|
case "PIANIFICAZIONE":
|
|
Response.Redirect("reportPianificazione.aspx?codCliente=" + codiceFiscale + "&tipoRete=" + codiceRete + "&codPB=" + codicePB + "&token=" + token + "&ambiente=" + ambiente + "&lastReportPrinted=" + idReportCaller + "&nomeInizialeReport=" + nomeInizialeReport + "&descrizioneInizialeReport=" + descrizioneInizialeReport + "&baseCompleto=" + baseCompleto + "&checkPrivacy=" + checkPrivacy);
|
|
break;
|
|
case "PROPOSTA":
|
|
Response.Redirect("reportProposta_NEW.aspx?codCliente=" + codiceFiscale + "&tipoRete=" + codiceRete + "&codPB=" + codicePB + "&token=" + token + "&ambiente=" + ambiente + "&lastReportPrinted=" + idReportCaller + "&nomeInizialeReport=" + nomeInizialeReport + "&descrizioneInizialeReport=" + descrizioneInizialeReport + "&baseCompleto=" + baseCompleto + "&checkPrivacy=" + checkPrivacy);
|
|
break;
|
|
case "MONITORAGGIO":
|
|
Response.Redirect("reportMonitoraggio_Alberatura.aspx?codCliente=" + codiceFiscale + "&tipoRete=" + codiceRete + "&codPB=" + codicePB + "&token=" + token + "&ambiente=" + ambiente + "&lastReportPrinted=" + idReportCaller + "&nomeInizialeReport=" + nomeInizialeReport + "&descrizioneInizialeReport=" + descrizioneInizialeReport + "&baseCompleto=" + baseCompleto + "&checkPrivacy=" + checkPrivacy + "&rifPianificazione=" + rifPianificazione);
|
|
break;
|
|
case "RISCHIO":
|
|
Response.Redirect("reportRischioNew.aspx?codCliente=" + codiceFiscale + "&tipoRete=" + codiceRete + "&codPB=" + codicePB + "&token=" + token + "&ambiente=" + ambiente + "&lastReportPrinted=" + idReportCaller + "&nomeInizialeReport=" + nomeInizialeReport + "&descrizioneInizialeReport=" + descrizioneInizialeReport + "&baseCompleto=" + baseCompleto + "&checkPrivacy=" + checkPrivacy);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|