107 lines
4.0 KiB
C#
107 lines
4.0 KiB
C#
using System;
|
|
using ceTe.DynamicPDF;
|
|
using Consulenza.ReportWriter.Business;
|
|
using Consulenza.ReportCommon;
|
|
using Consulenza.ReportWriter.Business.OBJ_PDF;
|
|
using System.Data;
|
|
|
|
namespace Consulenza.ReportWriter.Manager.Section.Unica
|
|
{
|
|
/// <summary>
|
|
/// Scheda 1. Copertina. IdSezione 44
|
|
/// </summary>
|
|
public class S1 : Entity.Section
|
|
{
|
|
public S1(EnvironmentFacade environmentFacade, int idSection)
|
|
: base(environmentFacade, idSection)
|
|
{
|
|
}
|
|
|
|
protected override void Draw()
|
|
{
|
|
#region TEST Opzioni
|
|
//try
|
|
//{
|
|
// string log = "";
|
|
// log += "Opzione1:" + GetOption<Opzione1>().anonimo;
|
|
// log += "Opzione2:" + GetOption<Opzione2>().proposta;
|
|
// log += "Opzione3:" + GetOption<Opzione3>().visualizzazione;
|
|
// log += "Opzione4:" + GetOption<Opzione4>().visualizzazione;
|
|
// log += "Opzione4_1:" + GetOption<Opzione4_1>().visualizzazione;
|
|
// log += "Opzione4_2:" + GetOption<Opzione4_2>().visualizzazione;
|
|
// log += "Opzione4_3:" + GetOption<Opzione4_3>().visualizzazione;
|
|
// log += "Opzione4_4:" + GetOption<Opzione4_4>().visualizzazione;
|
|
// log += "Opzione4_5:" + GetOption<Opzione4_5>().visualizzazione;
|
|
// log += "Opzione4A:" + GetOption<Opzione4A>().visualizzazione;
|
|
// SectionLogger.Write("S1Opzioni", log, SectionLoggerMessageLevel.I, EnvironmentFacade.ReportEnvironment);
|
|
//}
|
|
//catch { }
|
|
#endregion
|
|
|
|
var reportAnonimo = GetOption<Opzione1>().ReportAnonimo;
|
|
|
|
var nomeCliente = Helper.CapitalizeWords(EnvironmentFacade.ReportEnvironment.Cliente.Nome);
|
|
var cognomeCliente =EnvironmentFacade.ReportEnvironment.ReportType == ReportType.Unica_Nucleo ? EnvironmentFacade.ReportEnvironment.Cliente.Cognome : Helper.CapitalizeWords(EnvironmentFacade.ReportEnvironment.Cliente.Cognome);
|
|
|
|
// nome del report
|
|
var report = new FormattedTextAreaPDF(ExtendedProperties["titoloReport"].ToUpper(), 157, 220)
|
|
{
|
|
FontSize = 18,
|
|
Y = 231,
|
|
AutoIncrementYWritable = false,
|
|
AbsolutePosition = true,
|
|
TextHorizontalAlign = TextAlign.Right,
|
|
FontColor = ColorPDF.Bianco,
|
|
FontBold = true
|
|
};
|
|
|
|
// data di stampa
|
|
var sDataStampa = reportAnonimo ? "Report prodotto il {0}" : "Report prodotto il {0} per";
|
|
var dataStampa = new FormattedTextAreaPDF(string.Format(sDataStampa, Helper.FormatDateMonthName(DateTime.Now)), 88, 300)
|
|
{
|
|
FontSize = 9,
|
|
Y = 265,
|
|
AutoIncrementYWritable = false,
|
|
AbsolutePosition = true,
|
|
TextHorizontalAlign = TextAlign.Right
|
|
};
|
|
|
|
// cliente
|
|
var cliente = new FormattedTextAreaPDF(string.Format("{0} {1}", cognomeCliente, nomeCliente), 88, 300)
|
|
{
|
|
FontSize = 9,
|
|
Y = 280,
|
|
AutoIncrementYWritable = false,
|
|
AbsolutePosition = true,
|
|
TextHorizontalAlign = TextAlign.Right,
|
|
FontBold = true
|
|
};
|
|
|
|
// Aggiungo gli oggetti
|
|
AddElement(report);
|
|
AddElement(dataStampa);
|
|
|
|
if (!reportAnonimo)
|
|
AddElement(cliente);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Recupera i dati necessari alla Section restituendo un DataTable.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
protected sealed override DataTable GetDataTable()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Recupera i dati necessari alla Section restituendo un DataSet.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
protected sealed override DataSet GetDataSet()
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|