using Consulenza.ReportWriter.Business;
using Consulenza.ReportWriter.Business.OBJ_PDF;
using Consulenza.ReportWriter.Business.CUSTOM_PDF.ConsulenzaUnica;

namespace Consulenza.ReportWriter.Manager.Chapter.Unica
{
    /// <summary>
    /// Scheda 7. Patrimonio finanziario: macro categorie prodotto. IdCapitolo 25
    /// </summary>
    public class S7 : Entity.Chapter
    {
        public S7(EnvironmentFacade environmentFacade, int idChapter)
            : base(environmentFacade, idChapter)
        {
            Draw();
        }

        public S7(EnvironmentFacade environmentFacade, int idChapter, bool repeatoneachpage)
            : this(environmentFacade, idChapter)
        {
            RepeatOnEachPage = repeatoneachpage;
        }

        protected override sealed void Draw()
        {
            AddElement(new PagePDF(PagePDF.PagePDFType.Generic));

            var testi = GetText();

            var intestazione = new ChapterHeadingPDF(
                testi.Rows[0]["testo1"].ToString(),
                EnvironmentFacade.RendererFacade.XLeftLimit,
                EnvironmentFacade.RendererFacade.YUpperLimit,
                EnvironmentFacade.ReportEnvironment.FontFamily
                );

            // Aggiungo gli elementi
            AddElement(intestazione.ToElement());
        }
    }
}
