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 DSS184TabellaCoerenzaESG : IDataSection { private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); //private int _experince; //public int Experince //{ // set // { // _experince = value; // } // get // { // return _experince; // } //} public DSS184TabellaCoerenzaESG() { // // TODO: Add constructor logic here // } #region IDataSection Members /// /// Implement the getDataSection function of the interface IDataSection. /// /// /// Sql Statment to be executed to return the Profile Risk of the certain customer in a certain network /// /// Data Table to be shown in the report public DataSectionResult getDataSection(List tabelleSessione, string querySql, DataThread dataThread) { try { FormatNum num = new FormatNum(); DataSectionResult dsr = new DataSectionResult(); DataSetS184 ds184 = new DataSetS184(); // La sezione va stampata se non si verificano i seguenti 3 casi: // Copertura = 0 //string preQuerySql = dataThread.Periodico?"[C6MartPeriodico].[PL_D_S178CasiParticolari]": "[C6Mart].[PL_D_S178CasiParticolari]"; //DataTable dtTestoKO = SectionManager.GetDataSection(tabelleSessione, preQuerySql, dataThread); //if (dtTestoKO.Rows.Count == 0) { DataTable dt = SectionManager.GetDataSection(tabelleSessione, querySql, dataThread); DataRow drESG; if (dt.Rows.Count > 0) { foreach (DataRow r in dt.Rows) { drESG = ds184.TabellaCoerenzaESG.NewRow(); //drESG["Rete"] = r["Rete"].ToString(); //drESG["Codice_Fiscale"] = string.IsNullOrEmpty(r["Codice_Fiscale"].ToString()) ? "-" : r["Codice_Fiscale"].ToString(); drESG["pesoSostESG"] = r["pesoSostESG"] == DBNull.Value ? "-" : $"{r["pesoSostESG"]}%"; drESG["percESG"] = r["percESG"] == DBNull.Value ? "-" : $"{r["percESG"]}"; drESG["Coerenza"] = r["Coerenza"] == DBNull.Value ? "-" : (r["Coerenza"].ToString().Equals("s",StringComparison.OrdinalIgnoreCase) ? "COERENTE" : "NON COERENTE"); ds184.TabellaCoerenzaESG.Rows.Add(drESG); } } } dsr.DatiSezione = ds184; int esito = 0; //if (dtFilter.Rows.Count < 5) // esito = 0; //else esito = ds184.TabellaCoerenzaESG.Rows.Count; dsr.Esito = esito; return dsr; } catch (Exception ex) { try { logger.Error(String.Concat(ex.Message, " ", dataThread.CodiceFiscale)); } catch { } throw ex; } } #endregion } }