220 lines
5.4 KiB
C#
220 lines
5.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace PDFGenerator.BusinessLayer
|
|
{
|
|
/// <summary>
|
|
/// Enumeratore del tipo di Report.
|
|
/// </summary>
|
|
public enum TipoReport
|
|
{
|
|
DIAGNOSI,
|
|
PROPOSTA,
|
|
PIANIFICAZIONE,
|
|
MONITORAGGIO
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Summary description for Report
|
|
/// </summary>
|
|
public class Report
|
|
{
|
|
#region Variabili private
|
|
private Int32 _id;
|
|
private string _titolo;
|
|
private string _testoIntroduttivo;
|
|
private Int32 _ordine;
|
|
private bool _hascopertina;
|
|
private bool _hasindice;
|
|
private bool _hasglossario;
|
|
|
|
|
|
private TipoReport _tipo;
|
|
private string _nome;
|
|
private List<CapitoloReport> _children = new List<CapitoloReport>();
|
|
private DocumentPDF _documentPDF;
|
|
private bool _checkstampaelemento;
|
|
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// Costruttore
|
|
/// </summary>
|
|
public Report()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Costruttore
|
|
/// </summary>
|
|
public Report(DocumentPDF documentPDF)
|
|
{
|
|
// Set dei dati sul doc a livello di Report
|
|
_documentPDF = documentPDF;
|
|
_checkstampaelemento = true;
|
|
|
|
}
|
|
/// <summary>
|
|
/// Costruttore
|
|
/// </summary>
|
|
/// <param name="tipologiaReport"></param>
|
|
public Report(TipoReport tipologiaReport)
|
|
{
|
|
switch (tipologiaReport)
|
|
{
|
|
case TipoReport.DIAGNOSI:
|
|
_id = 1;
|
|
_nome = "DIAGNOSI";
|
|
_tipo = TipoReport.DIAGNOSI;
|
|
break;
|
|
case TipoReport.PIANIFICAZIONE:
|
|
_id = 2;
|
|
_nome = "PIANIFICAZIONE";
|
|
_tipo = TipoReport.PIANIFICAZIONE;
|
|
break;
|
|
case TipoReport.PROPOSTA:
|
|
_id = 3;
|
|
_nome = "PROPOSTA";
|
|
_tipo = TipoReport.PROPOSTA;
|
|
break;
|
|
case TipoReport.MONITORAGGIO:
|
|
_id = 4;
|
|
_nome = "MONITORAGGIO";
|
|
_tipo = TipoReport.MONITORAGGIO;
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#region Proprieta
|
|
/// <summary>
|
|
/// Ottiene o imposta l'Id del Report.
|
|
/// </summary>
|
|
public int Id
|
|
{
|
|
get { return _id; }
|
|
set { _id = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ottiene o imposta il tipo del Report.
|
|
/// </summary>
|
|
public TipoReport Tipo
|
|
{
|
|
get { return _tipo; }
|
|
set { _tipo = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ottiene o imposta il nome del Report.
|
|
/// </summary>
|
|
public string Nome
|
|
{
|
|
get { return _nome; }
|
|
set { _nome = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ottiene o imposta DocumentPDF necessario per la creazione del report.
|
|
/// </summary>
|
|
public DocumentPDF DocumentPDF
|
|
{
|
|
get { return _documentPDF; }
|
|
set { _documentPDF = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ottiene o imposta il Titolo del Report.
|
|
/// </summary>
|
|
public string Titolo
|
|
{
|
|
get { return _titolo; }
|
|
set { _titolo = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ottiene o imposta il Testo introduttivo del Report.
|
|
/// </summary>
|
|
public string TestoIntroduttivo
|
|
{
|
|
get { return _testoIntroduttivo; }
|
|
set { _testoIntroduttivo = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ottiene o imposta il l'ordine di stampa del Report.
|
|
/// </summary>
|
|
public int Ordine
|
|
{
|
|
get { return _ordine; }
|
|
set { _ordine = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Indica se l'elemento viene stampato o no.
|
|
/// Di default true.
|
|
/// </summary>
|
|
public bool CheckStampaElemento
|
|
{
|
|
get { return _checkstampaelemento; }
|
|
set { _checkstampaelemento = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Indica se l'utente ha richiesto la stampa della Copertina.
|
|
/// </summary>
|
|
public bool HasCopertina
|
|
{
|
|
get { return _hascopertina; }
|
|
set { _hascopertina = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Indica se l'utente ha richiesto la stampa dell' Indice.
|
|
/// </summary>
|
|
public bool HasIndice
|
|
{
|
|
get { return _hasindice; }
|
|
set { _hasindice = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Indica se l'utente ha richiesto la stampa dell Glossario.
|
|
/// </summary>
|
|
public bool HasGlossario
|
|
{
|
|
get { return _hasglossario; }
|
|
set { _hasglossario = value; }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Metodi
|
|
|
|
public void Add(CapitoloReport child)
|
|
{
|
|
_children.Add(child);
|
|
}
|
|
public void Remove(CapitoloReport child)
|
|
{
|
|
_children.Remove(child);
|
|
}
|
|
public void Disegna()
|
|
{
|
|
foreach (CapitoloReport child in _children)
|
|
{
|
|
child.CapitoloParent = this;
|
|
child.Disegna();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
}
|
|
} |