diff --git a/WebSites/WebGIM/App_Code/DS_utility.xsd b/WebSites/WebGIM/App_Code/DS_utility.xsd index 3e13752..390b2fb 100644 --- a/WebSites/WebGIM/App_Code/DS_utility.xsd +++ b/WebSites/WebGIM/App_Code/DS_utility.xsd @@ -257,8 +257,8 @@ WHERE (conditio = @conditio) - - SELECT numIntMtz, richiesta, codImpianto, nomeImpianto, codMacchina, nomeMacchina, descrizione, inizioIntervento, fineIntervento, descrizioneIntervento, descrCausale, minErogati, durataMtz, durataOff, guasto FROM dbo.v_elencoIntervFilt + + SELECT * FROM dbo.v_elencoIntervFilt @@ -280,18 +280,31 @@ WHERE (conditio = @conditio) + + + + SELECT codImpianto, codMacchina, descrCausale, descrizione, descrizioneIntervento, durataMtz, durataOff, fineIntervento, guasto, idxStato, inizioIntervento, minErogati, nomeImpianto, nomeMacchina, numIntMtz, richiesta FROM v_elencoIntervFilt WHERE (richiesta BETWEEN @inizio AND @fine) + + + + + + + + - SELECT numIntMtz, richiesta, codImpianto, nomeImpianto, codMacchina, nomeMacchina, descrizione, inizioIntervento, fineIntervento, descrizioneIntervento, descrCausale, - minErogati, durataMtz, durataOff, guasto + SELECT codImpianto, codMacchina, descrCausale, descrizione, descrizioneIntervento, durataMtz, durataOff, fineIntervento, guasto, idxStato, inizioIntervento, minErogati, + nomeImpianto, nomeMacchina, numIntMtz, richiesta FROM v_elencoIntervFilt -WHERE (richiesta BETWEEN @inizio AND @fine) +WHERE (richiesta BETWEEN @inizio AND @fine) AND (CHARINDEX(CAST(idxStato AS varchar), @idxStatiReq) > 0) + @@ -300,7 +313,7 @@ WHERE (richiesta BETWEEN @inizio AND @fine) - + dbo.sp_elencoIntMTBF_MTTR @@ -308,6 +321,7 @@ WHERE (richiesta BETWEEN @inizio AND @fine) + @@ -335,8 +349,8 @@ WHERE (richiesta BETWEEN @inizio AND @fine) - - + + @@ -349,23 +363,23 @@ WHERE (richiesta BETWEEN @inizio AND @fine) - - + + - + - - + + @@ -378,8 +392,8 @@ WHERE (richiesta BETWEEN @inizio AND @fine) - - + + @@ -392,23 +406,23 @@ WHERE (richiesta BETWEEN @inizio AND @fine) - - + + - + - - + + @@ -419,32 +433,12 @@ WHERE (richiesta BETWEEN @inizio AND @fine) - - - - - - - - - - - - - - - - - - - - - + @@ -458,11 +452,31 @@ WHERE (richiesta BETWEEN @inizio AND @fine) + + + + + + + + + + + + + + + + + + + + - - + + @@ -475,21 +489,21 @@ WHERE (richiesta BETWEEN @inizio AND @fine) - + - + - + @@ -502,6 +516,66 @@ WHERE (richiesta BETWEEN @inizio AND @fine) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -516,13 +590,6 @@ WHERE (richiesta BETWEEN @inizio AND @fine) - - - - - - - @@ -537,117 +604,65 @@ WHERE (richiesta BETWEEN @inizio AND @fine) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + - + - - - - + + + + + - + - - - - + + + + - + - + - + diff --git a/WebSites/WebGIM/App_Code/DS_utility.xss b/WebSites/WebGIM/App_Code/DS_utility.xss index 9eeafc4..4fbc12e 100644 --- a/WebSites/WebGIM/App_Code/DS_utility.xss +++ b/WebSites/WebGIM/App_Code/DS_utility.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -17,8 +17,8 @@ - - + + \ No newline at end of file diff --git a/WebSites/WebGIM/App_Code/reportExporter.cs b/WebSites/WebGIM/App_Code/reportExporter.cs index b535d5a..95ef098 100644 --- a/WebSites/WebGIM/App_Code/reportExporter.cs +++ b/WebSites/WebGIM/App_Code/reportExporter.cs @@ -83,16 +83,16 @@ public class reportExporter /// report ammessi: ElencoInterventi / MTBF_MTTR /// oggetto che contiene data inizio e data fine dell'analisi richiesta per il report /// tabella dati - private DataTable caricaDati(reportRichiesto tipoReport, intervalloDate periodoAnalizzato) + private DataTable caricaDati(reportRichiesto tipoReport, intervalloDate periodoAnalizzato, string idxStatiReq) { DataTable tab = new DataTable(); switch (tipoReport) { case reportRichiesto.ElencoInterventi: - tab = (DataTable)TA_app.obj.taElencoIntFilt.getByIntervDate(periodoAnalizzato.inizio, periodoAnalizzato.fine); + tab = (DataTable)TA_app.obj.taElencoIntFilt.getByIntervDateElStati(periodoAnalizzato.inizio, periodoAnalizzato.fine, idxStatiReq); break; case reportRichiesto.MTBF_MTTR: - tab = (DataTable)TA_app.obj.taElenco_MTBF_MTTR.GetData(periodoAnalizzato.inizio, periodoAnalizzato.fine); + tab = (DataTable)TA_app.obj.taElenco_MTBF_MTTR.GetData(periodoAnalizzato.inizio, periodoAnalizzato.fine, idxStatiReq); break; default: break; @@ -140,7 +140,7 @@ public class reportExporter string deviceInfo = ""; switch (tipoReport) { - case reportRichiesto.RichiestaIntervento: + case reportRichiesto.RichiestaIntervento: report.ReportPath = @".\RichiestaIntervento.rdlc"; report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, parametro))); // OCCHIO!!! va messa sorgente dati CORRETTA deviceInfo = "" + @@ -163,7 +163,7 @@ public class reportExporter /// /// report ammessi: ElencoInterventi / MTBF_MTTR /// oggetto che contiene data inizio e data fine dell'analisi richiesta per il report - public void popolaPdfStream(reportRichiesto tipoReport, intervalloDate periodoAnalizzato) + public void popolaPdfStream(reportRichiesto tipoReport, intervalloDate periodoAnalizzato, string statiRichiesti) { LocalReport report = new LocalReport(); string deviceInfo = ""; @@ -171,7 +171,7 @@ public class reportExporter { case reportRichiesto.ElencoInterventi: report.ReportPath = @".\ReportInterventi.rdlc"; - report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato))); + report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato, statiRichiesti))); deviceInfo = "" + " PDF" + " 21cm" + @@ -184,7 +184,7 @@ public class reportExporter break; case reportRichiesto.MTBF_MTTR: report.ReportPath = @".\Report_MTBF_MTTR.rdlc"; - report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato))); + report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato, statiRichiesti))); deviceInfo = "" + " PDF" + " 21cm" + diff --git a/WebSites/WebGIM/App_Code/reportPrinter.cs b/WebSites/WebGIM/App_Code/reportPrinter.cs index 19ab1d3..456875b 100644 --- a/WebSites/WebGIM/App_Code/reportPrinter.cs +++ b/WebSites/WebGIM/App_Code/reportPrinter.cs @@ -122,16 +122,16 @@ public class reportPrinter /// report ammessi: ElencoInterventi / MTBF_MTTR /// oggetto che contiene data inizio e data fine dell'analisi richiesta per il report /// tabella dati - private DataTable caricaDati(reportRichiesto tipoReport, intervalloDate periodoAnalizzato) + private DataTable caricaDati(reportRichiesto tipoReport, intervalloDate periodoAnalizzato, string idxStatiReq) { DataTable tab = new DataTable(); switch (tipoReport) { case reportRichiesto.ElencoInterventi: - tab = (DataTable)TA_app.obj.taElencoIntFilt.getByIntervDate(periodoAnalizzato.inizio, periodoAnalizzato.fine); + tab = (DataTable)TA_app.obj.taElencoIntFilt.getByIntervDateElStati(periodoAnalizzato.inizio, periodoAnalizzato.fine, idxStatiReq); break; case reportRichiesto.MTBF_MTTR: - tab = (DataTable)TA_app.obj.taElenco_MTBF_MTTR.GetData(periodoAnalizzato.inizio, periodoAnalizzato.fine); + tab = (DataTable)TA_app.obj.taElenco_MTBF_MTTR.GetData(periodoAnalizzato.inizio, periodoAnalizzato.fine, idxStatiReq); break; default: break; @@ -187,7 +187,7 @@ public class reportPrinter /// report ammessi: ElencoInterventi / MTBF_MTTR /// nome completo stampante (rispetto al server) /// oggetto che contiene data inizio e data fine dell'analisi richiesta per il report - public void printReport(reportRichiesto tipoReport, string printerName, intervalloDate periodoAnalizzato) + public void printReport(reportRichiesto tipoReport, string printerName, intervalloDate periodoAnalizzato, string statiRichiesti) { LocalReport report = new LocalReport(); string deviceInfo = ""; @@ -195,7 +195,7 @@ public class reportPrinter { case reportRichiesto.ElencoInterventi: report.ReportPath = @".\ReportInterventi.rdlc"; - report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato))); + report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato, statiRichiesti))); deviceInfo = "" + " EMF" + " 21cm" + @@ -208,7 +208,7 @@ public class reportPrinter break; case reportRichiesto.MTBF_MTTR: report.ReportPath = @".\Report_MTBF_MTTR.rdlc"; - report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato))); + report.DataSources.Add(new ReportDataSource("WebGim", caricaDati(tipoReport, periodoAnalizzato, statiRichiesti))); deviceInfo = "" + " EMF" + " 21cm" + diff --git a/WebSites/WebGIM/ExportPdf.aspx.cs b/WebSites/WebGIM/ExportPdf.aspx.cs index 97a62f3..e106868 100644 --- a/WebSites/WebGIM/ExportPdf.aspx.cs +++ b/WebSites/WebGIM/ExportPdf.aspx.cs @@ -16,6 +16,7 @@ public partial class ExportPdf : System.Web.UI.Page periodo.inizio = Convert.ToDateTime(Request.QueryString["inizio"]); periodo.fine = Convert.ToDateTime(Request.QueryString["fine"]); reportRichiesto tipo = (reportRichiesto)Convert.ToInt32(Request.QueryString["tipo"]); + string idxStatiReq = Request.QueryString["idxStatiReq"]; // eseguo export reportExporter re = new reportExporter(); // in base al tipo passo un metodo con idx o con parametro Intervallo analisi... @@ -23,7 +24,7 @@ public partial class ExportPdf : System.Web.UI.Page { case reportRichiesto.ElencoInterventi: reportName="elenco_interventi"; - re.popolaPdfStream(tipo, periodo); + re.popolaPdfStream(tipo, periodo, idxStatiReq); break; case reportRichiesto.ElencoMacchine: reportName="elenco_macchine"; @@ -31,7 +32,7 @@ public partial class ExportPdf : System.Web.UI.Page break; case reportRichiesto.MTBF_MTTR: reportName = "MTBF_MTTR"; - re.popolaPdfStream(tipo, periodo); + re.popolaPdfStream(tipo, periodo, idxStatiReq); break; case reportRichiesto.RichiestaIntervento: reportName="richiesta"; diff --git a/WebSites/WebGIM/mod_menuBottom.ascx b/WebSites/WebGIM/mod_menuBottom.ascx index afdffe1..8fb63cd 100644 --- a/WebSites/WebGIM/mod_menuBottom.ascx +++ b/WebSites/WebGIM/mod_menuBottom.ascx @@ -1,4 +1,4 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_menuBottom.ascx.cs" Inherits="mod_menuBottom" %> -84 - +86 - diff --git a/WebSites/WebGIM/mod_reportInterventi.ascx b/WebSites/WebGIM/mod_reportInterventi.ascx index 07a562a..1d9d6ab 100644 --- a/WebSites/WebGIM/mod_reportInterventi.ascx +++ b/WebSites/WebGIM/mod_reportInterventi.ascx @@ -4,9 +4,18 @@ <%@ Register Src="mod_periodoAnalisi.ascx" TagName="mod_periodoAnalisi" TagPrefix="uc1" %>
- ...selettore tipo interventi (tutti/completati-annullati/stato... con checkbox multiplo?!?) +
+ + + +
-
+
@@ -31,14 +40,10 @@ - - diff --git a/WebSites/WebGIM/mod_reportInterventi.ascx.cs b/WebSites/WebGIM/mod_reportInterventi.ascx.cs index 3e64118..532e90f 100644 --- a/WebSites/WebGIM/mod_reportInterventi.ascx.cs +++ b/WebSites/WebGIM/mod_reportInterventi.ascx.cs @@ -29,25 +29,58 @@ public partial class mod_reportInterventi : System.Web.UI.UserControl { setDefaultValues(); } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } private void traduciObj() { - // + lblMostraStati.Text = traduci("lblMostraStati"); } private void setDefaultValues() { + // valori degli hyperlink hlElencoInterventi_Pdf.NavigateUrl = formattaUrl(reportRichiesto.ElencoInterventi, mod_periodoAnalisi1.intervalloAnalisi); hlMTBF_MTTR_Pdf.NavigateUrl = formattaUrl(reportRichiesto.MTBF_MTTR, mod_periodoAnalisi1.intervalloAnalisi); + // seleziona tutti gli stati possibili + } private string formattaUrl(reportRichiesto tipo, intervalloDate periodo) { - return String.Format("~/ExportPdf.aspx?tipo={0}&inizio={1}&fine={2}", Convert.ToInt32(tipo), periodo.inizio, periodo.fine); + string idxStatiReq = ""; + // popolo la stringa degli stati richiesti da elenco selezionati... + foreach (ListItem item in chkStatoInt.Items) + { + if (item.Selected) + { + idxStatiReq += string.Format(",{0}",item.Value); + } + } + // levo eventuale "," iniziale o se vuoto metto tutti.. + if (idxStatiReq == "") + { + idxStatiReq = "1,2,3,4"; + } + else + { + idxStatiReq = idxStatiReq.Substring(1, idxStatiReq.Length - 1); + } + return String.Format("~/ExportPdf.aspx?tipo={0}&inizio={1}&fine={2}&idxStatiReq={3}", Convert.ToInt32(tipo), periodo.inizio, periodo.fine, idxStatiReq); } - protected void btnInterventi_print_Click(object sender, EventArgs e) + protected void chkStatoInt_DataBound(object sender, EventArgs e) { - reportPrinter.obj.printReport(reportRichiesto.ElencoInterventi, memLayer.ML.confReadstring("stampanteRichiesteMtz"), mod_periodoAnalisi1.intervalloAnalisi); + foreach (ListItem item in ((ListBox)sender).Items) + { + item.Selected = true; + } } - protected void btnMtbfMttr_print_Click(object sender, EventArgs e) + protected void chkStatoInt_SelectedIndexChanged(object sender, EventArgs e) { - reportPrinter.obj.printReport(reportRichiesto.MTBF_MTTR, memLayer.ML.confReadstring("stampanteRichiesteMtz"), mod_periodoAnalisi1.intervalloAnalisi); + setDefaultValues(); } }