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

namespace Consulenza.ReportWriter.Manager.Chapter.Unica.Diagnosi
{
    public class S74 : Unica.S74
    {
        public S74(EnvironmentFacade environmentFacade, int idChapter)
            : base(environmentFacade, idChapter)
        {
            try
            {
                //Draw();
            }
            catch (Exception ex)
            {
                SectionLogger.Write("S74", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment);
            }
        }

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

        protected override void Draw()
        {

            // Aggiungo la pagina
            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());
            //AddElement(new SpacePDF(20));
        }
    }
}
