2025-06-03 15:11:16 +02:00

87 lines
3.8 KiB
C#

using System;
using System.Data;
using System.Configuration;
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.Collections;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Text;
using PDFGenerator.Presentation.Section.Tables;
using PDFGenerator.BusinessLayer.DataSection;
using PDFGenerator.BusinessLayer;
using System.Threading;
using System.Globalization;
using NLog;
namespace PDFGenerator.Presentation.Section
{
public class S138:ISezione
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
public void writeSezione(DataThread dataThread)
{
dataThread.SETDATA();
DocumentPDF document = dataThread.DocumentPDF;
DataSetS138 set = (DataSetS138)dataThread.Data.DatiSezione;
DatiTabella datiTabella = new DatiTabella(set.Proventi);
document.setSezTitolo(dataThread.SezioneReport.Titolo);
document.setChapterHeader(dataThread.SezioneReport.TestoIntroduttivo.Replace("/$Banca$/", dataThread.NomeRete).Replace("Sanpaolo Invest", "Fideuram S.p.A., commercializzati tramite la rete di private banker Sanpaolo Invest"), 0, 520, 8);
#region TABLE PROVENTI
Tabella tabellaDati = new Tabella(document.getMargineLeft(), document.getLastPos());
tabellaDati.HeaderFont = 8;
tabellaDati.Header = true;
tabellaDati.Colonne.Add(new Colonna("DTRIFE", "Data", 100, TipoAllineamento.SINISTRA, false, 7, false));
tabellaDati.Colonne.Add(new Colonna("DESPROD", "Strumento", 222, TipoAllineamento.SINISTRA, false, 7, false));
tabellaDati.Colonne.Add(new Colonna("TIPMOV", "Tipo Movimento", 80, TipoAllineamento.SINISTRA, false, 7, false));
// FIX 20180828 Allineamento della tabella
//tabellaDati.Colonne.Add(new Colonna("IMPORTO", "Importo (€)", 100, TipoAllineamento.DESTRA, false, 7, false));
tabellaDati.Colonne.Add(new Colonna("IMPORTO", "Importo (€)", 110, TipoAllineamento.DESTRA, false, 7, false));
//--FIX 20180828 Allineamento della tabella
tabellaDati.Draw(datiTabella, document);
#endregion
document.setLastPos(tabellaDati.AltezzaTabella);
#region TOTALE
DatiTabella totalitab = new DatiTabella();
totalitab.table = set.Totale;
Tabella tabellaTotale = new Tabella(document.getMargineLeft(), document.getLastPos());
tabellaTotale.HeaderFont = 8;
tabellaTotale.SaltoPagina = false;
tabellaTotale.Header = false;
// FIX 20180828 Allineamento della tabella
//tabellaTotale.Colonne.Add(new Colonna("Descrizione", "", 380, TipoAllineamento.SINISTRA, true, 8, true));
//tabellaTotale.Colonne.Add(new Colonna("Totale", "", 132, TipoAllineamento.DESTRA, true, 8, true));
tabellaTotale.Colonne.Add(new Colonna("Descrizione", "", 402, TipoAllineamento.SINISTRA, true, 8, true));
tabellaTotale.Colonne.Add(new Colonna("Totale", "", 110, TipoAllineamento.DESTRA, true, 8, true));
//--FIX 20180828 Allineamento della tabella
tabellaTotale.Draw(totalitab, document);
#endregion
document.setLastPos(tabellaTotale.AltezzaTabella);
/*** 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 = dateOffsetValueFin - dateOffsetValueIni;
//logger.Trace("S138 " + tDiff);
/**************************************************************/
}
}
}