89 lines
3.7 KiB
C#
89 lines
3.7 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Text;
|
||
using System.Data;
|
||
|
||
namespace PDFGenerator.BusinessLayer.DataSection
|
||
{
|
||
class DSS176EvoluzioneLineaProtettaMultiramo : IDataSection
|
||
{
|
||
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||
|
||
#region IDataSection Members
|
||
public DataSectionResult getDataSection(List<SessionStruct> tabelleSessione, string querySql, DataThread dataThread)
|
||
{
|
||
/*** TEST - Verifica Tempistica 09/11/2023 - Pino ****/
|
||
/*** Inserimento log per verifica tempistica della sezione ***/
|
||
//DateTimeOffset dateOffsetValueIni = DateTimeOffset.Parse(DateTime.Now.ToString("hh:mm:ss.ffff"));
|
||
/*************************************************************/
|
||
|
||
DataSectionResult dsr = new DataSectionResult();
|
||
|
||
querySql = "[C6martPeriodico].[PL_MP_S176EvoluzioneLineaProtettaMultiramo]";
|
||
//// Controllo presenza dati needarea/progetto vincolo S83
|
||
//DataTable dtDatiComuniPerformanceAreaS83 = SectionManager.GetDataSection("DatiComuniPerformanceAreaS83", datiMonitoraggio.DsParam);
|
||
|
||
// S176 Monitoraggio Investimento
|
||
DataTable dt = SectionManager.GetDataSection(tabelleSessione, querySql, dataThread);
|
||
DataSetS176 ds176 = new DataSetS176();
|
||
|
||
DataRow dr;
|
||
DateTime data;
|
||
|
||
#region Prodotto
|
||
|
||
if (dt.Rows.Count > 0)
|
||
{
|
||
DataRow drProdotto = ds176.Prodotto.NewRow();
|
||
drProdotto["DescrizioneProdotto"] = dt.Rows[0]["DescrizioneProdotto"].ToString();
|
||
drProdotto["Contratto"] = dt.Rows[0]["Contratto"].ToString();
|
||
data = Convert.ToDateTime(dt.Rows[0]["DataSottoscrizione"]);
|
||
drProdotto["DataSottoscrizione"] = data.ToShortDateString();
|
||
ds176.Prodotto.Rows.Add(drProdotto);
|
||
#endregion
|
||
|
||
foreach (DataRow row in dt.Rows)
|
||
{
|
||
|
||
dr = ds176.DatiGrafico.NewRow();
|
||
|
||
dr["Controvalore"] = row["Controvalore"];
|
||
dr["ControvaloreProtetto"] = row["ControvaloreProtetto"];
|
||
dr["ControvaloreMonitorato"] = row["ControvaloreMonitorato"];
|
||
data = Convert.ToDateTime(row["DataRiferimento"]);
|
||
dr["DataRiferimento"] = data.ToShortDateString();
|
||
data = Convert.ToDateTime(row["DataTrim"]);
|
||
dr["DataTrim"] = data.ToShortDateString();
|
||
ds176.DatiGrafico.Rows.Add(dr);
|
||
}
|
||
|
||
}
|
||
|
||
dsr.DatiSezione = ds176;
|
||
//Se non sono passati almeno 5 giri di calcolo del rendimento, l’oggetto non deve essere mostrato
|
||
|
||
DataView view = new DataView(ds176.DatiGrafico);
|
||
DataTable dtFilter = view.ToTable(true, "DataRiferimento");
|
||
int esito = 0;
|
||
|
||
//if (dtFilter.Rows.Count < 5)
|
||
// esito = 0;
|
||
//else
|
||
esito = ds176.Prodotto.Rows.Count;
|
||
|
||
dsr.Esito = esito;
|
||
|
||
/*** TEST - Verifica Tempistica 09/11/2023 - Pino ****/
|
||
/*** Inserimento log per verifica tempistica della sezione ***/
|
||
//DateTimeOffset dateOffsetValueFin = DateTimeOffset.Parse(DateTime.Now.ToString("hh:mm:ss.ffff"));
|
||
//var tDiff = string.Concat("Tempo di Esecuzione: {0} ", (dateOffsetValueFin - dateOffsetValueIni).ToString());
|
||
//logger.Trace("DSS176EvoluzioneLineaProtettaMultiramo " + tDiff);
|
||
/*************************************************************/
|
||
|
||
return dsr;
|
||
}
|
||
#endregion
|
||
|
||
}
|
||
}
|