90 lines
3.0 KiB
C#
90 lines
3.0 KiB
C#
using Consulenza.ReportWriter.Business.Entity;
|
|
using Consulenza.ReportWriter.Business;
|
|
using Consulenza.ReportWriter.Manager.Integration;
|
|
using System.Data;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Consulenza.ReportWriter.Manager.Chapter.Entity
|
|
{
|
|
public abstract class Chapter : EntityBase
|
|
{
|
|
/// <summary>
|
|
/// Imposta o recupera l'id del capitolo definito a livello database.
|
|
/// Campo ID della tabella Capitoli
|
|
/// </summary>
|
|
protected int IdChapter { get; set; }
|
|
|
|
/// <summary>
|
|
/// Imposta o recupera un booleano che indica se il testo del capitolo sarà ripetuto su tutte le pagine sottostanti al capitolo stesso.
|
|
/// </summary>
|
|
public bool RepeatOnEachPage { get; set; }
|
|
|
|
/// <summary>
|
|
/// Imposta o recupera un bool che determina l'esisteza del Chapter e relativa Section.
|
|
/// Se false non viene stampato ne il Chapter ne la Section.
|
|
/// Di default = true.
|
|
/// </summary>
|
|
public bool Exist { get; set; }
|
|
|
|
/// <summary>
|
|
/// Imposta o recupera l'oggetto IntegrationLayout che contiene informazioni id integrazioni grafiche.
|
|
/// Ad esempio: duplicazione di capitoli, paragrafi e sezioni...
|
|
/// </summary>
|
|
protected IntegrationLayout IntegrationLayout { get; set; }
|
|
|
|
/// <summary>
|
|
/// Costruttore
|
|
/// </summary>
|
|
/// <param name="environmentFacade"></param>
|
|
/// <param name="idchapter"></param>
|
|
protected Chapter(EnvironmentFacade environmentFacade, int idchapter)
|
|
: base(environmentFacade)
|
|
{
|
|
IdChapter = idchapter;
|
|
EntityType = EntityTypePdf.Chapter;
|
|
Exist = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Disegna il capitolo.
|
|
/// </summary>
|
|
protected abstract void Draw();
|
|
|
|
/// <summary>
|
|
/// Recupera i testi definiti in tabella [ReportModeler2].[TestiCapitoli] eseguendo la stored sp_RecuperaTestiCapitoli.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
protected DataTable GetText()
|
|
{
|
|
#region Definizione dei parametri
|
|
|
|
var parametri = new List<Parametro>
|
|
{
|
|
new Parametro
|
|
{
|
|
Direction = ParameterDirection.Input,
|
|
DbType = DbType.Int32,
|
|
ParameterName = "IdReport",
|
|
Value = EnvironmentFacade.ReportEnvironment.ReportId
|
|
},
|
|
new Parametro
|
|
{
|
|
Direction = ParameterDirection.Input,
|
|
DbType = DbType.Int32,
|
|
ParameterName = "IdCapitolo",
|
|
Value = IdChapter
|
|
}
|
|
};
|
|
|
|
#endregion
|
|
|
|
return DataAccess.ExecuteDataTableStoredProcedure(DBProvider.SqlServerReportModeler, "sp_RecuperaTestiCapitoli", parametri);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return IdChapter.ToString();
|
|
}
|
|
}
|
|
}
|