88 lines
3.4 KiB
C#
88 lines
3.4 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 PDFGenerator.BusinessLayer.DataSection;
|
|
using PDFGenerator.BusinessLayer;
|
|
using System.Collections.Generic;
|
|
|
|
namespace PDFGenerator.BusinessLayer.DataSection
|
|
{
|
|
class DSS138Proventi : IDataSection
|
|
{
|
|
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
public DSS138Proventi() {
|
|
}
|
|
|
|
#region IDataSection Members
|
|
public DataSectionResult getDataSection(List<SessionStruct> tabelleSessione, string querySql, DataThread dataThread)
|
|
{
|
|
|
|
try
|
|
{
|
|
/*** 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"));
|
|
/*************************************************************/
|
|
|
|
FormatNum num = new FormatNum();
|
|
DataSectionResult dsr = new DataSectionResult();
|
|
if (dataThread.NoMonitoraggio)
|
|
return dsr;
|
|
|
|
DataTable dt = SectionManager.GetDataSection(tabelleSessione, querySql, dataThread);
|
|
|
|
DataSetS138 ds138 = new DataSetS138();
|
|
|
|
decimal tot = 0;
|
|
for (int r = 0; r < dt.Rows.Count; r++)
|
|
{
|
|
if (dt.Rows[r]["DESPROD"] == null || dt.Rows[r]["DESPROD"].ToString().Equals(""))
|
|
throw new Exception("DescrizioneProdotto is Null");
|
|
|
|
DataRow dr = ds138.Proventi.NewRow();
|
|
dr["DTRIFE"] = dt.Rows[r]["DTRIFE"].ToString().Substring(0,10);
|
|
dr["DESPROD"] = dt.Rows[r]["DESPROD"].ToString();
|
|
dr["TIPMOV"] = dt.Rows[r]["TIPMOV"].ToString();
|
|
dr["IMPORTO"] = num.ConvertNum(dt.Rows[r]["IMPORTO"].ToString());
|
|
tot += decimal.Parse(dt.Rows[r]["IMPORTO"].ToString());
|
|
ds138.Proventi.Rows.Add(dr);
|
|
|
|
}
|
|
|
|
DataRow drTotal = ds138.Totale.NewRow();
|
|
drTotal["Descrizione"] = "Totale";
|
|
drTotal["Totale"] = tot;
|
|
ds138.Totale.Rows.Add(drTotal);
|
|
|
|
|
|
dsr.DatiSezione = ds138;
|
|
dsr.Esito = ds138.Proventi.Rows.Count;
|
|
|
|
/*** 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("DSS138Proventi " + tDiff);
|
|
/*************************************************************/
|
|
|
|
return dsr;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logger.Error(ex);
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|