274 lines
11 KiB
C#
274 lines
11 KiB
C#
using System;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using System.Web;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Web.UI.WebControls.WebParts;
|
|
using System.Web.UI.HtmlControls;
|
|
using System.Collections;
|
|
using ceTe.DynamicPDF;
|
|
using ceTe.DynamicPDF.Text;
|
|
using PDFGenerator.BusinessLayer.DataSection;
|
|
using PDFGenerator.BusinessLayer;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace PDFGenerator.Presentation.Section
|
|
{
|
|
/********************* Modifiche per Aladdin grafici a barre -- Pino ***************************/
|
|
/************** Modificata l'ereditarieta da STorta a SIstogramma *******************************/
|
|
public class S159 : SIstogramma, ISezione
|
|
{
|
|
|
|
DataSetS159 set = new DataSetS159();
|
|
|
|
public S159()
|
|
{
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
#region ISezione Members
|
|
|
|
public new void writeSezione(DataThread datathread)
|
|
{
|
|
|
|
document = datathread.DocumentPDF;
|
|
|
|
set = (DataSetS159)datathread.Data.DatiSezione;
|
|
|
|
document.setSezTitolo(datathread.SezioneReport.Titolo);
|
|
document.setChapterHeader(datathread.SezioneReport.TestoIntroduttivo.Replace("$/Banca/$", datathread.NomeRete).Replace("Sanpaolo Invest", "Fideuram S.p.A., commercializzato tramite la rete di private banker Sanpaolo Invest,"), 0, 520, 8);
|
|
|
|
|
|
tabTortaTabella = set.Tables["MacroAssetClass"];
|
|
tabTortaTotali = set.Tables["MacroAssetTotale"];
|
|
tabTortaPatrimonioNonRappresentabile = set.Tables["PatrimonioNonRappresentabile"];
|
|
tabTortaContoCorrenteBancaFideuram = set.Tables["ContoCorrenteBancaFideuram"];
|
|
tabTortaLineaSelf = set.Tables["LineaSelf"];
|
|
tabTortaPartiteViaggianti = set.Tables["PartiteViaggianti"];
|
|
tabTotale = set.Tables["Totale"];
|
|
// ************************* Modifica Andrea per correzione ***********************************//
|
|
//tabTortaTotali.Rows[0][1] = datathread.PatrimonioBancaFideuramCtvAlNettoContoCorrente;
|
|
tabTortaTotali.Rows[0][1] = datathread.PatrimonioBancaFideuramCtvAlNettoContoCorrente + datathread.PartiteViaggiantiInvestimento + datathread.PartiteViaggiantiDisinvestimento; //+ datathread.PatrimonioNonRappresentabileFI;
|
|
// ******************************************************************************************//
|
|
|
|
//UtilityBusinessLayer.ReplaceVariables(datathread.SezioneReport.TestoIntroduttivo, _dataThread)
|
|
//document.setChapterHeader(UtilityBusinessLayer.ReplaceVariables(datathread.SezioneReport.TestoIntroduttivo, datathread), 0, 520, 8);
|
|
|
|
|
|
base.writeSezione10(datathread);
|
|
|
|
|
|
|
|
//if (set.Tables["PatrimonioNonRappresentabile"].Rows.Count > 0)
|
|
//{
|
|
// if (dim > ChartHeigth)
|
|
// {
|
|
// //this.addNota(document, (int)dim);
|
|
// this.addNota1(document, (int)dim, datathread);
|
|
// }
|
|
// else
|
|
// {
|
|
// //this.addNota(document, ChartHeigth);
|
|
// this.addNota1(document, ChartHeigth, datathread);
|
|
// }
|
|
//}
|
|
|
|
if (dim > ChartHeigth)
|
|
{
|
|
//this.addNota(document, (int)dim);
|
|
this.addNota1(document, (int)dim, datathread);
|
|
}
|
|
else
|
|
{
|
|
//this.addNota(document, ChartHeigth);
|
|
this.addNota1(document, ChartHeigth, datathread);
|
|
}
|
|
|
|
|
|
if (dim > ChartHeigth)
|
|
{
|
|
document.setLastPos(dim);
|
|
}
|
|
else
|
|
{
|
|
document.setLastPos(ChartHeigth);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
//public void writeSezioneCombo(DataThread datathread)
|
|
//{
|
|
|
|
// document = datathread.DocumentPDF;
|
|
|
|
// set = (DataSetS159)datathread.Data.DatiSezione;
|
|
|
|
// tabTortaTabella = set.Tables["MacroAssetClass"];
|
|
// tabTortaTotali = set.Tables["MacroAssetTotale"];
|
|
// tabTortaPatrimonioNonRappresentabile = set.Tables["PatrimonioNonRappresentabile"];
|
|
// tabTortaContoCorrenteBancaFideuram = set.Tables["ContoCorrenteBancaFideuram"];
|
|
// tabTortaPartiteViaggianti = set.Tables["PartiteViaggianti"];
|
|
// tabTotale = set.Tables["Totale"];
|
|
|
|
// base.writeSezioneComboSX(datathread);
|
|
|
|
// if (salto)
|
|
// document.returnLastPage();
|
|
|
|
// document.setPotenzialeLastPos(datitab.GetRowDim() * datitab.getNumRow() + dim, salto);
|
|
|
|
//}
|
|
|
|
private void addNota(DocumentPDF doc, int dim)
|
|
{
|
|
doc.setSezFooter("(*) Il dettaglio del Patrimonio non rappresentabile per Asset class viene riportato in fondo al documento.", dim);
|
|
}
|
|
|
|
private void addNota1(DocumentPDF doc, int dim, DataThread dataThread)
|
|
{
|
|
decimal totaleSelfNegFO = dataThread.Periodico ? dataThread.GetSelfNegativeValue("FO") : 0;
|
|
decimal totalNegativeCurrentAccountValue = dataThread.Periodico ? dataThread.ContoCorrente : 0;
|
|
decimal GPEligoFondi = dataThread.GPEligoFondi;
|
|
decimal GPEligoTitoli = dataThread.GPEligoTitoli;
|
|
decimal PatrimonioTerzi = dataThread.PatrimonioTerziContoCorrente;
|
|
decimal ProdottiNonRapp = dataThread.PatrimonioNonRappresentabileFI;
|
|
decimal PartiteViaggianti = dataThread.PartiteViaggiantiInvestimento + dataThread.PartiteViaggiantiDisinvestimento;
|
|
decimal PatrBancaSez = dataThread.PatrimonioBancaFideuramCtvAlNettoContoCorrente - dataThread.PatrimonioNonRappresentabileFI;
|
|
decimal GradoCopertura = PatrBancaSez / (dataThread.PatrimonioBancaFideuramCtvAlNettoContoCorrente + PartiteViaggianti) * 100;
|
|
decimal PatrimonioTerziNonRapp = 0;
|
|
List<string> notes = new List<string>();
|
|
|
|
string nota = string.Empty;
|
|
string nota1 = "";
|
|
string token = "";
|
|
|
|
//totalNegativeCurrentAccountValue = -1000.00M;
|
|
//totaleSelfNegFO = -1000.00M;
|
|
//totalePartiteViaggianti = 1000.00M;
|
|
//GPEligoFondi = -500.00M;
|
|
//GPEligoTitoli = -500.00M;
|
|
//PatrimonioTerzi = -400.00M;
|
|
//GradoCopertura = 70.00M;
|
|
//PatrimonioTerziNonRapp = 100.00M;
|
|
//ProdottiNonRapp = 20.00M;
|
|
|
|
if (totalNegativeCurrentAccountValue != 0 || totaleSelfNegFO != 0 || GPEligoFondi < 0 || GPEligoTitoli < 0 || PatrimonioTerzi < 0 || (GradoCopertura >= 0 && GradoCopertura < 100 && (ProdottiNonRapp != 0 || PartiteViaggianti != 0 || PatrimonioTerziNonRapp != 0)))
|
|
nota = "(*) ";
|
|
|
|
if (totalNegativeCurrentAccountValue != 0 || totaleSelfNegFO != 0 || GPEligoFondi < 0 || GPEligoTitoli < 0 || PatrimonioTerzi < 0)
|
|
{
|
|
|
|
notes.Add("Il controvalore esclude il saldo negativo");
|
|
token = " ";
|
|
|
|
if (totalNegativeCurrentAccountValue < 0)
|
|
{
|
|
notes.Add(string.Format(token + "dei conti correnti ({0} €)", totalNegativeCurrentAccountValue.ToString("N")));
|
|
token = ", ";
|
|
}
|
|
|
|
if (totaleSelfNegFO < 0)
|
|
{
|
|
notes.Add(string.Format(token + "della liquidità sottostante \"IL MF - Liquidita\" ({0} €)", totaleSelfNegFO.ToString("N")));
|
|
token = ", ";
|
|
}
|
|
|
|
if (GPEligoFondi < 0)
|
|
{
|
|
notes.Add(string.Format(token + "della liquidità sottostante GP Eligo Fondi ({0} €)", GPEligoFondi.ToString("N")));
|
|
token = ", ";
|
|
}
|
|
|
|
if (GPEligoTitoli < 0)
|
|
{
|
|
notes.Add(string.Format(token + "della liquidità sottostante GP Eligo Titoli ({0} €)", GPEligoTitoli.ToString("N")));
|
|
token = ", ";
|
|
}
|
|
token = " ";
|
|
//if (GPEligoTitoli < 0 || GPEligoFondi < 0 || totalNegativeCurrentAccountValue < 0)
|
|
//{
|
|
// notes.Add(string.Format(token + "del patrimonio $/Banca/$".Replace("$/Banca/$", dataThread.NomeRete)));
|
|
// token = ", ";
|
|
//}
|
|
if (PatrimonioTerzi < 0)
|
|
{
|
|
notes.Add(string.Format(token + "dei conti correnti ({0} €) del patrimonio Altri Istituti", PatrimonioTerzi.ToString("N")));
|
|
token = ", ";
|
|
}
|
|
notes.Add(string.Format("."));
|
|
token = ". ";
|
|
}
|
|
if (ProdottiNonRapp != 0 || PartiteViaggianti != 0 || PatrimonioTerziNonRapp != 0)
|
|
{
|
|
if (GradoCopertura >= 0 && GradoCopertura < 100)
|
|
{
|
|
notes.Add(string.Format(token + "Grado di copertura (%) della rappresentazione grafica per macro asset class pari a {0}", GradoCopertura.ToString("N")));
|
|
token = ": ";
|
|
|
|
if (ProdottiNonRapp != 0 || PartiteViaggianti != 0 || PatrimonioTerziNonRapp != 0)
|
|
{
|
|
notes.Add(string.Format(token + "non sono considerati"));
|
|
token = " ";
|
|
if (ProdottiNonRapp != 0 || PartiteViaggianti != 0)
|
|
{
|
|
if (ProdottiNonRapp != 0)
|
|
{
|
|
notes.Add(string.Format(token + "i prodotti non rappresentabili ({0} €)", ProdottiNonRapp.ToString("N")));
|
|
token = ", ";
|
|
}
|
|
if (PartiteViaggianti != 0)
|
|
{
|
|
notes.Add(string.Format(token + "gli importi relativi alle operazioni in corso ({0} €)", PartiteViaggianti.ToString("N")));
|
|
token = ", ";
|
|
}
|
|
token = " ";
|
|
notes.Add(string.Format(token + "del patrimonio $/Banca/$".Replace("$/Banca/$", dataThread.NomeRete)));
|
|
token = ", ";
|
|
}
|
|
if (PatrimonioTerziNonRapp != 0)
|
|
{
|
|
notes.Add(string.Format("i prodotti non rappresentabili ({0} €) del patrimonio Altri Istituti", PatrimonioTerziNonRapp.ToString("N")));
|
|
token = ", ";
|
|
}
|
|
}
|
|
notes.Add(string.Format("."));
|
|
}
|
|
}
|
|
|
|
nota1 += ".";
|
|
token = " ";
|
|
|
|
//int i = 0;
|
|
nota += notes.FirstOrDefault<string>();
|
|
if (notes.Count > 1)
|
|
{
|
|
foreach (var s in notes.Skip(1))
|
|
{
|
|
nota += s;
|
|
|
|
//if (i == 0)
|
|
// nota += s;
|
|
//if (i > 0 && i < notes.Count - 1)
|
|
// nota += ", " + s;
|
|
//if (i == notes.Count - 1)
|
|
// nota += " e " + s;
|
|
//i++;
|
|
}
|
|
}
|
|
else
|
|
nota += notes.FirstOrDefault<string>();
|
|
|
|
if (!nota.Equals(""))
|
|
//document.getCurrentPage().Elements.Add(new Label(nota, Xtable, Ytable, 512, 30F, Globals.OpenTypeFontVerdana, 7));
|
|
doc.setSezFooter(nota, dim);
|
|
|
|
}
|
|
|
|
}
|
|
}
|