using Consulenza.ReportWriter.Business;
using Consulenza.ReportCommon;
using Consulenza.ReportWriter.Business.OBJ_PDF;
using System.Collections.Generic;
using Consulenza.ReportWriter.Business.Entity;

namespace Consulenza.ReportWriter.Manager.Section.Unica.Nucleo
{
    /// <summary>
    /// Scheda 75 - Avvertenze idSezione = 118
    /// </summary>
    public class S75 : Unica.S75
    {
        public S75(EnvironmentFacade environmentFacade, int idSection)
            : base(environmentFacade, idSection)
        {
        }
        protected override void Draw()
        {
            var testi = GetText();
            var listaOggettiDaRipetere = new List<ObjectPDF>();
            listaOggettiDaRipetere.Add(new SpacePDF(20));
            AddElement(new RepeaterPDF(listaOggettiDaRipetere));

            AddElement(new SpacePDF(20));
            if (!datiSeiUnico.flagNucleoContrattualizzato()) { 
                AddElement(new FormattedTextAreaPDF(showBanca(testi.Rows[0]["Testo1"].ToString().Replace("$Banca$", "$/Banca/$")), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
                AddElement(new SpacePDF(15));
            }
            AddElement(new FormattedTextAreaPDF(showBanca(testi.Rows[0]["Testo2"].ToString().Replace("$Banca$", "$/Banca/$")), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
            AddElement(new SpacePDF(15));
            AddElement(new FormattedTextAreaPDF(showBanca(testi.Rows[0]["Testo3"].ToString().Replace("$Banca$", "$/Banca/$")), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });

            /******************** Aggiunta testo statico nella Avvertenze 23-02-2021 -- Pino *******************/
            //var stringheElencoPuntato = new List<string> { showBanca(testi.Rows[0]["Testo4"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo5"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo6"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo7"].ToString()), showBanca(testi.Rows[0]["Testo8"].ToString()) };   //Originale
            var stringheElencoPuntato = new List<string> { showBanca(testi.Rows[0]["Testo4"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo5"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo18"].ToString()), showBanca(testi.Rows[0]["Testo6"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo7"].ToString()), showBanca(testi.Rows[0]["Testo8"].ToString()) };
            /*************************************************************************************************************************************/

            var elencoPuntato = new UnorderedListPDF(EnvironmentFacade.RendererFacade.XLeftLimit, stringheElencoPuntato) { FontSize = 7 };
            AddElement(new SpacePDF(6));
            AddElement(elencoPuntato);

            AddElement(new SpacePDF(10));
            AddElement(new FormattedTextAreaPDF(showBanca(testi.Rows[0]["Testo9"].ToString().Replace("$Banca$", "$/Banca/$")), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
            AddElement(new SpacePDF(15));
            AddElement(new FormattedTextAreaPDF(showBanca(testi.Rows[0]["Testo10"].ToString().Replace("$Banca$", "$/Banca/$")), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
            AddElement(new SpacePDF(6));

            var stringheElencoPuntato2 = new List<string> { showBanca(testi.Rows[0]["Testo11"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo12"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo13"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo14"].ToString().Replace("$Banca$", "$/Banca/$")), showBanca(testi.Rows[0]["Testo15"].ToString().Replace("$Banca$", "$/Banca/$")) };
            var elencoPuntato2 = new UnorderedListPDF(EnvironmentFacade.RendererFacade.XLeftLimit, stringheElencoPuntato2) { FontSize = 7 };
            AddElement(elencoPuntato2);

            AddElement(new SpacePDF(10));
            AddElement(new FormattedTextAreaPDF(showBanca(testi.Rows[0]["Testo16"].ToString().Replace("$Banca$", "$/Banca/$")), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
            AddElement(new SpacePDF(15));
            AddElement(new FormattedTextAreaPDF(showBanca(testi.Rows[0]["Testo17"].ToString().Replace("$Banca$", "$/Banca/$")), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });

        }
    }
}
