57 lines
3.1 KiB
C#
57 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using ceTe.DynamicPDF;
|
|
using ceTe.DynamicPDF.PageElements;
|
|
using ceTe.DynamicPDF.Merger;
|
|
using ceTe.DynamicPDF.Text;
|
|
using System.Configuration;
|
|
using System.Globalization;
|
|
|
|
|
|
public class LetteraCommerciale : LetteraBenvenuto
|
|
{
|
|
|
|
public int PageNumber { get; set; }
|
|
|
|
public LetteraCommerciale(string rete, int id, string testo, string nome, string cognome, string indirizzo, string appellativo, string obj, string firma, TipoContratto contract, int pageNumber,int _idReportDiagnosiLettera)
|
|
: base(rete,id, testo, nome, cognome,indirizzo,false,appellativo,obj,firma, contract, _idReportDiagnosiLettera) {
|
|
this.settaCampi();
|
|
this.nomeLettera = "LetteraCommerciale" + id;
|
|
PageNumber = pageNumber;
|
|
}
|
|
|
|
protected override void settaCampi()
|
|
{
|
|
//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;
|
|
DateTimeFormatInfo dfi = new CultureInfo("it-IT", false).DateTimeFormat;
|
|
this.luogo.Text = "Torino, " + dataGenerazione.ToString("dd MMMM yyyy", new CultureInfo("it-IT", false).DateTimeFormat);
|
|
// *** Modififca Andrea per Impatti IWBank sui report Trimestrali CB e SEI: adeguamento lettera accompagnatorie **********//
|
|
if (rete.ToUpper() == "W")
|
|
this.luogo.Text = "Milano, " + dataGenerazione.ToString("dd MMMM yyyy", new CultureInfo("it-IT", false).DateTimeFormat);
|
|
//********************************************************************************************************************//
|
|
this.oggetto.Text = this.testoOggetto;
|
|
this.corpo.Text = testo;
|
|
string[] valoriTextArea = ConfigurationManager.AppSettings["OffsetFirmaAttivazioneSei"].Split(',');
|
|
this.saluti.Text = this.testoSaluti;
|
|
}
|
|
}
|
|
|