1542 lines
104 KiB
C#
1542 lines
104 KiB
C#
using System;
|
|
using Consulenza.ReportWriter.Business;
|
|
using Consulenza.ReportWriter.Business.OBJ_PDF;
|
|
using System.Data;
|
|
using Consulenza.ReportCommon;
|
|
using System.Collections.Generic;
|
|
using Consulenza.ReportWriter.Business.CHART_PDF;
|
|
using Consulenza.ReportWriter.Business.Entity;
|
|
using System.Linq;
|
|
using Consulenza.ReportWriter.Business.CUSTOM_PDF.ConsulenzaUnica;
|
|
|
|
namespace Consulenza.ReportWriter.Manager.Section.Unica
|
|
{
|
|
/// <summary>
|
|
/// S76.Diversificazione idSezione = 235
|
|
/// </summary>
|
|
public class S76 : Entity.Section
|
|
{
|
|
private bool _visualizzaAltriIstituti;
|
|
private bool _visualizzaSintesiComponenti;
|
|
private bool _visualizzaDettaglioComponenti;
|
|
private bool _presenzaNotaPatrimonioCasa = false;
|
|
private bool _presenzaNotaPatrimonioTerzi = false;
|
|
private bool _presenzaNotaEccessivaAdeguatezza = false;
|
|
private bool _stampaNota = false;
|
|
|
|
private string _asteriscoFideuram = "";
|
|
private string _asteriscoAltri = "";
|
|
private string _asteriscoComplessivo = "";
|
|
|
|
public S76(EnvironmentFacade environmentFacade, int idSection)
|
|
: base(environmentFacade, idSection)
|
|
{
|
|
try
|
|
{
|
|
_visualizzaAltriIstituti = GetOption<Opzione4>().Valore;
|
|
_visualizzaSintesiComponenti = GetOption<Opzione4_5>().Valore;
|
|
_visualizzaDettaglioComponenti = GetOption<Opzione4_6>().Valore;
|
|
|
|
//_visualizzaAltriIstituti = true;
|
|
//_visualizzaSintesiComponenti = true;
|
|
//_visualizzaDettaglioComponenti = true;
|
|
|
|
Draw();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SectionLogger.Write("S76", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment);
|
|
}
|
|
}
|
|
|
|
protected override sealed void Draw()
|
|
{
|
|
var dati = GetDataSet();
|
|
var testi = GetText();
|
|
var nota = Helper.ReplaceVariables(GetNote(), EnvironmentFacade.ReportEnvironment);
|
|
var series = new List<Serie>();
|
|
|
|
#region Impostazione coordinate
|
|
float axisWidth = 0;
|
|
|
|
float Y1TabellaDiversificazionePortafoglio = _visualizzaAltriIstituti ? 221f : 216f;
|
|
float Y2TabellaDiversificazionePortafoglio = _visualizzaAltriIstituti ? 321f : 249f;
|
|
|
|
//float Y1TabellaSintesiComponentiFideuram = _visualizzaAltriIstituti ? Y2TabellaDiversificazionePortafoglio + 158f : Y2TabellaDiversificazionePortafoglio + 150f;
|
|
float Y1TabellaSintesiComponentiFideuram = _visualizzaAltriIstituti ? Y2TabellaDiversificazionePortafoglio + 168f : Y2TabellaDiversificazionePortafoglio + 160f;
|
|
//float Y2TabellaSintesiComponentiFideuram = _visualizzaAltriIstituti ? Y2TabellaDiversificazionePortafoglio + 254f : Y2TabellaDiversificazionePortafoglio + 246f;
|
|
float Y2TabellaSintesiComponentiFideuram = _visualizzaAltriIstituti ? Y2TabellaDiversificazionePortafoglio + 268f : Y2TabellaDiversificazionePortafoglio + 260f;
|
|
|
|
float Y1TabellaSintesiComponentiAltri = _visualizzaAltriIstituti ? 200f : 200f;
|
|
float Y2TabellaSintesiComponentiAltri = _visualizzaAltriIstituti ? 300f : 300f;
|
|
|
|
float Y1TabellaSintesiComponentiComplessivo = _visualizzaAltriIstituti ? Y2TabellaSintesiComponentiAltri + 73 : Y2TabellaSintesiComponentiAltri + 73;
|
|
float Y2TabellaSintesiComponentiComplessivo = _visualizzaAltriIstituti ? Y2TabellaSintesiComponentiAltri + 168.5f : Y2TabellaSintesiComponentiAltri + 168.5f;
|
|
|
|
float Y1TabellaDettaglioComponentiFideuram = _visualizzaAltriIstituti ? 281f : 281f;
|
|
//float Y2TabellaDettaglioComponentiFideuram = _visualizzaAltriIstituti ? 568f : 568f;
|
|
float Y2TabellaDettaglioComponentiFideuram = _visualizzaAltriIstituti ? 505f : 505f;
|
|
|
|
float Y1TabellaDettaglioComponentiAltri = _visualizzaAltriIstituti ? 206f : 206f;
|
|
//float Y2TabellaDettaglioComponentiAltri = _visualizzaAltriIstituti ? 492f : 492f;
|
|
float Y2TabellaDettaglioComponentiAltri = _visualizzaAltriIstituti ? 429f : 429f;
|
|
|
|
float Y1TabellaDettaglioComponentiComplessivo = _visualizzaAltriIstituti ? 206f : 206f;
|
|
//float Y2TabellaDettaglioComponentiComplessivo = _visualizzaAltriIstituti ? 492f : 492f;
|
|
float Y2TabellaDettaglioComponentiComplessivo = _visualizzaAltriIstituti ? 429f : 429f;
|
|
|
|
#endregion Impostazione coordinate
|
|
|
|
_asteriscoFideuram = _presenzaNotaPatrimonioCasa ? "*" : "";
|
|
_asteriscoAltri = _presenzaNotaPatrimonioTerzi ? "*" : "";
|
|
_asteriscoComplessivo = _presenzaNotaPatrimonioCasa || _presenzaNotaPatrimonioTerzi ? "*" : "";
|
|
|
|
_stampaNota = _presenzaNotaPatrimonioCasa || _presenzaNotaPatrimonioTerzi;
|
|
|
|
string patrimonioFideuram = dati.Tables["Portafoglio"].Rows[0]["ControvaloreAttuale"].ToString();
|
|
string patrimonioAltri = dati.Tables["Portafoglio"].Rows[1]["ControvaloreAttuale"].ToString();
|
|
string patrimonioComplessivo = dati.Tables["Portafoglio"].Rows[2]["ControvaloreAttuale"].ToString();
|
|
|
|
AddElement(new SpacePDF(20) { AutoIncrementYWritable = true });
|
|
|
|
#region Sezione Diversificazione Portafoglio
|
|
|
|
#region Testo Introduttivo Sezione Diversificazione Portafoglio
|
|
|
|
var testoIntroPortafoglio = string.Empty;
|
|
|
|
if (_visualizzaAltriIstituti)
|
|
testoIntroPortafoglio = testi.Rows[0]["testo1"].ToString();
|
|
else
|
|
testoIntroPortafoglio = testi.Rows[0]["testo2"].ToString();
|
|
|
|
////************************************** da eliminare
|
|
//if (_visualizzaAltriIstituti)
|
|
// testoIntroPortafoglio = "In questa scheda è riportato il confronto, in termini di Diversificazione, tra il patrimonio che lei detiene presso Fideuram, il patrimonio che lei detiene presso altri Istituti e il suo patrimonio finanziario complessivo.";
|
|
//else
|
|
// testoIntroPortafoglio = "In questa scheda è riportato il livello di Diversificazione del patrimonio che lei detiene presso Fideuram.";
|
|
////**************************************
|
|
|
|
testoIntroPortafoglio = Helper.ReplaceVariables(testoIntroPortafoglio, EnvironmentFacade.ReportEnvironment);
|
|
|
|
var textArea = new FormattedTextAreaPDF(testoIntroPortafoglio, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = true };
|
|
|
|
AddElement(new FormattedTextAreaPDF(testoIntroPortafoglio, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = true });
|
|
|
|
AddElement(new SpacePDF(20));
|
|
|
|
#endregion Testo Introduttivo Sezione Diversificazione Portafoglio
|
|
|
|
#region Tabella Diversificazione Portafoglio
|
|
|
|
int i = 0;
|
|
|
|
DataTable dtPortafoglio = dati.Tables["Portafoglio"];
|
|
|
|
if (!_visualizzaAltriIstituti)
|
|
dtPortafoglio = dati.Tables["Portafoglio"].AsEnumerable()
|
|
.Where(x => x.Field<string>("Patrimonio").ToUpper().Contains("FIDEURAM") || x.Field<string>("Patrimonio").ToUpper().Contains("SANPAOLO"))
|
|
.CopyToDataTable();
|
|
|
|
var tabellaDiversificazionePortafoglio = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dtPortafoglio)
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = true,
|
|
RowHeight = 30,
|
|
Footer = false,
|
|
HeaderHeight = 30,
|
|
HideLastSeparationLine = false,
|
|
AdditionalSpaceBetweenHeadersAndTable = 3
|
|
};
|
|
|
|
tabellaDiversificazionePortafoglio.Columns.Add(new ColumnPDF("Patrimonio", 110, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Patrimonio", "Patrimonio") { HeaderFontSize = 7, PaddingRight = 4 });
|
|
tabellaDiversificazionePortafoglio.Columns.Add(new ColumnPDF("ControvaloreAttuale", 115, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "ControvaloreAttuale", "Controvalore <br>attuale (€)") { PaddingRight = 15, HeaderFontSize = 7 });
|
|
tabellaDiversificazionePortafoglio.Columns.Add(new ColumnPDF("GradoCopertura", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "GradoCopertura", "Grado di copertura <br>(%)") { PaddingRight = 15, HeaderFontSize = 7 });
|
|
tabellaDiversificazionePortafoglio.Columns.Add(new ColumnPDF("DiversificazioneObject", 225, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Objectpdf, "Diversificazione", "Diversificazione di portafoglio") { VerticalAlignment = VerticalAlignmentType.Centrato, HeaderFontSize = 7, FontSize = 7, DeltaYContent = 6, HeaderPaddingLeft = 10 });
|
|
|
|
var list = new List<double>();
|
|
list.Add(Convert.ToDouble(dtPortafoglio.AsEnumerable().Max(x => x["Diversificazione"])));
|
|
//var valoreMassimo = (float)Helper.Round(list.Max());
|
|
var valoreMassimo = 100;
|
|
float larghezzaBarra = 0;
|
|
float larghezzaSpazioTestoPercentuale = 0;
|
|
float larghezzaMinimaSpazioTestoPercentuale = 35;
|
|
float deltaXBarra = 0;
|
|
float width = tabellaDiversificazionePortafoglio.Columns[3].Width - 50;
|
|
foreach (DataRow row in dtPortafoglio.Rows)
|
|
{
|
|
var colore = new ColorPDF(Convert.ToInt32(row["Red"]), Convert.ToInt32(row["Green"]), Convert.ToInt32(row["Blue"]));
|
|
|
|
//Allineamento a destro delle colonne numeriche (Controvalore attuale e Grado di Copertura)
|
|
tabellaDiversificazionePortafoglio.Cells[1, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaDiversificazionePortafoglio.Cells[2, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
|
|
//Aggiunge l'asterisco se c'è la nota
|
|
row["Patrimonio"] += (i == 0) ? _asteriscoFideuram : (i == 1) ? _asteriscoAltri : _asteriscoComplessivo;
|
|
|
|
//larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaDiversificazionePortafoglio.Columns[3].Width - 50);
|
|
larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaDiversificazionePortafoglio.Columns[3].Width - 35);
|
|
larghezzaSpazioTestoPercentuale = tabellaDiversificazionePortafoglio.Columns[3].Width - larghezzaBarra;
|
|
deltaXBarra = larghezzaBarra + 10;
|
|
if (larghezzaSpazioTestoPercentuale < larghezzaMinimaSpazioTestoPercentuale)
|
|
{
|
|
deltaXBarra = -(tabellaDiversificazionePortafoglio.Columns[3].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
larghezzaSpazioTestoPercentuale = larghezzaMinimaSpazioTestoPercentuale;
|
|
}
|
|
if (Convert.ToDouble(row["ControvaloreAttuale"]) == 0)
|
|
{
|
|
tabellaDiversificazionePortafoglio.Cells[3, i].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new RectanglePDF(20, 1 , ColorPDF.Bianco),
|
|
new FormattedTextAreaPDF(row["Diversificazione"].ToString()=="0.00"? "0.00" : Helper.FormatDecimal(Convert.ToDecimal(row["Diversificazione"]).ToString(), 2),
|
|
0, larghezzaSpazioTestoPercentuale)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextVerticalAlign = ceTe.DynamicPDF.VAlign.Center,
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7
|
|
}
|
|
};
|
|
}
|
|
else
|
|
{
|
|
tabellaDiversificazionePortafoglio.Cells[3, i].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new RectanglePDF(20, larghezzaBarra , colore),
|
|
new FormattedTextAreaPDF(row["Diversificazione"].ToString()=="0.00"? "0.00" : Helper.FormatDecimal(Convert.ToDecimal(row["Diversificazione"]).ToString(), 2),
|
|
0, larghezzaSpazioTestoPercentuale)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextVerticalAlign = ceTe.DynamicPDF.VAlign.Center,
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7
|
|
}
|
|
};
|
|
}
|
|
|
|
i++;
|
|
}
|
|
|
|
AddElement(tabellaDiversificazionePortafoglio);
|
|
|
|
//currentY += tabellaDiversificazionePortafoglio.Height;
|
|
|
|
//ASSE X
|
|
axisWidth = Helper.GetWidthProportional(100, valoreMassimo, tabellaDiversificazionePortafoglio.Columns[3].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
XAxisDraw(295, Y2TabellaDiversificazionePortafoglio, 295 + axisWidth, Y2TabellaDiversificazionePortafoglio + 2);
|
|
|
|
//ASSE Y
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit + 295 - 1, Y1TabellaDiversificazionePortafoglio + 2, EnvironmentFacade.RendererFacade.XLeftLimit + 295 - 1, Y2TabellaDiversificazionePortafoglio + 2, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
|
|
|
|
// INSERITO STAMPA NOTA
|
|
#region Nota a pie' pagina
|
|
if (_stampaNota)
|
|
{
|
|
AddElement(new SpacePDF(15));
|
|
if (_visualizzaSintesiComponenti)
|
|
{
|
|
//AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 680, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
}
|
|
else
|
|
{
|
|
if (_visualizzaAltriIstituti) //Se ci sono anche le righe di Altri istituti e Complessivo la nota va più in basso
|
|
AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 380, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
else
|
|
AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 280, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
}
|
|
}
|
|
#endregion Nota a pie' pagina
|
|
|
|
#endregion Tabella Diversificazione Portafoglio
|
|
|
|
#endregion Sezione Diversificazione Portafoglio
|
|
|
|
#region Sezione Sintesi Componenti
|
|
if (_visualizzaSintesiComponenti)
|
|
{
|
|
#region Titolo e Testo Introduttivo
|
|
|
|
AddElement(new SpacePDF(20));
|
|
|
|
string titoloSintesi = "Sintesi delle componenti di diversificazione";
|
|
|
|
AddElement(new FormattedTextAreaPDF(titoloSintesi, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 10, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(20));
|
|
|
|
string testoIntroSintesi = string.Empty;
|
|
|
|
if (_visualizzaAltriIstituti)
|
|
testoIntroSintesi = testi.Rows[0]["testo3"].ToString();
|
|
else
|
|
testoIntroSintesi = testi.Rows[0]["testo4"].ToString();
|
|
|
|
testoIntroSintesi = Helper.ReplaceVariables(testoIntroSintesi, EnvironmentFacade.ReportEnvironment);
|
|
|
|
AddElement(new FormattedTextAreaPDF(testoIntroSintesi, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(20));
|
|
|
|
#endregion Titolo e Testo Introduttivo
|
|
|
|
#region Tabella Sintesi Componenti Fideuram
|
|
|
|
AddElement(new FormattedTextAreaPDF(String.Format(datiSeiUnico.FormatBanca("Patrimonio $/Banca/$(€){0}"), _asteriscoFideuram), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF(Helper.FormatCurrency(patrimonioFideuram), EnvironmentFacade.RendererFacade.XLeftLimit + 220) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
AddElement(new SpacePDF(10));
|
|
|
|
if (dati.Tables["SintesiComponentiFideuram"].Rows.Count > 0)
|
|
{
|
|
|
|
#region Definizione e Creazione
|
|
var tabellaSintesiComponentiFideuram = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["SintesiComponentiFideuram"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = true,
|
|
RowHeight = 30,
|
|
Footer = false,
|
|
HeaderHeight = 30,
|
|
HideLastSeparationLine = false,
|
|
AdditionalSpaceBetweenHeadersAndTable = 3
|
|
};
|
|
|
|
tabellaSintesiComponentiFideuram.Columns.Add(new ColumnPDF("Componente", 210, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Componente", "Componenti diversificazione di portafoglio") { HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaSintesiComponentiFideuram.Columns.Add(new ColumnPDF("DiversificazioneObject", 310, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Objectpdf, "Diversificazione", "Diversificazione") { VerticalAlignment = VerticalAlignmentType.Centrato, HeaderFontSize = 7, FontSize = 7, DeltaYContent = 6, HeaderPaddingLeft = 10 });
|
|
#endregion
|
|
|
|
#region Creazione Stacked Bar
|
|
i = 0;
|
|
list = new List<double>();
|
|
list.Add(Convert.ToDouble(dati.Tables["SintesiComponentiFideuram"].AsEnumerable().Max(x => x["Diversificazione"])));
|
|
//valoreMassimo = (float)Helper.Round(list.Max());
|
|
valoreMassimo = 100;
|
|
larghezzaBarra = 0;
|
|
larghezzaSpazioTestoPercentuale = 0;
|
|
larghezzaMinimaSpazioTestoPercentuale = 35;
|
|
deltaXBarra = 0;
|
|
foreach (DataRow row in dati.Tables["SintesiComponentiFideuram"].Rows)
|
|
{
|
|
//Arancione
|
|
var colore = new ColorPDF(255, 165, 0);
|
|
|
|
//larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaSintesiComponentiFideuram.Columns[1].Width - 50);
|
|
larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaSintesiComponentiFideuram.Columns[1].Width - 35);
|
|
|
|
larghezzaSpazioTestoPercentuale = tabellaSintesiComponentiFideuram.Columns[1].Width - larghezzaBarra;
|
|
deltaXBarra = larghezzaBarra + 10;
|
|
if (larghezzaSpazioTestoPercentuale < larghezzaMinimaSpazioTestoPercentuale)
|
|
{
|
|
deltaXBarra = -(tabellaSintesiComponentiFideuram.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
larghezzaSpazioTestoPercentuale = larghezzaMinimaSpazioTestoPercentuale;
|
|
}
|
|
|
|
tabellaSintesiComponentiFideuram.Cells[1, i].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new RectanglePDF(20, larghezzaBarra , colore),
|
|
new FormattedTextAreaPDF(row["Diversificazione"].ToString()=="0.00"? "0.00" : Helper.FormatDecimal(Convert.ToDecimal(row["Diversificazione"]).ToString(), 2),
|
|
0,
|
|
larghezzaSpazioTestoPercentuale)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextVerticalAlign = ceTe.DynamicPDF.VAlign.Center,
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7
|
|
}
|
|
};
|
|
i++;
|
|
}
|
|
#endregion
|
|
|
|
AddElement(tabellaSintesiComponentiFideuram);
|
|
//ASSE X
|
|
axisWidth = Helper.GetWidthProportional(100, valoreMassimo, tabellaSintesiComponentiFideuram.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
XAxisDraw(210, Y2TabellaSintesiComponentiFideuram, 210 + axisWidth, Y2TabellaSintesiComponentiFideuram + 2);
|
|
|
|
//ASSE Y
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y1TabellaSintesiComponentiFideuram + 2, EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y2TabellaSintesiComponentiFideuram + 2, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
}
|
|
|
|
|
|
#endregion Tabella Sintesi Componenti Fideuram
|
|
|
|
#region Tabella Sintesi Componenti altri Istituti e Complessivo
|
|
if (_visualizzaAltriIstituti)
|
|
{
|
|
#region Tabella Sintesi Componenti altri Istituti
|
|
|
|
#region Nota a pie' pagina e cambio pagina
|
|
// COMMENTATO ES
|
|
//if (_stampaNota)
|
|
//{
|
|
// //AddElement(new SpacePDF(15));
|
|
// //AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
// AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 680, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
//}
|
|
|
|
AddElement(new ImagePDF(435, 0.15F, "changepage.png") { Y = 745 - 5, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF("continua alla pagina successiva", 450, 200) { Y = 745 - 5, AutoIncrementYWritable = false, FontSize = 6, AbsolutePosition = true });
|
|
|
|
AddElement(new PagePDF());
|
|
#endregion Nota a pie' pagina e cambio pagina
|
|
|
|
AddElement(new SpacePDF(2));
|
|
|
|
AddElement(new ImagePDF(37, 0.15F, "changepage.png") { AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF("continua dalla pagina precedente", 37 + 15, 200) { FontSize = 6, AutoIncrementYWritable = true });
|
|
|
|
AddElement(new SpacePDF(20));
|
|
//AddElement(new FormattedTextAreaPDF(String.Format("Patrimonio altri Istituti(€){0} {1}", _asteriscoAltri, Helper.FormatCurrency(patrimonioAltri.ToString())), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new FormattedTextAreaPDF(String.Format("Patrimonio altri Istituti(€){0}", _asteriscoAltri), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF(Helper.FormatCurrency(patrimonioAltri), EnvironmentFacade.RendererFacade.XLeftLimit + 220) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
AddElement(new SpacePDF(10));
|
|
|
|
if (dati.Tables["SintesiComponentiAltri"].Rows.Count > 0)
|
|
{
|
|
#region Definizione e Creazione
|
|
var tabellaSintesiComponentiAltri = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["SintesiComponentiAltri"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = true,
|
|
RowHeight = 30,
|
|
Footer = false,
|
|
HeaderHeight = 30,
|
|
HideLastSeparationLine = false,
|
|
AdditionalSpaceBetweenHeadersAndTable = 3
|
|
|
|
};
|
|
|
|
tabellaSintesiComponentiAltri.Columns.Add(new ColumnPDF("Componente", 210, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Componente", "Componenti diversificazione di portafoglio") { HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 6 });
|
|
tabellaSintesiComponentiAltri.Columns.Add(new ColumnPDF("DiversificazioneObject", 310, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Objectpdf, "Diversificazione", "Diversificazione") { VerticalAlignment = VerticalAlignmentType.Centrato, HeaderFontSize = 7, FontSize = 7, DeltaYContent = 6, HeaderPaddingLeft = 10 });
|
|
#endregion
|
|
|
|
#region Creazione Stacked Bar
|
|
i = 0;
|
|
list = new List<double>();
|
|
list.Add(Convert.ToDouble(dati.Tables["SintesiComponentiAltri"].AsEnumerable().Max(x => x["Diversificazione"])));
|
|
//valoreMassimo = (float)Helper.Round(list.Max());
|
|
valoreMassimo = 100;
|
|
larghezzaBarra = 0;
|
|
larghezzaSpazioTestoPercentuale = 0;
|
|
larghezzaMinimaSpazioTestoPercentuale = 35;
|
|
deltaXBarra = 0;
|
|
foreach (DataRow row in dati.Tables["SintesiComponentiAltri"].Rows)
|
|
{
|
|
//Blu
|
|
var colore = new ColorPDF(32, 114, 156);
|
|
|
|
//larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaSintesiComponentiAltri.Columns[1].Width - 50);
|
|
larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaSintesiComponentiAltri.Columns[1].Width - 35);
|
|
larghezzaSpazioTestoPercentuale = tabellaSintesiComponentiAltri.Columns[1].Width - larghezzaBarra;
|
|
deltaXBarra = larghezzaBarra + 10;
|
|
if (larghezzaSpazioTestoPercentuale < larghezzaMinimaSpazioTestoPercentuale)
|
|
{
|
|
deltaXBarra = -(tabellaSintesiComponentiAltri.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
larghezzaSpazioTestoPercentuale = larghezzaMinimaSpazioTestoPercentuale;
|
|
}
|
|
|
|
tabellaSintesiComponentiAltri.Cells[1, i].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new RectanglePDF(20, larghezzaBarra , colore),
|
|
new FormattedTextAreaPDF(row["Diversificazione"].ToString()=="0.00"? "0.00" : Helper.FormatDecimal(Convert.ToDecimal(row["Diversificazione"]).ToString(), 2),
|
|
0,
|
|
larghezzaSpazioTestoPercentuale)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextVerticalAlign = ceTe.DynamicPDF.VAlign.Center,
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7
|
|
}
|
|
};
|
|
i++;
|
|
}
|
|
|
|
AddElement(tabellaSintesiComponentiAltri);
|
|
//ASSE X
|
|
//axisWidth = Helper.GetWidthProportional(100, valoreMassimo, tabellaSintesiComponentiAltri.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
//XAxisDraw(210, 210 + axisWidth);
|
|
|
|
//ASSE X
|
|
axisWidth = Helper.GetWidthProportional(100, valoreMassimo, tabellaSintesiComponentiAltri.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
XAxisDraw(210, Y2TabellaSintesiComponentiAltri, 210 + axisWidth, Y2TabellaSintesiComponentiAltri + 2);
|
|
|
|
//ASSE Y
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y1TabellaSintesiComponentiAltri + 2, EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y2TabellaSintesiComponentiAltri + 2, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
}
|
|
#endregion
|
|
|
|
#endregion Tabella Sintesi Componenti altri Istituti
|
|
|
|
#region Tabella Sintesi Componenti Complessivo
|
|
|
|
AddElement(new SpacePDF(20));
|
|
//AddElement(new FormattedTextAreaPDF(String.Format("Patrimonio Complessivo(€){0} {1}", _asteriscoComplessivo, Helper.FormatCurrency(patrimonioComplessivo.ToString())), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
AddElement(new FormattedTextAreaPDF(String.Format("Patrimonio Complessivo(€){0}", _asteriscoComplessivo), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF(Helper.FormatCurrency(patrimonioComplessivo), EnvironmentFacade.RendererFacade.XLeftLimit + 220) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
AddElement(new SpacePDF(10));
|
|
|
|
if (dati.Tables["SintesiComponentiComplessivo"].Rows.Count > 0)
|
|
{
|
|
#region Definizione e Creazione
|
|
var tabellaSintesiComponentiComplessivo = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["SintesiComponentiComplessivo"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = true,
|
|
RowHeight = 30,
|
|
Footer = false,
|
|
HeaderHeight = 30,
|
|
HideLastSeparationLine = false,
|
|
AdditionalSpaceBetweenHeadersAndTable = 3
|
|
};
|
|
|
|
tabellaSintesiComponentiComplessivo.Columns.Add(new ColumnPDF("Componente", 210, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Componente", "Componenti diversificazione di portafoglio") { HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 6 });
|
|
tabellaSintesiComponentiComplessivo.Columns.Add(new ColumnPDF("DiversificazioneObject", 310, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Objectpdf, "Diversificazione", "Diversificazione") { VerticalAlignment = VerticalAlignmentType.Centrato, HeaderFontSize = 7, FontSize = 7, DeltaYContent = 6, HeaderPaddingLeft = 10 });
|
|
#endregion
|
|
|
|
#region Creazione Stacked Bar
|
|
i = 0;
|
|
list = new List<double>();
|
|
list.Add(Convert.ToDouble(dati.Tables["SintesiComponentiComplessivo"].AsEnumerable().Max(x => x["Diversificazione"])));
|
|
//valoreMassimo = (float)Helper.Round(list.Max());
|
|
valoreMassimo = 100;
|
|
larghezzaBarra = 0;
|
|
larghezzaSpazioTestoPercentuale = 0;
|
|
larghezzaMinimaSpazioTestoPercentuale = 35;
|
|
deltaXBarra = 0;
|
|
foreach (DataRow row in dati.Tables["SintesiComponentiComplessivo"].Rows)
|
|
{
|
|
//Verde
|
|
var colore = new ColorPDF(124, 163, 73);
|
|
|
|
//larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaSintesiComponentiComplessivo.Columns[1].Width - 50);
|
|
larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaSintesiComponentiComplessivo.Columns[1].Width - 35);
|
|
larghezzaSpazioTestoPercentuale = tabellaSintesiComponentiComplessivo.Columns[1].Width - larghezzaBarra;
|
|
deltaXBarra = larghezzaBarra + 10;
|
|
if (larghezzaSpazioTestoPercentuale < larghezzaMinimaSpazioTestoPercentuale)
|
|
{
|
|
deltaXBarra = -(tabellaSintesiComponentiComplessivo.Columns[3].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
larghezzaSpazioTestoPercentuale = larghezzaMinimaSpazioTestoPercentuale;
|
|
}
|
|
|
|
tabellaSintesiComponentiComplessivo.Cells[1, i].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new RectanglePDF(20, larghezzaBarra , colore),
|
|
new FormattedTextAreaPDF(row["Diversificazione"].ToString()=="0.00"? "0.00" : Helper.FormatDecimal(Convert.ToDecimal(row["Diversificazione"]).ToString(), 2),
|
|
0,
|
|
larghezzaSpazioTestoPercentuale)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextVerticalAlign = ceTe.DynamicPDF.VAlign.Center,
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7
|
|
}
|
|
};
|
|
i++;
|
|
}
|
|
|
|
AddElement(tabellaSintesiComponentiComplessivo);
|
|
//ASSE X
|
|
axisWidth = Helper.GetWidthProportional(100, valoreMassimo, tabellaSintesiComponentiComplessivo.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
XAxisDraw(210, Y2TabellaSintesiComponentiComplessivo, 210 + axisWidth, Y2TabellaSintesiComponentiComplessivo + 2);
|
|
|
|
//ASSE Y
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y1TabellaSintesiComponentiComplessivo + 2, EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y2TabellaSintesiComponentiComplessivo + 2, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
}
|
|
#endregion
|
|
|
|
#endregion Tabella Sintesi Componenti Complessivo
|
|
}
|
|
#endregion Tabella Sintesi Componenti altri Istituti e Complessivo
|
|
|
|
#region Nota a pie' pagina
|
|
if (_stampaNota)
|
|
{
|
|
AddElement(new SpacePDF(15));
|
|
//AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 680, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
}
|
|
#endregion Nota a pie' pagina
|
|
|
|
#endregion Sezione Sintesi Componenti
|
|
|
|
}
|
|
else
|
|
{
|
|
#region Nota a pie' pagina
|
|
//if (_stampaNota)
|
|
//{
|
|
// AddElement(new SpacePDF(15));
|
|
// if (_visualizzaAltriIstituti) //Se ci sono anche le righe di Altri istituti e Complessivo la nota va più in basso
|
|
// AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 380, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
// else
|
|
// AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 280, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
//}
|
|
#endregion Nota a pie' pagina
|
|
}
|
|
|
|
#region Sezione Dettaglio Componenti
|
|
|
|
if (_visualizzaDettaglioComponenti)
|
|
{
|
|
#region Cambio pagina
|
|
//if (_stampaNota)
|
|
//{
|
|
// AddElement(new SpacePDF(15));
|
|
// //AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
// AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 680, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
//}
|
|
|
|
AddElement(new PagePDF());
|
|
#endregion Cambio pagina
|
|
|
|
#region Titolo e Testo Introduttivo
|
|
|
|
AddElement(new SpacePDF(20));
|
|
|
|
string titoloDettaglio = "Dettaglio delle componenti di diversificazione";
|
|
|
|
AddElement(new FormattedTextAreaPDF(titoloDettaglio, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 10, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(20));
|
|
|
|
string testoIntroDettaglio = string.Empty;
|
|
|
|
if (_visualizzaAltriIstituti)
|
|
testoIntroDettaglio = testi.Rows[0]["testo5"].ToString();
|
|
else
|
|
testoIntroDettaglio = testi.Rows[0]["testo6"].ToString();
|
|
|
|
testoIntroDettaglio = Helper.ReplaceVariables(testoIntroDettaglio, EnvironmentFacade.ReportEnvironment);
|
|
|
|
AddElement(new FormattedTextAreaPDF(testoIntroDettaglio, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(20));
|
|
|
|
#endregion Titolo e Testo Introduttivo
|
|
|
|
#region Tabella Dettaglio Componenti Fideuram
|
|
|
|
//AddElement(new FormattedTextAreaPDF(String.Format("Patrimonio Fideuram(€){0}\t{1}", _asteriscoFideuram, Helper.FormatCurrency(patrimonioFideuram.ToString())), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
AddElement(new FormattedTextAreaPDF(String.Format(datiSeiUnico.FormatBanca("Patrimonio $/Banca/$(€){0}"), _asteriscoFideuram), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF(Helper.FormatCurrency(patrimonioFideuram.ToString()), EnvironmentFacade.RendererFacade.XLeftLimit + 220) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
AddElement(new SpacePDF(10));
|
|
|
|
//*********************1******************
|
|
if (dati.Tables["DettaglioComponentiFideuram"].Rows.Count > 0)
|
|
{
|
|
#region Definizione e Creazione
|
|
var tabellaDettaglioComponentiFideuram = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["DettaglioComponentiFideuram"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = true,
|
|
RowHeight = 30,
|
|
Footer = false,
|
|
HeaderHeight = 30,
|
|
HideLastSeparationLine = false,
|
|
AdditionalSpaceBetweenHeadersAndTable = 3
|
|
};
|
|
|
|
tabellaDettaglioComponentiFideuram.Columns.Add(new ColumnPDF("Componente", 210, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Componente", "Componenti diversificazione di portafoglio") { HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaDettaglioComponentiFideuram.Columns.Add(new ColumnPDF("DiversificazioneObject", 310, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Objectpdf, "Diversificazione", "Diversificazione") { VerticalAlignment = VerticalAlignmentType.Centrato, HeaderFontSize = 7, FontSize = 7, DeltaYContent = 6, HeaderPaddingLeft = 50 });
|
|
|
|
#endregion
|
|
|
|
#region Creazione Stacked Bar
|
|
i = 0;
|
|
list = new List<double>();
|
|
list.Add(Convert.ToDouble(dati.Tables["DettaglioComponentiFideuram"].AsEnumerable().Max(x => x["Diversificazione"])));
|
|
//valoreMassimo = (float)Helper.Round(list.Max());
|
|
valoreMassimo = 100;
|
|
larghezzaBarra = 0;
|
|
larghezzaSpazioTestoPercentuale = 0;
|
|
larghezzaMinimaSpazioTestoPercentuale = 35;
|
|
deltaXBarra = 0;
|
|
foreach (DataRow row in dati.Tables["DettaglioComponentiFideuram"].Rows)
|
|
{
|
|
//Arancione
|
|
var colore = new ColorPDF(255, 165, 0);
|
|
|
|
tabellaDettaglioComponentiFideuram.Row[i].BackgroundGray = Convert.ToBoolean(row["IsHeader"].ToString());
|
|
tabellaDettaglioComponentiFideuram.Row[i].FontBold = Convert.ToBoolean(row["IsHeader"].ToString());
|
|
tabellaDettaglioComponentiFideuram.Row[i].ForceStyleFontBold = Convert.ToBoolean(row["IsHeader"].ToString());
|
|
if (!Convert.ToBoolean(row["IsHeader"].ToString()))
|
|
tabellaDettaglioComponentiFideuram.Cells[0, i].XContentOffset = 20;
|
|
|
|
//larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaDettaglioComponentiFideuram.Columns[1].Width - 50);
|
|
larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaDettaglioComponentiFideuram.Columns[1].Width - 35);
|
|
|
|
larghezzaSpazioTestoPercentuale = tabellaDettaglioComponentiFideuram.Columns[1].Width - larghezzaBarra;
|
|
deltaXBarra = larghezzaBarra + 10;
|
|
if (larghezzaSpazioTestoPercentuale < larghezzaMinimaSpazioTestoPercentuale)
|
|
{
|
|
deltaXBarra = -(tabellaDettaglioComponentiFideuram.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
larghezzaSpazioTestoPercentuale = larghezzaMinimaSpazioTestoPercentuale;
|
|
}
|
|
|
|
tabellaDettaglioComponentiFideuram.Cells[1, i].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new RectanglePDF(20, larghezzaBarra , colore),
|
|
new FormattedTextAreaPDF(row["Diversificazione"].ToString()=="0.00"? "0.00" : Helper.FormatDecimal(Convert.ToDecimal(row["Diversificazione"]).ToString(), 2),
|
|
0,
|
|
larghezzaSpazioTestoPercentuale)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextVerticalAlign = ceTe.DynamicPDF.VAlign.Center,
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7,
|
|
FontBold = Convert.ToBoolean(row["IsHeader"].ToString())
|
|
}
|
|
};
|
|
i++;
|
|
}
|
|
#endregion
|
|
|
|
AddElement(tabellaDettaglioComponentiFideuram);
|
|
|
|
//ASSE X
|
|
axisWidth = Helper.GetWidthProportional(100, valoreMassimo, tabellaDettaglioComponentiFideuram.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
XAxisDraw(210, Y2TabellaDettaglioComponentiFideuram, 210 + axisWidth, Y2TabellaDettaglioComponentiFideuram + 2);
|
|
|
|
//ASSE Y
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y1TabellaDettaglioComponentiFideuram + 2, EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y2TabellaDettaglioComponentiFideuram + 2, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
}
|
|
|
|
if (_stampaNota)
|
|
{
|
|
//AddElement(new SpacePDF(15));
|
|
//AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 680, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
}
|
|
|
|
#endregion Tabella Dettaglio Componenti Fideuram
|
|
|
|
#region Tabella Dettaglio Componenti altri Istituti e Complessivo
|
|
|
|
if (_visualizzaAltriIstituti)
|
|
{
|
|
#region Nota a pie' pagina e cambio pagina
|
|
// COMMENTATO ES
|
|
//if (_stampaNota)
|
|
//{
|
|
// //AddElement(new SpacePDF(15));
|
|
// //AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
// AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 680, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
//}
|
|
|
|
AddElement(new ImagePDF(435, 0.15F, "changepage.png") { Y = 745 - 5, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF("continua alla pagina successiva", 450, 200) { Y = 745 - 5, AutoIncrementYWritable = false, FontSize = 6, AbsolutePosition = true });
|
|
|
|
AddElement(new PagePDF());
|
|
#endregion Nota a pie' pagina e cambio pagina
|
|
|
|
#region Tabella Dettaglio Componenti altri Istituti
|
|
|
|
AddElement(new SpacePDF(2));
|
|
|
|
AddElement(new ImagePDF(37, 0.15F, "changepage.png") { AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF("continua dalla pagina precedente", 37 + 15, 200) { FontSize = 6, AutoIncrementYWritable = true });
|
|
|
|
AddElement(new SpacePDF(20));
|
|
//AddElement(new FormattedTextAreaPDF(String.Format("Patrimonio altri Istituti(€){0} {1}", _asteriscoAltri, Helper.FormatCurrency(patrimonioAltri.ToString())), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new FormattedTextAreaPDF(String.Format("Patrimonio altri Istituti(€){0}", _asteriscoAltri), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF(Helper.FormatCurrency(patrimonioAltri.ToString()), EnvironmentFacade.RendererFacade.XLeftLimit + 220) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
AddElement(new SpacePDF(10));
|
|
|
|
#endregion Tabella Dettaglio Componenti altri Istituti
|
|
|
|
//*********************2**********************
|
|
if (dati.Tables["DettaglioComponentiAltri"].Rows.Count > 0)
|
|
{
|
|
#region Definizione e Creazione
|
|
var tabellaDettaglioComponentiAltri = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["DettaglioComponentiAltri"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = true,
|
|
RowHeight = 30,
|
|
Footer = false,
|
|
HeaderHeight = 30,
|
|
HideLastSeparationLine = false,
|
|
AdditionalSpaceBetweenHeadersAndTable = 3
|
|
};
|
|
|
|
tabellaDettaglioComponentiAltri.Columns.Add(new ColumnPDF("Componente", 210, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Componente", "Componenti diversificazione di portafoglio") { HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaDettaglioComponentiAltri.Columns.Add(new ColumnPDF("DiversificazioneObject", 310, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Objectpdf, "Diversificazione", "Diversificazione") { VerticalAlignment = VerticalAlignmentType.Centrato, HeaderFontSize = 7, FontSize = 7, DeltaYContent = 6, HeaderPaddingLeft = 50 });
|
|
|
|
#endregion
|
|
|
|
#region Creazione Stacked Bar
|
|
i = 0;
|
|
list = new List<double>();
|
|
list.Add(Convert.ToDouble(dati.Tables["DettaglioComponentiAltri"].AsEnumerable().Max(x => x["Diversificazione"])));
|
|
//valoreMassimo = (float)Helper.Round(list.Max());
|
|
valoreMassimo = 100;
|
|
larghezzaBarra = 0;
|
|
larghezzaSpazioTestoPercentuale = 0;
|
|
larghezzaMinimaSpazioTestoPercentuale = 35;
|
|
deltaXBarra = 0;
|
|
foreach (DataRow row in dati.Tables["DettaglioComponentiAltri"].Rows)
|
|
{
|
|
//Blu
|
|
var colore = new ColorPDF(32, 114, 156);
|
|
|
|
tabellaDettaglioComponentiAltri.Row[i].BackgroundGray = Convert.ToBoolean(row["IsHeader"].ToString());
|
|
tabellaDettaglioComponentiAltri.Row[i].FontBold = Convert.ToBoolean(row["IsHeader"].ToString());
|
|
tabellaDettaglioComponentiAltri.Row[i].ForceStyleFontBold = Convert.ToBoolean(row["IsHeader"].ToString());
|
|
if (!Convert.ToBoolean(row["IsHeader"].ToString()))
|
|
tabellaDettaglioComponentiAltri.Cells[0, i].XContentOffset = 20;
|
|
|
|
//larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaDettaglioComponentiAltri.Columns[1].Width - 50);
|
|
larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaDettaglioComponentiAltri.Columns[1].Width - 35);
|
|
larghezzaSpazioTestoPercentuale = tabellaDettaglioComponentiAltri.Columns[1].Width - larghezzaBarra;
|
|
deltaXBarra = larghezzaBarra + 10;
|
|
if (larghezzaSpazioTestoPercentuale < larghezzaMinimaSpazioTestoPercentuale)
|
|
{
|
|
deltaXBarra = -(tabellaDettaglioComponentiAltri.Columns[3].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
larghezzaSpazioTestoPercentuale = larghezzaMinimaSpazioTestoPercentuale;
|
|
}
|
|
|
|
tabellaDettaglioComponentiAltri.Cells[1, i].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new RectanglePDF(20, larghezzaBarra , colore),
|
|
new FormattedTextAreaPDF(row["Diversificazione"].ToString()=="0.00"? "0.00" : Helper.FormatDecimal(Convert.ToDecimal(row["Diversificazione"]).ToString(), 2),
|
|
0,
|
|
larghezzaSpazioTestoPercentuale)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextVerticalAlign = ceTe.DynamicPDF.VAlign.Center,
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7,
|
|
FontBold = Convert.ToBoolean(row["IsHeader"].ToString())
|
|
}
|
|
};
|
|
i++;
|
|
}
|
|
#endregion
|
|
|
|
AddElement(tabellaDettaglioComponentiAltri);
|
|
|
|
//ASSE X
|
|
axisWidth = Helper.GetWidthProportional(100, valoreMassimo, tabellaDettaglioComponentiAltri.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
XAxisDraw(210, Y2TabellaDettaglioComponentiAltri, 210 + axisWidth, Y2TabellaDettaglioComponentiAltri + 2);
|
|
|
|
//ASSE Y
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y1TabellaDettaglioComponentiAltri + 2, EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y2TabellaDettaglioComponentiAltri + 2, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
}
|
|
|
|
#region Tabella Dettaglio Componenti Complessivo
|
|
|
|
#region Nota a pie' pagina e cambio pagina
|
|
if (_stampaNota)
|
|
{
|
|
//AddElement(new SpacePDF(15));
|
|
//AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 680, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
}
|
|
|
|
AddElement(new ImagePDF(435, 0.15F, "changepage.png") { Y = 745 - 5, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF("continua alla pagina successiva", 450, 200) { Y = 745 - 5, AutoIncrementYWritable = false, FontSize = 6, AbsolutePosition = true });
|
|
|
|
AddElement(new PagePDF());
|
|
#endregion Nota a pie' pagina e cambio pagina
|
|
|
|
AddElement(new SpacePDF(2));
|
|
|
|
AddElement(new ImagePDF(37, 0.15F, "changepage.png") { AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF("continua dalla pagina precedente", 37 + 15, 200) { FontSize = 6, AutoIncrementYWritable = true });
|
|
|
|
AddElement(new SpacePDF(20));
|
|
|
|
//AddElement(new FormattedTextAreaPDF(String.Format("Patrimonio Complessivo(€){0} {1}", _asteriscoComplessivo, Helper.FormatCurrency(patrimonioComplessivo.ToString())), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new FormattedTextAreaPDF(String.Format("Patrimonio Complessivo(€){0}", _asteriscoComplessivo), EnvironmentFacade.RendererFacade.XLeftLimit + 10) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF(Helper.FormatCurrency(patrimonioComplessivo.ToString()), EnvironmentFacade.RendererFacade.XLeftLimit + 220) { FontSize = 7, FontBold = true, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
AddElement(new SpacePDF(10));
|
|
|
|
//*********************3***********************
|
|
if (dati.Tables["DettaglioComponentiComplessivo"].Rows.Count > 0)
|
|
{
|
|
#region Definizione e Creazione
|
|
var tabellaDettaglioComponentiComplessivo = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["DettaglioComponentiComplessivo"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = true,
|
|
RowHeight = 30,
|
|
Footer = false,
|
|
HeaderHeight = 30,
|
|
HideLastSeparationLine = false,
|
|
AdditionalSpaceBetweenHeadersAndTable = 3
|
|
};
|
|
|
|
tabellaDettaglioComponentiComplessivo.Columns.Add(new ColumnPDF("Componente", 210, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Componente", "Componenti diversificazione di portafoglio") { HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaDettaglioComponentiComplessivo.Columns.Add(new ColumnPDF("DiversificazioneObject", 310, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Objectpdf, "Diversificazione", "Diversificazione") { VerticalAlignment = VerticalAlignmentType.Centrato, HeaderFontSize = 7, FontSize = 7, DeltaYContent = 6, HeaderPaddingLeft = 50 });
|
|
|
|
#endregion
|
|
|
|
#region Creazione Stacked Bar
|
|
i = 0;
|
|
list = new List<double>();
|
|
list.Add(Convert.ToDouble(dati.Tables["DettaglioComponentiComplessivo"].AsEnumerable().Max(x => x["Diversificazione"])));
|
|
//valoreMassimo = (float)Helper.Round(list.Max());
|
|
valoreMassimo = 100;
|
|
larghezzaBarra = 0;
|
|
larghezzaSpazioTestoPercentuale = 0;
|
|
larghezzaMinimaSpazioTestoPercentuale = 35;
|
|
deltaXBarra = 0;
|
|
foreach (DataRow row in dati.Tables["DettaglioComponentiComplessivo"].Rows)
|
|
{
|
|
//Verde
|
|
var colore = new ColorPDF(124, 163, 73);
|
|
|
|
tabellaDettaglioComponentiComplessivo.Row[i].BackgroundGray = Convert.ToBoolean(row["IsHeader"].ToString());
|
|
tabellaDettaglioComponentiComplessivo.Row[i].FontBold = Convert.ToBoolean(row["IsHeader"].ToString());
|
|
tabellaDettaglioComponentiComplessivo.Row[i].ForceStyleFontBold = Convert.ToBoolean(row["IsHeader"].ToString());
|
|
if (!Convert.ToBoolean(row["IsHeader"].ToString()))
|
|
tabellaDettaglioComponentiComplessivo.Cells[0, i].XContentOffset = 20;
|
|
|
|
//larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaDettaglioComponentiComplessivo.Columns[1].Width - 50);
|
|
larghezzaBarra = Helper.GetWidthProportional((float)Convert.ToDecimal(row["Diversificazione"]), valoreMassimo, tabellaDettaglioComponentiComplessivo.Columns[1].Width - 35);
|
|
larghezzaSpazioTestoPercentuale = tabellaDettaglioComponentiComplessivo.Columns[1].Width - larghezzaBarra;
|
|
deltaXBarra = larghezzaBarra + 10;
|
|
if (larghezzaSpazioTestoPercentuale < larghezzaMinimaSpazioTestoPercentuale)
|
|
{
|
|
deltaXBarra = -(tabellaDettaglioComponentiComplessivo.Columns[3].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
larghezzaSpazioTestoPercentuale = larghezzaMinimaSpazioTestoPercentuale;
|
|
}
|
|
|
|
tabellaDettaglioComponentiComplessivo.Cells[1, i].ValueObjectList = new List<Business.Entity.ObjectPDF>()
|
|
{
|
|
new RectanglePDF(20, larghezzaBarra , colore),
|
|
new FormattedTextAreaPDF(row["Diversificazione"].ToString()=="0.00"? "0.00" : Helper.FormatDecimal(Convert.ToDecimal(row["Diversificazione"]).ToString(), 2),
|
|
0,
|
|
larghezzaSpazioTestoPercentuale)
|
|
{
|
|
DeltaY = 3,
|
|
TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left,
|
|
TextVerticalAlign = ceTe.DynamicPDF.VAlign.Center,
|
|
DeltaX = deltaXBarra,
|
|
FontSize = 7,
|
|
FontBold = Convert.ToBoolean(row["IsHeader"].ToString())
|
|
}
|
|
};
|
|
i++;
|
|
}
|
|
#endregion
|
|
|
|
AddElement(tabellaDettaglioComponentiComplessivo);
|
|
|
|
//ASSE X
|
|
axisWidth = Helper.GetWidthProportional(100, valoreMassimo, tabellaDettaglioComponentiComplessivo.Columns[1].Width - larghezzaMinimaSpazioTestoPercentuale);
|
|
XAxisDraw(210, Y2TabellaDettaglioComponentiComplessivo, 210 + axisWidth, Y2TabellaDettaglioComponentiComplessivo + 2);
|
|
|
|
//ASSE Y
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y1TabellaDettaglioComponentiComplessivo + 2, EnvironmentFacade.RendererFacade.XLeftLimit + 210 - 1, Y2TabellaDettaglioComponentiComplessivo + 2, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
}
|
|
|
|
if (_stampaNota)
|
|
{
|
|
//AddElement(new SpacePDF(15));
|
|
//AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 680, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
}
|
|
|
|
#endregion Tabella Dettaglio Componenti Complessivo
|
|
}
|
|
}
|
|
#endregion Tabella Dettaglio Componenti altri Istituti e Complessivo
|
|
|
|
#endregion Sezione Dettaglio Componenti
|
|
|
|
#region Nota a pie' pagina
|
|
// COMMENTATO ES
|
|
//if (_stampaNota)
|
|
//{
|
|
// //AddElement(new SpacePDF(15));
|
|
// //AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
// AddElement(new FormattedTextAreaPDF(string.Format("{0}", nota), EnvironmentFacade.RendererFacade.XLeftLimit) { Y = 680, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, AutoIncrementYWritable = false, FontSize = 7, AbsolutePosition = true });
|
|
//}
|
|
#endregion Nota a pie' pagina
|
|
}
|
|
|
|
/// <summary>
|
|
/// Recupera i dati necessari alla Section restituendo un DataTable.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
protected sealed override DataTable GetDataTable()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Recupera i dati necessari alla Section restituendo un DataSet.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
protected sealed override DataSet GetDataSet()
|
|
{
|
|
var rete = EnvironmentFacade.ReportEnvironment.PrivateBanker.CodiceRete;
|
|
|
|
var ds = new DataSet();
|
|
var rischio = datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito;
|
|
|
|
//Adriano 20180125 Per eliminare la gestione profilazione per i nuclei (non più gestita nel WS)
|
|
int profilo;
|
|
decimal varMassimoProfiloCliente;
|
|
|
|
if (EnvironmentFacade.ReportEnvironment.ReportId == 6)
|
|
{
|
|
profilo = 5;
|
|
varMassimoProfiloCliente = rischio.soglieMassime.FirstOrDefault(o => o.key == profilo).value.varMax;
|
|
}
|
|
else
|
|
{
|
|
profilo = rischio.profileId;
|
|
varMassimoProfiloCliente = rischio.soglieMassime.FirstOrDefault(o => o.key == profilo).value.varMax;
|
|
}
|
|
|
|
//var profilo = rischio.profileId;
|
|
//var varMassimoProfiloCliente = rischio.soglieMassime.FirstOrDefault(o => o.key == profilo).value.varMax;
|
|
//Adriano 20180125
|
|
|
|
var totCasa = datiSeiUnico.rischioUnit().rischio.rischioCreditoConcetrazione.totaliFideuram;
|
|
var totTerzi = datiSeiUnico.rischioUnit().rischio.rischioCreditoConcetrazione.totaliAltriIstituti;
|
|
|
|
var totalePatrimonioCasa = totCasa.risorseFinanziarie + totCasa.partiteViaggianti;
|
|
var totalePatrimonioTerzi = totTerzi.risorseFinanziarie;
|
|
var totalePatrimonioFinanziario = totCasa.risorseFinanziarie + totCasa.partiteViaggianti + totTerzi.risorseFinanziarie;
|
|
|
|
var rischioFideuram = rischio.bancaFideuram;
|
|
var rischioAltriIstituti = rischio.altriIstituti;
|
|
var rischioComplessivo = rischio.totale;
|
|
_presenzaNotaEccessivaAdeguatezza = rischio.eccessivamenteAdeguato;
|
|
|
|
#region DataTable Portafoglio
|
|
|
|
ds.Tables.Add(new DataTable("Portafoglio"));
|
|
|
|
ds.Tables["Portafoglio"].Columns.Add(new DataColumn("Patrimonio", typeof(string)));
|
|
ds.Tables["Portafoglio"].Columns.Add(new DataColumn("ControvaloreAttuale", typeof(decimal)));
|
|
ds.Tables["Portafoglio"].Columns.Add(new DataColumn("GradoCopertura", typeof(decimal)));
|
|
ds.Tables["Portafoglio"].Columns.Add(new DataColumn("Diversificazione", typeof(decimal)));
|
|
ds.Tables["Portafoglio"].Columns.Add(new DataColumn("Red", typeof(int)));
|
|
ds.Tables["Portafoglio"].Columns.Add(new DataColumn("Green", typeof(int)));
|
|
ds.Tables["Portafoglio"].Columns.Add(new DataColumn("Blue", typeof(int)));
|
|
|
|
//ds.Tables["Portafoglio"].Rows.Add("Patrimonio Fideuram", 437313.39, 100, 100, 237, 125, 49);
|
|
|
|
// ES 20180517
|
|
if (totalePatrimonioCasa == 0)
|
|
ds.Tables["Portafoglio"].Rows.Add(datiSeiUnico.FormatBanca("Patrimonio $/Banca/$"), totalePatrimonioCasa, rischioFideuram.stat.copertura, 0, 255, 165, 0);
|
|
else
|
|
ds.Tables["Portafoglio"].Rows.Add(datiSeiUnico.FormatBanca("Patrimonio $/Banca/$"), totalePatrimonioCasa, rischioFideuram.stat.copertura, datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("BENEFICIO")).value, 255, 165, 0);
|
|
// Fine ES
|
|
|
|
//ds.Tables["Portafoglio"].Rows.Add("Patrimonio altri Istituti", 1827156.37, 77.98, 58, 68, 114, 196);
|
|
if (_visualizzaAltriIstituti)
|
|
{
|
|
ds.Tables["Portafoglio"].Rows.Add("Patrimonio altri Istituti", totalePatrimonioTerzi,
|
|
rischioAltriIstituti == null ?
|
|
0 : rischioAltriIstituti.stat.copertura,
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("BENEFICIO")).value
|
|
: 0, 32, 114, 156);
|
|
//ds.Tables["Portafoglio"].Rows.Add("Patrimonio Complessivo", 2264469.76, 83.79, 64, 112, 173, 71);
|
|
ds.Tables["Portafoglio"].Rows.Add("Patrimonio Complessivo", totalePatrimonioFinanziario,
|
|
rischioComplessivo == null ?
|
|
0 : rischioComplessivo.stat.copertura,
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("BENEFICIO")).value
|
|
: 0, 124, 163, 73);
|
|
}
|
|
else
|
|
{
|
|
ds.Tables["Portafoglio"].Rows.Add("Patrimonio altri Istituti", totalePatrimonioTerzi, rischioAltriIstituti == null ? 0 : rischioAltriIstituti.stat.copertura, 0, 32, 114, 156);
|
|
//ds.Tables["Portafoglio"].Rows.Add("Patrimonio Complessivo", 2264469.76, 83.79, 64, 112, 173, 71);
|
|
ds.Tables["Portafoglio"].Rows.Add("Patrimonio Complessivo", totalePatrimonioFinanziario, rischioComplessivo == null ? 0 : rischioComplessivo.stat.copertura, 0, 124, 163, 73);
|
|
|
|
}
|
|
#endregion DataTable Portafoglio
|
|
|
|
#region DataTable SintesiComponentiFideuram
|
|
|
|
ds.Tables.Add(new DataTable("SintesiComponentiFideuram"));
|
|
|
|
ds.Tables["SintesiComponentiFideuram"].Columns.Add("Componente", typeof(string));
|
|
ds.Tables["SintesiComponentiFideuram"].Columns.Add("Diversificazione", typeof(decimal));
|
|
|
|
// ES 20180517
|
|
if (totalePatrimonioCasa == 0)
|
|
{
|
|
ds.Tables["SintesiComponentiFideuram"].Rows.Add("Diversificazione del rischio mercato", 0);
|
|
ds.Tables["SintesiComponentiFideuram"].Rows.Add("Diversificazione del rischio credito", 0);
|
|
ds.Tables["SintesiComponentiFideuram"].Rows.Add("Diversificazione del rischio concentrazione", 0);
|
|
}
|
|
else
|
|
{
|
|
//ds.Tables["SintesiComponentiFideuram"].Rows.Add("Diversificazione del rischio mercato", 100);
|
|
ds.Tables["SintesiComponentiFideuram"].Rows.Add("Diversificazione del rischio mercato", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATO")).value);
|
|
//ds.Tables["SintesiComponentiFideuram"].Rows.Add("Diversificazione del rischio credito", 60);
|
|
ds.Tables["SintesiComponentiFideuram"].Rows.Add("Diversificazione del rischio credito", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITO")).value);
|
|
//ds.Tables["SintesiComponentiFideuram"].Rows.Add("Diversificazione del rischio concentrazione", 30);
|
|
ds.Tables["SintesiComponentiFideuram"].Rows.Add("Diversificazione del rischio concentrazione", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONECONCENTRAZIONE")).value);
|
|
}
|
|
// Fine ES
|
|
|
|
#endregion DataTable SintesiComponentiFideuram
|
|
|
|
|
|
#region DataTable SintesiComponentiAltri
|
|
|
|
ds.Tables.Add(new DataTable("SintesiComponentiAltri"));
|
|
|
|
ds.Tables["SintesiComponentiAltri"].Columns.Add("Componente", typeof(string));
|
|
ds.Tables["SintesiComponentiAltri"].Columns.Add("Diversificazione", typeof(decimal));
|
|
|
|
if (_visualizzaAltriIstituti)
|
|
{
|
|
//ds.Tables["SintesiComponentiAltri"].Rows.Add("Diversificazione del rischio mercato", 60);
|
|
ds.Tables["SintesiComponentiAltri"].Rows.Add("Diversificazione del rischio mercato",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATO")).value
|
|
: 0);
|
|
//ds.Tables["SintesiComponentiAltri"].Rows.Add("Diversificazione del rischio credito", 30);
|
|
|
|
ds.Tables["SintesiComponentiAltri"].Rows.Add("Diversificazione del rischio credito",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITO")).value
|
|
: 0);
|
|
//ds.Tables["SintesiComponentiAltri"].Rows.Add("Diversificazione del rischio concentrazione", 10);
|
|
ds.Tables["SintesiComponentiAltri"].Rows.Add("Diversificazione del rischio concentrazione",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONECONCENTRAZIONE")).value
|
|
: 0);
|
|
}
|
|
#endregion DataTable SintesiComponentiAltri
|
|
|
|
#region DataTable SintesiComponentiComplessivo
|
|
|
|
ds.Tables.Add(new DataTable("SintesiComponentiComplessivo"));
|
|
|
|
ds.Tables["SintesiComponentiComplessivo"].Columns.Add("Componente", typeof(string));
|
|
ds.Tables["SintesiComponentiComplessivo"].Columns.Add("Diversificazione", typeof(decimal));
|
|
|
|
if (_visualizzaAltriIstituti)
|
|
{
|
|
//ds.Tables["SintesiComponentiComplessivo"].Rows.Add("Diversificazione del rischio mercato", 73);
|
|
ds.Tables["SintesiComponentiComplessivo"].Rows.Add("Diversificazione del rischio mercato",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATO")).value
|
|
: 0);
|
|
//ds.Tables["SintesiComponentiComplessivo"].Rows.Add("Diversificazione del rischio credito", 55);
|
|
ds.Tables["SintesiComponentiComplessivo"].Rows.Add("Diversificazione del rischio credito",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITO")).value
|
|
: 0);
|
|
//ds.Tables["SintesiComponentiComplessivo"].Rows.Add("Diversificazione del rischio concentrazione", 24);
|
|
ds.Tables["SintesiComponentiComplessivo"].Rows.Add("Diversificazione del rischio concentrazione",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONECONCENTRAZIONE")).value
|
|
: 0);
|
|
}
|
|
|
|
#endregion DataTable SintesiComponentiComplessivo
|
|
|
|
#region DataTable DettaglioComponentiFideuram
|
|
|
|
ds.Tables.Add(new DataTable("DettaglioComponentiFideuram"));
|
|
|
|
ds.Tables["DettaglioComponentiFideuram"].Columns.Add("Componente", typeof(string));
|
|
ds.Tables["DettaglioComponentiFideuram"].Columns.Add("Diversificazione", typeof(decimal));
|
|
ds.Tables["DettaglioComponentiFideuram"].Columns.Add("IsHeader", typeof(bool));
|
|
|
|
if (totalePatrimonioCasa == 0)
|
|
{
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("Diversificazione del rischio mercato", 0, true);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("breve periodo", 0, false);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("lungo periodo", 0, false);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("Diversificazione del rischio credito", 0, true);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("risparmio gestito", 0, false);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("risparmio amministrato", 0, false);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("Diversificazione del rischio concentrazione", 0, true);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("case di investimento", 0, false);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("numerosità titoli", 0, false);
|
|
}
|
|
else
|
|
{
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("Diversificazione del rischio mercato", 90, true);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("Diversificazione del rischio mercato", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATO")).value, true);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("breve periodo", 86, false);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("breve periodo", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATOBREVEPERIODO")).value, false);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("lungo periodo", 95, false);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("lungo periodo", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATOLUNGOPERIODO")).value, false);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("Diversificazione del rischio credito", 60, true);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("Diversificazione del rischio credito", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITO")).value, true);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("risparmio gestito", 100, false);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("risparmio gestito", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITOGESTITO")).value, false);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("risparmio amministrato", 20, false);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("risparmio amministrato", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITOAMMINISTRATI")).value, false);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("Diversificazione del rischio concentrazione", 30, true);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("Diversificazione del rischio concentrazione", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONECONCENTRAZIONE")).value, true);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("case di investimento", 40, false);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("case di investimento", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONECASEINVESTIMENTO")).value, false);
|
|
//ds.Tables["DettaglioComponentiFideuram"].Rows.Add("numerosità titoli", 20, false);
|
|
ds.Tables["DettaglioComponentiFideuram"].Rows.Add("numerosità titoli", datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneCasa.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONENUMEROTITOLI")).value, false);
|
|
}
|
|
#endregion DataTable DettaglioComponentiFideuram
|
|
|
|
#region DataTable DettaglioComponentiAltri
|
|
|
|
ds.Tables.Add(new DataTable("DettaglioComponentiAltri"));
|
|
|
|
ds.Tables["DettaglioComponentiAltri"].Columns.Add("Componente", typeof(string));
|
|
ds.Tables["DettaglioComponentiAltri"].Columns.Add("Diversificazione", typeof(decimal));
|
|
ds.Tables["DettaglioComponentiAltri"].Columns.Add("IsHeader", typeof(bool));
|
|
|
|
if (_visualizzaAltriIstituti)
|
|
{
|
|
//ds.Tables["DettaglioComponentiAltri"].Rows.Add("Diversificazione del rischio mercato", 60, true);
|
|
ds.Tables["DettaglioComponentiAltri"].Rows.Add("Diversificazione del rischio mercato",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATO")).value
|
|
: 0, true);
|
|
////ds.Tables["DettaglioComponentiAltri"].Rows.Add("breve periodo", 57, false);
|
|
//ds.Tables["DettaglioComponentiAltri"].Rows.Add("breve periodo",
|
|
// datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
// datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATOBREVEPERIODO")).value
|
|
// : 0, false);
|
|
////ds.Tables["DettaglioComponentiAltri"].Rows.Add("lungo periodo", 63, false);
|
|
//ds.Tables["DettaglioComponentiAltri"].Rows.Add("lungo periodo",
|
|
// datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
// datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATOLUNGOPERIODO")).value
|
|
// : 0, false);
|
|
//ds.Tables["DettaglioComponentiAltri"].Rows.Add("Diversificazione del rischio credito", 30, true);
|
|
ds.Tables["DettaglioComponentiAltri"].Rows.Add("Diversificazione del rischio credito",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITO")).value
|
|
: 0, true);
|
|
//ds.Tables["DettaglioComponentiAltri"].Rows.Add("risparmio gestito", 38, false);
|
|
ds.Tables["DettaglioComponentiAltri"].Rows.Add("risparmio gestito",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITOGESTITO")).value
|
|
: 0, false);
|
|
//ds.Tables["DettaglioComponentiAltri"].Rows.Add("risparmio amministrato", 11, false);
|
|
ds.Tables["DettaglioComponentiAltri"].Rows.Add("risparmio amministrato",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITOAMMINISTRATI")).value
|
|
: 0, false);
|
|
//ds.Tables["DettaglioComponentiAltri"].Rows.Add("Diversificazione del rischio concentrazione", 10, true);
|
|
ds.Tables["DettaglioComponentiAltri"].Rows.Add("Diversificazione del rischio concentrazione",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONECONCENTRAZIONE")).value
|
|
: 0, true);
|
|
//ds.Tables["DettaglioComponentiAltri"].Rows.Add("case di investimento", 15, false);
|
|
ds.Tables["DettaglioComponentiAltri"].Rows.Add("case di investimento",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONECASEINVESTIMENTO")).value
|
|
: 0, false);
|
|
//ds.Tables["DettaglioComponentiAltri"].Rows.Add("numerosità titoli", 5, false);
|
|
ds.Tables["DettaglioComponentiAltri"].Rows.Add("numerosità titoli",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneTerzi.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONENUMEROTITOLI")).value
|
|
: 0, false);
|
|
}
|
|
#endregion DataTable DettaglioComponentiAltri
|
|
|
|
#region DataTable DettaglioComponentiComplessivo
|
|
|
|
ds.Tables.Add(new DataTable("DettaglioComponentiComplessivo"));
|
|
|
|
ds.Tables["DettaglioComponentiComplessivo"].Columns.Add("Componente", typeof(string));
|
|
ds.Tables["DettaglioComponentiComplessivo"].Columns.Add("Diversificazione", typeof(decimal));
|
|
ds.Tables["DettaglioComponentiComplessivo"].Columns.Add("IsHeader", typeof(bool));
|
|
|
|
if (_visualizzaAltriIstituti)
|
|
{
|
|
//ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("Diversificazione del rischio mercato", 73, true);
|
|
ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("Diversificazione del rischio mercato",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATO")).value
|
|
: 0, true);
|
|
////ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("breve periodo", 69, false);
|
|
//ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("breve periodo",
|
|
// datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
// datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATOBREVEPERIODO")).value
|
|
// : 0, false);
|
|
////ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("lungo periodo", 77, false);
|
|
//ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("lungo periodo",
|
|
// datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
// datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOMERCATOLUNGOPERIODO")).value
|
|
// : 0, false);
|
|
//ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("Diversificazione del rischio credito", 55, true);
|
|
ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("Diversificazione del rischio credito",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITO")).value
|
|
: 0, true);
|
|
//ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("risparmio gestito", 78, false);
|
|
ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("risparmio gestito",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITOGESTITO")).value
|
|
: 0, false);
|
|
//ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("risparmio amministrato", 16, false);
|
|
ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("risparmio amministrato",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONERISCHIOCREDITOAMMINISTRATI")).value
|
|
: 0, false);
|
|
//ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("Diversificazione del rischio concentrazione", 24, true);
|
|
ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("Diversificazione del rischio concentrazione",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONECONCENTRAZIONE")).value
|
|
: 0, true);
|
|
//ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("case di investimento", 18, false);
|
|
ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("case di investimento",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONECASEINVESTIMENTO")).value
|
|
: 0, false);
|
|
//ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("numerosità titoli", 6, false);
|
|
ds.Tables["DettaglioComponentiComplessivo"].Rows.Add("numerosità titoli",
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.Count() > 0 ?
|
|
datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.diversicazioneComplessivo.beneficio.FirstOrDefault(o => o.key.ToUpper().Equals("DIVERSIFICAZIONENUMEROTITOLI")).value
|
|
: 0, false);
|
|
}
|
|
#endregion DataTable DettaglioComponentiComplessivo
|
|
|
|
return ds;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Recupera la nota dinamica
|
|
/// </summary>
|
|
/// <param name="nota"></param>
|
|
/// <returns></returns>
|
|
public virtual string GetNote()
|
|
{
|
|
string nota = "";
|
|
string token = "";
|
|
|
|
var pianificazioneVerticale = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale;
|
|
|
|
decimal CCN_CASA = pianificazioneVerticale.contoCorrenteNegativo; //cc negativi del patrimonio casa
|
|
decimal GPELIGOFONDI_CASA = pianificazioneVerticale.liqEligoFondiNeg; // liquidità sottostante la GP Eligo Fondi del patrimonio casa
|
|
decimal GPELIGTITOLI_CASA = pianificazioneVerticale.liqEligoTitoliNeg; //liquidità sottostante la GP Eligo Titoli del patrimonio casa
|
|
|
|
// 20181009 AC
|
|
decimal TUOFOGLIO_CASA = pianificazioneVerticale.liqFogliNeg; // liquidità sottostante Il Mio Foglio del patrimonio casa
|
|
//--20181009 AC
|
|
|
|
decimal CCN_TERZI = datiSeiUnico.patrimonioUnit().patrimonioTerzi.patrimonioTerziBean.contoCorrentiNegativi;
|
|
|
|
//**************************************SIMULAZIONE******************************************************
|
|
|
|
//CCN_CASA = 0;
|
|
//GPELIGOFONDI_CASA = -500;
|
|
//GPELIGTITOLI_CASA = -1500;
|
|
//TUOFOGLIO_CASA = -2400;
|
|
|
|
//CCN_TERZI = -2000;
|
|
|
|
//**************************************FINE SIMULAZIONE*************************************************
|
|
|
|
// 20181009 AC
|
|
//_presenzaNotaPatrimonioCasa = CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0;
|
|
_presenzaNotaPatrimonioCasa = CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || TUOFOGLIO_CASA != 0;
|
|
//--20181009 AC
|
|
_presenzaNotaPatrimonioTerzi = CCN_TERZI != 0 && _visualizzaAltriIstituti;
|
|
|
|
decimal GC = 100;
|
|
decimal OC_CASA = 0;//patrimonioCasa.totaliPatrimonio.partiteViaggianti; //Operazioni in corso del patrimonio casa
|
|
decimal CC_CASA = 0;// patrimonioCasa.totaliPatrimonio.contoCorrentePositivo; //cc positivo del patrimonio casa
|
|
decimal CC_TERZI = 0;// patrimonioTerzi.totaliPatrimonio.contoCorrentePositivo; //cc positivo del patrimonio terzi
|
|
decimal PNR_CASA = 0; //Patrimonio non rappresentabile per macroassetclass del patrimonio casa
|
|
decimal PNR_TERZI = 0;
|
|
|
|
// 20181009 AC
|
|
//if (CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || CCN_TERZI != 0)
|
|
if (CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || CCN_TERZI != 0 || TUOFOGLIO_CASA != 0)
|
|
//--20181009 AC
|
|
{
|
|
nota += token + "Il controvalore";
|
|
token = " ";
|
|
if (CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || TUOFOGLIO_CASA != 0)
|
|
{
|
|
nota += token + "del patrimonio $/Banca/$ esclude il saldo negativo";
|
|
|
|
if (CCN_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("dei conti correnti ({0} €)", CCN_CASA);
|
|
token = (GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0) ? ", " : "";
|
|
}
|
|
// 20181009 AC
|
|
if (TUOFOGLIO_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("della liquidità sottostante Il Mio Foglio ({0} €)", TUOFOGLIO_CASA);
|
|
token = (TUOFOGLIO_CASA != 0) ? ", " : "";
|
|
}
|
|
//--20181009 AC
|
|
if (GPELIGOFONDI_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("della liquidità sottostante la GP Eligo Fondi ({0} €)", GPELIGOFONDI_CASA);
|
|
token = (GPELIGTITOLI_CASA != 0) ? ", " : "";
|
|
}
|
|
if (GPELIGTITOLI_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("della liquidità sottostante la GP Eligo Titoli ({0} €)", GPELIGTITOLI_CASA);
|
|
}
|
|
token = ". ";
|
|
}
|
|
|
|
if (CCN_TERZI != 0 && _visualizzaAltriIstituti)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal(" Il controvalore del patrimonio altri Istituti esclude il saldo negativo dei conti correnti ({0} €)", CCN_TERZI);
|
|
}
|
|
}
|
|
|
|
if (GC < 100)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("Grado di copertura (%) della rappresentazione grafica per macro asset class pari a {0}", GC);
|
|
token = ": ";
|
|
if (PNR_CASA != 0 || CC_CASA != 0 || OC_CASA != 0 || PNR_TERZI != 0 || CC_TERZI != 0)
|
|
{
|
|
nota += token + "non sono considerati";
|
|
token = " ";
|
|
if (PNR_CASA != 0 || CC_CASA != 0 || OC_CASA != 0)
|
|
{
|
|
if (PNR_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("i prodotti non rappresentabili ({0} €)", PNR_CASA);
|
|
token = ", ";
|
|
}
|
|
if (CC_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("i conti correnti ({0} €)", CC_CASA);
|
|
token = ", ";
|
|
}
|
|
if (OC_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("gli importi relativi alle operazioni in corso ({0} €)", OC_CASA);
|
|
token = ", ";
|
|
}
|
|
token = " ";
|
|
nota += token + "del patrimonio $/Banca/$";
|
|
token = ", ";
|
|
}
|
|
if ((PNR_TERZI != 0 || CC_TERZI != 0) && _visualizzaAltriIstituti)
|
|
{
|
|
if (PNR_TERZI != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("i prodotti non rappresentabili ({0} €)", PNR_TERZI);
|
|
token = ", ";
|
|
}
|
|
if (CC_TERZI != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("i conti correnti ({0} €)", CC_TERZI);
|
|
token = ", ";
|
|
}
|
|
token = " ";
|
|
nota += token + "del patrimonio Altri Istituti";
|
|
token = ", ";
|
|
}
|
|
}
|
|
}
|
|
nota += ".";
|
|
nota = !nota.Equals("") ? "(*) " + nota : nota;
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
|
|
}
|
|
|
|
public virtual string getNotaCopertura5RMRC() //40.5 copertura rischio mercato var e rischio credito
|
|
{
|
|
|
|
var RM = false;
|
|
var RC = false;
|
|
|
|
try
|
|
{
|
|
var copertura = Convert.ToDecimal(datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o => o.id == "RM").copertura.Replace(".", ","));
|
|
RM = copertura > 0 && copertura < 90;
|
|
}
|
|
catch { RM = false; }
|
|
|
|
try
|
|
{
|
|
var copertura = Convert.ToDecimal(datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o => o.id == "RC").copertura.Replace(".", ","));
|
|
RC = copertura > 0 && copertura < 90;
|
|
}
|
|
catch { RC = false; }
|
|
|
|
|
|
string nota = "";
|
|
|
|
if (RM || RC)
|
|
{
|
|
nota += "Il patrimonio che lei detiene presso $/Banca/$ risulta non adeguato al suo profilo finanziario in quanto alcuni prodotti non sono coperti in termini di "
|
|
+ (RM ? RC ? "Rischio Mercato (VaR) e di Rischio Credito" : "Rischio Mercato (VaR)" : RC ? "Rischio Credito" : "") +
|
|
", determinando un grado di copertura inferiore a 90%: in questo caso, a prescindere dai singoli indicatori di rischio, il patrimonio $/Banca/$ viene considerato sempre come non adeguato.";
|
|
|
|
|
|
}
|
|
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
}
|
|
public virtual bool presenzaGrafico()
|
|
{
|
|
return GetOption<Opzione4_1>().Valore;
|
|
}
|
|
|
|
private void XAxisDraw(float x1, float x2)
|
|
{
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit + x1 - 1, EnvironmentFacade.RendererFacade.XLeftLimit + x2 + 1, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
|
|
var incr = (x2 - x1) / 5;
|
|
float currentX = EnvironmentFacade.RendererFacade.XLeftLimit + x1;
|
|
|
|
for (int i = 0; i <= 100; i += 20)
|
|
{
|
|
AddElement(new FormattedTextAreaPDF(i.ToString(), currentX, 20) { FontSize = 6, AutoIncrementYWritable = false });
|
|
currentX += incr;
|
|
}
|
|
|
|
}
|
|
|
|
private void XAxisDraw(float x1, float y1, float x2, float y2)
|
|
{
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit + x1 - 1, EnvironmentFacade.RendererFacade.XLeftLimit + x2 + 1, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
|
|
var incr = (x2 - x1) / 5;
|
|
float currentX = EnvironmentFacade.RendererFacade.XLeftLimit + x1;
|
|
|
|
for (int i = 0; i <= 100; i += 20)
|
|
{
|
|
//currentX - 3 serve a centrare la label rispetto al trattino
|
|
AddElement(new FormattedTextAreaPDF(i.ToString(), currentX - 3, 20) { FontSize = 6, AutoIncrementYWritable = false, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left });
|
|
XAxisLabelLineDraw(currentX, y1, currentX, y2);
|
|
|
|
currentX += incr;
|
|
}
|
|
|
|
}
|
|
|
|
private void XAxisLabelLineDraw(float x1, float y1, float x2, float y2)
|
|
{
|
|
float leftShift = 0;
|
|
AddElement(new LinePDF(x1 + leftShift, y1, x2 + leftShift, y2, 0.8F, new ColorPDF(137, 137, 137)) { AutoIncrementYWritable = false });
|
|
}
|
|
|
|
}
|
|
}
|