59 lines
3.4 KiB
C#
59 lines
3.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Configuration;
|
|
using System.Globalization;
|
|
//using PDFGeneratorLetteraBenvenuto;
|
|
|
|
public class LetteraAccompagnamentoPeriodico : LetteraBenvenuto
|
|
{
|
|
public LetteraAccompagnamentoPeriodico(string rete, int id, string testo, string nome, string cognome, string indirizzo, string appellativo, string obj, string firma, TipoContratto contract)
|
|
: base(rete,id,testo,nome,cognome,indirizzo,false,appellativo,obj,firma, contract,0)
|
|
{
|
|
this.settaCampi();
|
|
this.nomeLettera = "LetteraAccettazionePeriodico" + id;
|
|
}
|
|
|
|
protected override void settaCampi ()
|
|
{
|
|
//pk
|
|
//string[] split = this.indirizzo.Split(new string[1] { "\n" }, StringSplitOptions.None);
|
|
//string ind = "";
|
|
//foreach (string s in split)
|
|
//{
|
|
// if (s.Length > ind.Length)
|
|
// ind = s;
|
|
//}
|
|
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);
|
|
// lenght = lenght + 40;
|
|
//float end_pos = this.cliente.Width + this.cliente.X;
|
|
//this.cliente.X = end_pos - lenght;// * (float)(5)-63;
|
|
//this.cliente.Width = lenght;// * (float)(5)+63;
|
|
//this.cliente.Width = lenght;// * (float)(5)+63;
|
|
|
|
|
|
|
|
DateTimeFormatInfo dfi = new CultureInfo("it-IT", false).DateTimeFormat;
|
|
DateTime dataFineTrimestre = Convert.ToDateTime(ConfigurationManager.AppSettings["DataFineTrimestreCorrente_LetteraAccompagnamento"], dfi);
|
|
this.luogo.Text = "Torino, " + dataFineTrimestre.ToString("dd MMMM yyyy", dfi);
|
|
// *** Modififca Andrea per Impatti IWBank sui report Trimestrali CB e SEI: adeguamento lettera accompagnatorie **********//
|
|
if (rete.ToUpper() == "W")
|
|
this.luogo.Text = "Milano, " + 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 += tp.LetteraAccompagnamentoPeriodicoSalutiYBonus;// 33;
|
|
this.firma.Y += tp.LetteraAccompagnamentoPeriodicoFirmaYBonus;// 45;
|
|
}
|
|
}
|
|
|