164 lines
5.8 KiB
C#
164 lines
5.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
using System.Data;
|
|
using PDFGenerator.Presentation.Section.Tables;
|
|
using PDFGenerator.BusinessLayer.DataSection;
|
|
using PDFGenerator.BusinessLayer;
|
|
using ceTe.DynamicPDF.PageElements;
|
|
using ceTe.DynamicPDF.Text;
|
|
|
|
|
|
/// <summary>
|
|
/// Summary description for S103
|
|
/// </summary>
|
|
///
|
|
namespace PDFGenerator.Presentation.Section
|
|
{
|
|
|
|
|
|
public class S168
|
|
{
|
|
private string _titolo = string.Empty;
|
|
private string _testointroduttivo = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Titolo della sezione
|
|
/// </summary>
|
|
public string Titolo
|
|
{
|
|
get
|
|
{
|
|
return _titolo;
|
|
}
|
|
set
|
|
{
|
|
_titolo = value;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Testo introduttivo della Sezione.
|
|
/// </summary>
|
|
public string TestoIntroduttivo
|
|
{
|
|
get
|
|
{
|
|
return _testointroduttivo;
|
|
}
|
|
set
|
|
{
|
|
_testointroduttivo = value;
|
|
}
|
|
}
|
|
|
|
|
|
public S168()
|
|
{
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
|
|
public void writeSezione(DataThread dataThread)
|
|
{
|
|
DocumentPDF document = dataThread.DocumentPDF;
|
|
//DataSectionParameter dataSectionParameter = paramSez.getParam();
|
|
|
|
DataSetS168 set = (DataSetS168)dataThread.Data.DatiSezione;
|
|
DatiTabella datitab = new DatiTabella();
|
|
datitab.table = set.Tables["Emittenti"];
|
|
|
|
//calcola se entra nella pagina altrimenti aggiunge una nuova pagina.
|
|
if (document.checkMargin(datitab.GetRowDim() * (datitab.getNumRow() + 2)))
|
|
document.addPage();
|
|
|
|
//document.setSezTitolo(_titolo); // Titolo della sezione
|
|
string temp;
|
|
if (dataThread.Intermediario == "BF" || dataThread.Intermediario == string.Empty)
|
|
{
|
|
//if (dataThread.Rete == "S")
|
|
// temp = "Sanpaolo Invest";
|
|
//else
|
|
// //FC 26062015 Aggionamento nuova Ragione Sociale
|
|
// temp = "Fideuram";
|
|
|
|
//*********************************** Cecco modifiche dicitura IWBANK**********************
|
|
if (dataThread.Rete == "S")
|
|
//Rosaspina Andrea//
|
|
temp = "Fideuram S.p.A., commercializzato tramite la rete di private banker Sanpaolo Invest";
|
|
//temp = "Sanpaolo Invest";
|
|
else if (dataThread.Rete == "F")
|
|
{
|
|
//FC 26062015 Aggionamento nuova Ragione Sociale
|
|
temp = "Fideuram";
|
|
}
|
|
else
|
|
{
|
|
temp = "IW Private Investments";
|
|
}
|
|
}
|
|
//**********************************************************************************************
|
|
else
|
|
temp = dataThread.Intermediario;
|
|
|
|
_testointroduttivo = _testointroduttivo.Replace("/$BANCA$/", temp);
|
|
// testo introduttivo
|
|
|
|
if (temp.ToUpper() == "COMPLESSIVO")
|
|
_testointroduttivo = _testointroduttivo.Replace("il patrimonio che Lei detiene presso Complessivo", "il Suo patrimonio finanziario complessivo");
|
|
|
|
//document.setSezHeader(_testointroduttivo);
|
|
document.setChapterHeader(_testointroduttivo, 0, 520, 8);
|
|
|
|
document.setHeaderSpace(10);
|
|
|
|
//Disegno la tabella
|
|
|
|
Tabella tabellaDati = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
tabellaDati.HeaderFont = 9;
|
|
tabellaDati.Header = true;
|
|
tabellaDati.Datasource = datitab.table;
|
|
|
|
int dimFont = 8;
|
|
|
|
tabellaDati.Colonne.Add(new Colonna("Emittente", "Emittente", 95, TipoAllineamento.SINISTRA, false, dimFont, false));
|
|
tabellaDati.Colonne.Add(new Colonna("Rischio", "Rischio Credito", 85, TipoAllineamento.DESTRA, false, dimFont, false));
|
|
//tabellaDati.Colonne.Add(new Colonna("Rischio", "Rischio Credito", 80, TipoAllineamento.DESTRA, false, 7, false));
|
|
tabellaDati.Colonne.Add(new Colonna("CtvObbligazionario", "Controvalore Obbligazionario (€)", 112, TipoAllineamento.DESTRA, false, dimFont, false));
|
|
//tabellaDati.Colonne.Add(new Colonna("CtvObbligazionario", "Controvalore Obbligazionario (€)", 130, TipoAllineamento.DESTRA, false, 7, false));
|
|
tabellaDati.Colonne.Add(new Colonna("CtvAzionario", "Controvalore Azionario (€)", 85, TipoAllineamento.DESTRA, false, dimFont, false));
|
|
tabellaDati.Colonne.Add(new Colonna("Concentrazione", "Concentrazione (%)", 90, TipoAllineamento.DESTRA, false, dimFont, false));
|
|
tabellaDati.Colonne.Add(new Colonna("Rating", "Rating", 45, TipoAllineamento.DESTRA, false, dimFont, false));
|
|
|
|
bool notaNeeded = false;
|
|
foreach (DataSetS168.EmittentiRow rw in set.Emittenti.Rows)
|
|
{
|
|
notaNeeded = notaNeeded || rw.Nota;
|
|
}
|
|
|
|
tabellaDati.Draw(datitab, document);
|
|
|
|
if (notaNeeded)
|
|
{
|
|
document.getCurrentPage().Elements.Add(new Label(Resource.Nota_TabellaEmittenti, datitab.getX(), document.getLastPos() + tabellaDati.AltezzaTabella, 500F, 30F, Globals.OpenTypeFontVerdana, 8));
|
|
//List<string> nota = new List<string>();
|
|
//nota.Add(Resource.Nota_TabellaEmittenti);
|
|
//tabellaDati.NotaTabella = nota;
|
|
}
|
|
|
|
// setto la posizione aggiornata
|
|
|
|
if (notaNeeded)
|
|
document.setLastPos(tabellaDati.AltezzaTabella + 20);
|
|
else
|
|
document.setLastPos(tabellaDati.AltezzaTabella);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} |