65 lines
3.5 KiB
C#
65 lines
3.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Configuration;
|
|
using System.Globalization;
|
|
|
|
namespace Consulenza.PDFLettera
|
|
{
|
|
public class LetteraAccompagnamentoPeriodico : LetteraBenvenuto
|
|
{
|
|
public LetteraAccompagnamentoPeriodico(string rete, int id, string testo, string nome, string cognome, string indirizzo, string appellativo, string obj, string firma)
|
|
: base(rete,id,testo,nome,cognome,indirizzo,false,appellativo,obj,firma)
|
|
{
|
|
this.settaCampi();
|
|
this.nomeLettera = "LetteraAccettazionePeriodico" + id;
|
|
}
|
|
|
|
protected override void settaCampi ()
|
|
{
|
|
//this.cliente.Text = this.appellativo + "\r\n" + nome + " " + cognome + "\r\n" + indirizzo;
|
|
//DateTimeFormatInfo dfi = new CultureInfo("it-IT", false).DateTimeFormat;
|
|
//DateTime dataFineTrimestre = Convert.ToDateTime(dfi);
|
|
//this.luogo.Text = "Roma, " + dataFineTrimestre.ToString("dd MMMM yyyy", dfi);
|
|
//this.oggetto.Text = this.testoOggetto;
|
|
//this.corpo.Text = testo;
|
|
////string[] valoriTextArea = ConfigurationManager.AppSettings["OffsetFirmaAttivazioneSei"].Split(',');
|
|
////this.firma.X += Convert.ToSingle(valoriTextArea[0]);
|
|
////this.firma.Y += Convert.ToSingle(valoriTextArea[1]);
|
|
//this.saluti.Text = this.testoSaluti;
|
|
//this.saluti.Y -= 50;
|
|
//this.firma.Y -= 50;
|
|
|
|
|
|
this.cliente.Text = this.appellativo.Trim() + "\r\n" + nome.Trim() + " " + cognome.Trim() + "\r\n" + this.indirizzo;
|
|
int fontLenght = Convert.ToInt32(ConfigurationManager.AppSettings["fontSize"]);
|
|
float lenght = ceTe.DynamicPDF.Font.TimesRoman.GetTextWidth(this.appellativo.Trim(), fontLenght) > ceTe.DynamicPDF.Font.TimesRoman.GetTextWidth(this.nome.Trim(), fontLenght) ? ceTe.DynamicPDF.Font.TimesRoman.GetTextWidth(this.appellativo.Trim(), fontLenght) : ceTe.DynamicPDF.Font.TimesRoman.GetTextWidth(this.nome.Trim(), fontLenght);
|
|
lenght = lenght > ceTe.DynamicPDF.Font.TimesRoman.GetTextWidth(this.cognome.Trim(), fontLenght) ? lenght : ceTe.DynamicPDF.Font.TimesRoman.GetTextWidth(this.cognome.Trim(), fontLenght);
|
|
lenght = lenght > ceTe.DynamicPDF.Font.TimesRoman.GetTextWidth(this.indirizzo.Trim(), fontLenght) ? lenght : ceTe.DynamicPDF.Font.TimesRoman.GetTextWidth(this.indirizzo, fontLenght);
|
|
|
|
DateTimeFormatInfo dfi = new CultureInfo("it-IT", false).DateTimeFormat;
|
|
DateTime dataFineTrimestre = Convert.ToDateTime(ConfigurationManager.AppSettings["DataFineTrimestreCorrente_LetteraAccompagnamento"], dfi);
|
|
|
|
/******************* Fix giorno con un solo carattere - Pino *************************/
|
|
string soloGiorno = dataFineTrimestre.Day.ToString();
|
|
|
|
if (soloGiorno.Length == 1)
|
|
this.luogo.Text = "Torino, " + dataFineTrimestre.ToString("d MMMM yyyy", dfi);
|
|
else
|
|
this.luogo.Text = "Torino, " + dataFineTrimestre.ToString("dd MMMM yyyy", dfi);
|
|
|
|
//this.luogo.Text = "Torino, " + dataFineTrimestre.ToString("dd MMMM yyyy", dfi); // originale
|
|
/***************************************************************************************/
|
|
|
|
this.oggetto.Text = this.testoOggetto;
|
|
this.corpo.Text = testo;
|
|
this.saluti.Text = this.testoSaluti;
|
|
|
|
// this.saluti.Y -= 50;
|
|
//this.firma.Y -= 10;
|
|
this.saluti.Y -= 5;// 33;
|
|
this.firma.Y -= 5;// 45;
|
|
|
|
}
|
|
}
|
|
} |