using System; using System.Collections.Generic; using System.Linq; using Consulenza.ReportWriter.Business; using Consulenza.ReportWriter.Business.OBJ_PDF; using System.Data; using Consulenza.ReportWriter.Business.Entity; namespace Consulenza.ReportWriter.Manager.Section.Immobiliare.Monitoraggio { /// /// Dettaglio immobili con anomalie catastali (id 40) /// public class S8 : Entity.Section { public S8(EnvironmentFacade environmentFacade, int idSection) : base(environmentFacade, idSection) { try { Draw(); } catch (Exception ex) { SectionLogger.Write("S8", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment); } } /// /// Scheda2. Patrimonio immobiliare –Sintesi (distribuzione del patrimonio complessivo del cliente diviso per tipologia e cointestatari) /// protected override sealed void Draw() { var _text = GetTextSet(); List indiciPagina = _text.Tables[0].AsEnumerable() .Select(z => z.Field("idREP_IMM_MON_Pagina")).Distinct().ToList(); foreach (var indice in indiciPagina) { var data = _text.Tables[0].AsEnumerable().Where(x => x.Field("idREP_IMM_MON_Pagina") == indice).ToList(); string paragrafoSx = ""; string paragrafoDx = ""; string labelSx = ""; string labelDx = ""; string testo = ""; foreach (var row in data) { testo = ""; labelSx = ""; labelDx = ""; testo = "" + row.Field("titolo") + "

"; int i = 1; for (i = 1; i <= 15; i++) testo += row.Field("testo" + i) != null ? "

" + row.Field("testo" + i) + "


" : ""; // SPLIT PARAGRAFO if (testo.Contains("SPLITPARAGRAPH")) { var listaSplit = StringExtensions.SplitAtOccurence(testo, "SPLITPARAGRAPH", 1); labelSx = listaSplit[0] + "

"; /********************* Modifica per parti statiche Semestrale 10/2020 - Pino *****************************/ //labelDx += "

"; // Originale labelDx += "

"; /**********************************************************************************************************/ listaSplit.RemoveRange(0, 1); foreach (var stringa in listaSplit) labelDx += stringa; paragrafoSx += labelSx; paragrafoDx += labelDx; } else { if (row.Field("posizione").Equals("R")) paragrafoDx += testo; else paragrafoSx += testo; } // ORIGINALE //if (row.Field("posizione").Equals("R")) // paragrafoDx += testo; //else // paragrafoSx += testo; } /************************* Immobiliare 03/2021 eliminazione tag
- Pino **********************************************/ paragrafoSx = paragrafoSx.Replace("<br/>", "
"); paragrafoDx = paragrafoDx.Replace("<br/>", "
"); /*************************************************************************************************************************/ //var testoSx = new FormattedTextAreaPDF(paragrafoSx, 35, (600 / 2) + 45) { FontSize = 9, Y = 50, FontColor = ColorPDF.Immobiliare_Grigio_TestoStandard, AutoIncrementYWritable = false, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }; var testoSx = new FormattedTextAreaPDF(paragrafoSx, 35, (600 / 2) + 45) { FontSize = 9, Y = 60, FontColor = ColorPDF.Immobiliare_Grigio_TestoStandard, AutoIncrementYWritable = false, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }; var testoDx = new FormattedTextAreaPDF(paragrafoDx, 400, (600 / 2) + 45) { FontSize = 9, Y = 60, FontColor = ColorPDF.Immobiliare_Grigio_TestoStandard, AutoIncrementYWritable = false, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }; //var testoSx = new FormattedTextAreaPDF(paragrafoSx, 35, (600 / 2) + 45) { FontSize = 8, Y = 55, FontColor = ColorPDF.Immobiliare_Grigio_TestoStandard, AutoIncrementYWritable = false, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }; //var testoDx = new FormattedTextAreaPDF(paragrafoDx, 400, (600 / 2) + 45) { FontSize = 8, Y = 60, FontColor = ColorPDF.Immobiliare_Grigio_TestoStandard, AutoIncrementYWritable = false, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }; AddElement(testoSx); AddElement(testoDx); } } ///

/// Recupera i dati necessari alla Section restituendo un DataTable. /// /// protected override DataTable GetDataTable() { return null; } /// /// Recupera i dati necessari alla Section restituendo un DataSet. /// /// protected override DataSet GetDataSet() { return null; } /// /// Recupera i testi /// /// protected DataSet GetTextSet() { #region Definizione dei parametri var parametri = new List { new Parametro { Direction = ParameterDirection.Input, DbType = DbType.Int32, ParameterName = "IdReport", Value = EnvironmentFacade.ReportEnvironment.ReportId }, new Parametro { Direction = ParameterDirection.Input, DbType = DbType.Int32, ParameterName = "IdSezione", Value = IdSection } }; #endregion return DataAccess.ExecuteDataSetStoredProcedure(DBProvider.SqlServerReportModeler, "REP_Monitoraggio_Immobiliare_Testi_Paragrafi", parametri); } } }