using System;
using System.Collections.Generic;
using System.Linq;
using Consulenza.ReportWriter.Business;
using Consulenza.ReportWriter.Business.OBJ_PDF;
using System.Data;
using ceTe.DynamicPDF;
using Consulenza.ReportWriter.Business.CHART_PDF;
using Consulenza.ReportCommon;

namespace Consulenza.ReportWriter.Manager.Section.Immobiliare.Diagnosi.Nucleo
{
    /// <summary>   
    /// Patrimonio Immobiliare Nucleo Sintesi (id 35)  
    /// </summary>
    public class S2 : Immobiliare.Diagnosi.S2
    {
        /// <summary>   
        /// Patrimonio Immobiliare Nucleo Sintesi (id 35)  
        /// </summary>
        public S2(EnvironmentFacade environmentFacade, int idSection)
            : base(environmentFacade, idSection)
        {
        }

        /// <summary>
        /// Recupera i dati necessari alla Section restituendo un DataSet.
        /// </summary>
        /// <returns></returns>
        protected override DataSet GetDataSet()
        {
            #region Definizione dei parametri

            var parametri = new List<Parametro>
            {
                new Parametro
                {
                    Direction = ParameterDirection.Input,
                    DbType = DbType.Int64,
                    ParameterName = "ChiaveNucleo",
                    Value = EnvironmentFacade.ReportEnvironment.NucleoImmobiliare.ChiaveNucleo
                }
            };

            #endregion

            return EnvironmentFacade.ReportEnvironment.NucleoImmobiliare.ImmobiliareCEUnica ? DataAccess.ExecuteDataSetStoredProcedure(DBProvider.SqlServerConsulenzaUnica, "REP_Nucleo_Immobiliare_S2_Sintesi", parametri)
                : DataAccess.ExecuteDataSetStoredProcedure(DBProvider.SqlServerConsulenzaEvoluta, "REP_Nucleo_Immobiliare_S2_Sintesi", parametri);
        }
    }
}
