2314 lines
135 KiB
C#
2314 lines
135 KiB
C#
using System;
|
||
using Consulenza.ReportWriter.Business;
|
||
using Consulenza.ReportWriter.Business.OBJ_PDF;
|
||
using System.Data;
|
||
using System.Collections.Generic;
|
||
using Consulenza.ReportCommon;
|
||
using Consulenza.ReportWriter.Business.CUSTOM_PDF.ConsulenzaUnica;
|
||
using System.Linq;
|
||
using Consulenza.ReportWriter.Business.Entity;
|
||
using Consulenza.DataServices.fideuram.data.service;
|
||
using Consulenza.ReportWriter.Business.CHART_PDF;
|
||
using Dundas.Charting.WebControl;
|
||
|
||
|
||
|
||
namespace Consulenza.ReportWriter.Manager.Section.Unica
|
||
{
|
||
public class S40 : Entity.Section
|
||
{
|
||
/// <summary>
|
||
///S40.Adeguatezza idSezione = 83 //guardare la 62
|
||
/// </summary>
|
||
private bool notaindicatoricomplessitafe;
|
||
private string notagradoCoperturaComplessita;
|
||
private string notaConcentrazioneProdottiComplessi;
|
||
private bool gradoCoperturaRM;
|
||
private bool gradoCoperturaRC;
|
||
//Adriano: serve a determinare se il grado di concentrazione = 100, che nel caso dei clienti professionali significa valorizzare CC e CM a "n.a."
|
||
private bool maxConcentrazione;
|
||
//--Adriano
|
||
private bool flagFiduciariaPlurimandato;
|
||
public S40(EnvironmentFacade environmentFacade, int idSection)
|
||
: base(environmentFacade, idSection)
|
||
{
|
||
try
|
||
{
|
||
Draw();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
SectionLogger.Write("S40", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment);
|
||
}
|
||
}
|
||
|
||
protected override sealed void Draw()
|
||
{
|
||
var dati = GetDataSet();
|
||
bool saltoPagina = false;
|
||
bool visualizzaTabellaIndicatoriSintesi = GetOption<Opzione4_1>().Valore;
|
||
bool visualizzaTabellaProdotti = GetOption<Opzione4_2>().Valore;
|
||
|
||
if (dati.Tables["indicatori"].Rows.Count > 0) {
|
||
if (saltoPagina)
|
||
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
||
saltoPagina = true;
|
||
|
||
if (getTesto1().Length > 0) {
|
||
AddElement(new SpacePDF(20));
|
||
AddElement(new FormattedTextAreaPDF(getTesto1(), EnvironmentFacade.RendererFacade.XLeftLimit) {FontSize=7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
AddElement(new SpacePDF(15));
|
||
}
|
||
|
||
#region profilo finanziario
|
||
var dtPatrimonio = new DataTable();
|
||
dtPatrimonio.Columns.Add(new DataColumn("controvalore"));
|
||
dtPatrimonio.Columns.Add(new DataColumn("valore"));
|
||
dtPatrimonio.Columns.Add(new DataColumn("descrizione"));
|
||
dtPatrimonio.Columns.Add(new DataColumn("val"));
|
||
|
||
for (int i = 0; i < dati.Tables["patrimoni"].Rows.Count / 2; )
|
||
{
|
||
int r = 0;
|
||
foreach (DataRow ro in dati.Tables["patrimoni"].Rows)
|
||
{
|
||
|
||
if (r % 2 == 0)
|
||
{
|
||
DataRow row = dtPatrimonio.NewRow();
|
||
dtPatrimonio.Rows.Add(row);
|
||
dtPatrimonio.Rows[i]["controvalore"] = ro["Descrizione"].ToString();
|
||
dtPatrimonio.Rows[i]["valore"] = ro["Valore"].ToString();
|
||
}
|
||
else
|
||
{
|
||
dtPatrimonio.Rows[i]["descrizione"] = ro["Descrizione"].ToString();
|
||
dtPatrimonio.Rows[i]["val"] = ro["Valore"].ToString();
|
||
|
||
i++;
|
||
}
|
||
r++;
|
||
|
||
}
|
||
|
||
}
|
||
var countRow = dtPatrimonio.Rows.Count - 1;
|
||
|
||
var tabellaPatrimonio = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dtPatrimonio)
|
||
{
|
||
Style = Style.ConsulenzaUnica,
|
||
Header = false,
|
||
Footer = false,
|
||
AlternateRow = false,
|
||
RowHeight = 25,
|
||
WidthSeparationLines = 0
|
||
|
||
};
|
||
tabellaPatrimonio.Columns.Add(new ColumnPDF("controvalore", 150, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo, "controvalore", string.Empty) {HeaderFontSize = 7});
|
||
tabellaPatrimonio.Columns.Add(new ColumnPDF("valore", 110, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "valore", string.Empty) { HeaderFontSize = 7, PaddingLeft = 5 });
|
||
tabellaPatrimonio.Columns.Add(new ColumnPDF("descrizione", 150, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo, "descrizione", string.Empty) { HeaderFontSize = 7});
|
||
tabellaPatrimonio.Columns.Add(new ColumnPDF("val", 110, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "val", string.Empty) { HeaderFontSize = 7, PaddingLeft = 5 });
|
||
|
||
tabellaPatrimonio.Cells[2, countRow].BackgroundColor = dtPatrimonio.Rows[countRow]["descrizione"].ToString() == "" ? ColorPDF.Bianco : ColorPDF.Standard_Grigio_SfondoColonnaTabella;
|
||
tabellaPatrimonio.Cells[1, countRow].FontColor =dtPatrimonio.Rows[countRow]["valore"].ToString().Equals("n.a.") ? ColorPDF.Nero : dtPatrimonio.Rows[countRow]["valore"].ToString().Equals("Adeguato") ? ColorPDF.Verde : ColorPDF.Rosso;
|
||
|
||
AddElement(tabellaPatrimonio);
|
||
AddElement(new SpacePDF(10));
|
||
|
||
#endregion
|
||
|
||
#region indicatore di sintesi
|
||
|
||
var dtIndicatori = new DataTable();
|
||
dtIndicatori.Columns.Add(new DataColumn("Indicatore", typeof(string)));
|
||
dtIndicatori.Columns.Add(new DataColumn("Patrimonio", typeof(string)));
|
||
dtIndicatori.Columns.Add(new DataColumn("Sogliamassima", typeof(string)));
|
||
dtIndicatori.Columns.Add(new DataColumn("Gradocopertura", typeof(string)));
|
||
dtIndicatori.Columns.Add(new DataColumn("Adeguatezza", typeof(string)));
|
||
|
||
foreach (DataRow r in dati.Tables["indicatori"].Rows)
|
||
{
|
||
|
||
dtIndicatori.Rows.Add(r["Indicatore"].ToString(),r["Patrimonio"].ToString(),r["Sogliamassima"].ToString(), r["Gradocopertura"].ToString(),r["Adeguatezza"].ToString());
|
||
|
||
}
|
||
var tabellaIndicatori = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dtIndicatori)
|
||
{
|
||
Style = Style.ConsulenzaUnica,
|
||
AlternateRow = false,
|
||
ShowSeparationLines = true,
|
||
Footer = false,
|
||
HeaderFontSize = 7,
|
||
HeaderHeight = 30,
|
||
RowHeight = 30,
|
||
ShowFooterSeparationLines = true
|
||
};
|
||
|
||
tabellaIndicatori.Columns.Add(new ColumnPDF("Indicatore", 150, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo, "Indicatore", "Indicatore") { HeaderFontSize=7});
|
||
tabellaIndicatori.Columns.Add(new ColumnPDF("Patrimonio", 100, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Patrimonio", string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", base.EnvironmentFacade.ReportEnvironment))) { HeaderFontSize = 7, PaddingRight=7 });
|
||
tabellaIndicatori.Columns.Add(new ColumnPDF("Sogliamassima", 100, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Sogliamassima", "Soglia massima") {HeaderPaddingLeft=10, HeaderFontSize = 7, PaddingRight = 7 });
|
||
tabellaIndicatori.Columns.Add(new ColumnPDF("Gradocopertura", 100, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Gradocopertura", "Grado di copertura (%)") { HeaderFontSize = 7, PaddingRight = 7 });
|
||
tabellaIndicatori.Columns.Add(new ColumnPDF("Adeguatezza", 70, HorizontalAlignmentType.Centrato, false, false, 7, ColumnType.Testo, "Adeguatezza", "Adeguatezza") { HeaderFontSize = 7, PaddingRight = 7 });
|
||
|
||
for (int a = 0; a < dtIndicatori.Rows.Count;a++ )
|
||
{
|
||
int iIndicatore = 0;
|
||
int iPatrimonio = 1;
|
||
int iSogliamassima = 2;
|
||
int iGradocopertura = 3;
|
||
int iAdeguatezza = 4;
|
||
tabellaIndicatori.Cells[iIndicatore, a].FontBold = true;
|
||
|
||
//tabellaIndicatori.Cells[iAdeguatezza, a].FontColor = dtIndicatori.Rows[a]["Adeguatezza"].ToString() == "n.a." ? ColorPDF.Nero : dtIndicatori.Rows[a]["Adeguatezza"].ToString().Contains("Non") ? ColorPDF.Rosso : ColorPDF.Verde;
|
||
|
||
|
||
tabellaIndicatori.Cells[iPatrimonio, a].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
tabellaIndicatori.Cells[iSogliamassima, a].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
tabellaIndicatori.Cells[iGradocopertura, a].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
}
|
||
|
||
|
||
//string codiceFiscaleDelegato =
|
||
|
||
tabellaIndicatori.Notes.Add(
|
||
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
||
getNoteTabellaIndicatori(),
|
||
new[] { "" },
|
||
string.Empty,
|
||
TableNotePDF.TableNoteAsteriskPositionType.CorpoTabella) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }
|
||
);
|
||
AddElement(tabellaIndicatori);
|
||
if (gradoCoperturaRM || gradoCoperturaRC)
|
||
{
|
||
AddElement(new SpacePDF(5));
|
||
AddElement(new FormattedTextAreaPDF(getNota5RMRC(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
// tabellaIndicatori.Notes.Add(
|
||
// new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
||
// getNota5RMRC(),
|
||
// new[] { "" },
|
||
// string.Empty,
|
||
// TableNotePDF.TableNoteAsteriskPositionType.CorpoTabella) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }
|
||
// );
|
||
}
|
||
|
||
if (notagradoCoperturaComplessita != "")
|
||
{
|
||
AddElement(new SpacePDF(5));
|
||
AddElement(new FormattedTextAreaPDF(notagradoCoperturaComplessita, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
//tabellaIndicatori.Notes.Add(
|
||
// new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
||
// getNota6(gradoCoperturaComplessita),
|
||
// new[] { "" },
|
||
// string.Empty,
|
||
// TableNotePDF.TableNoteAsteriskPositionType.CorpoTabella) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }
|
||
// );
|
||
}
|
||
if (getNota407().Length > 0)
|
||
{
|
||
AddElement(new SpacePDF(5));
|
||
AddElement(new FormattedTextAreaPDF(getNota407(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
}
|
||
|
||
|
||
//AddElement(new SpacePDF(10));
|
||
//AddElement(new FormattedTextAreaPDF("(*) " + getNoteTabellaIndicatori(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
//if (gradoCoperturaRM || gradoCoperturaRC)
|
||
//{
|
||
// AddElement(new SpacePDF(10));
|
||
// AddElement(new FormattedTextAreaPDF("(*) " + getNota5RMRC(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
//}
|
||
//if (gradoCoperturaComplessita != "")
|
||
//{
|
||
// AddElement(new SpacePDF(10));
|
||
// AddElement(new FormattedTextAreaPDF("(*) " + getNota6(gradoCoperturaComplessita), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
//}
|
||
#endregion
|
||
|
||
|
||
}
|
||
|
||
#region prodotti
|
||
|
||
|
||
|
||
if (dati.Tables["prodotti"].Rows.Count>0)
|
||
{
|
||
|
||
if (visualizzaTabellaIndicatoriSintesi && visualizzaTabellaProdotti)
|
||
{
|
||
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 });
|
||
}
|
||
if (saltoPagina)
|
||
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
||
saltoPagina = true;
|
||
|
||
if (visualizzaTabellaIndicatoriSintesi && visualizzaTabellaProdotti)
|
||
{
|
||
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 });
|
||
}
|
||
|
||
|
||
if (getTesto3().Length > 0)
|
||
{
|
||
AddElement(new SpacePDF(15));
|
||
AddElement(new FormattedTextAreaPDF(getTesto3(), EnvironmentFacade.RendererFacade.XLeftLimit) {FontSize=7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
AddElement(new SpacePDF(15));
|
||
}
|
||
|
||
|
||
#region tabella prodotti - indicatori di rischio
|
||
|
||
|
||
var tabellaProdotti = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["prodotti"])
|
||
{
|
||
Style = Style.ConsulenzaUnica,
|
||
Footer = true,
|
||
AlternateRow = false,
|
||
ShowBorderLastLine = false,
|
||
HeaderHeight = 28,
|
||
//RowHeight = 30,
|
||
// FooterHeight=30,
|
||
HeaderMargin=1,
|
||
WhiteSpacesHorizontalSeparator = false,
|
||
AdditionalSpaceBetweenHeadersAndTable = 2,
|
||
ShowSeparationLines = true,
|
||
ShowFooterSeparationLines = true,
|
||
HideLastSeparationLine = true,
|
||
HideFirstSeparationLine = true
|
||
};
|
||
|
||
|
||
|
||
tabellaProdotti.Columns.Add(new ColumnPDF("Immagine", 10, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Objectpdf, string.Empty, string.Empty) {HeaderFontSize=7, DeltaYContent = 4, PaddingLeft = 2 });
|
||
tabellaProdotti.Columns.Add(new ColumnPDF("Codicecontratto", 60, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo, "CodiceContratto", "Codice<br>contratto") { HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco });
|
||
// Modifica per Saving Map
|
||
tabellaProdotti.Columns.Add(new ColumnPDF("SavingMap", 10, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Immagine, "SavingMap", string.Empty) { DeltaYContent = 6, ScaleColumnTypeImage = 0.50F });
|
||
// Fine Modifica
|
||
tabellaProdotti.Columns.Add(new ColumnPDF("Descrizione", 145, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo, "Descrizione", "Descrizione") { HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco, PaddingRight = 2 });
|
||
|
||
tabellaProdotti.Columns.Add(new ColumnPDF("Controvaloreproposto", 75, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Decimale, "Controvalore", "Controvalore<br>attuale (€)") { PaddingRight = 5, HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco, HeaderPaddingLeft = 10 });
|
||
tabellaProdotti.Columns.Add(new ColumnPDF("rischiomercato", 40, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo, "Rischiomercato", "VaR (%)") { PaddingRight = 10, HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco, HeaderPaddingLeft = 4});
|
||
tabellaProdotti.Columns.Add(new ColumnPDF("Rischiocredito", 55, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo, "Rischiocredito", "Rischio credito") { PaddingRight = 5, HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco, HeaderPaddingLeft=6 });
|
||
tabellaProdotti.Columns.Add(new ColumnPDF("Complessita", 60, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo, "Complessita", "Complessità") { PaddingRight = 5, HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco, HeaderPaddingLeft = 4 });
|
||
tabellaProdotti.Columns.Add(new ColumnPDF("Liquidita", 60, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo, "Liquidita", "Liquidità/<br>Liquidabilità") { PaddingRight = 5, HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco, HeaderPaddingLeft = 4});
|
||
|
||
|
||
for(int h=0; h<dati.Tables["prodotti"].Rows.Count;h++)
|
||
{
|
||
int iImmagine = 0;
|
||
int iCodicecontratto = 1;
|
||
int iSavingMap = 2;
|
||
int iDescrizione= 3;
|
||
int iControvaloreproposto = 4;
|
||
int iRischiomercato = 5;
|
||
int iRischiocredito = 6;
|
||
int iComplessita = 7;
|
||
int iLiquidita = 8;
|
||
DataRow pr = dati.Tables["prodotti"].Rows[h];
|
||
if (!pr["Area"].ToString().Equals("")) {
|
||
|
||
for (int j = 0; j< tabellaProdotti.Columns.Count; j++)
|
||
{
|
||
tabellaProdotti.Cells[j, h].HorizontalSeparatorColor = new ColorPDF(255, 255, 255);
|
||
}
|
||
|
||
|
||
if (raggruppaProdotti() == RaggruppaProdotti.AreaBisogno)
|
||
{
|
||
string codArea = pr["area"].ToString().Substring(0, 3);
|
||
AreaBisogno areaBisogno = new AreaBisogno(codArea);
|
||
tabellaProdotti.Cells[iCodicecontratto, h].ColSpan = 3;
|
||
if (areaBisogno.Visibile)
|
||
{
|
||
|
||
float deltaXSwitch;
|
||
float deltaYSwitch;
|
||
switch (codArea.ToUpper())
|
||
{
|
||
case "EXT":
|
||
deltaXSwitch = 1.5F;
|
||
deltaYSwitch = -0.3F;
|
||
break;
|
||
case "INV":
|
||
deltaXSwitch = 2.2F;
|
||
deltaYSwitch = -0.4F;
|
||
break;
|
||
case "PRE":
|
||
deltaXSwitch = 1.8F;
|
||
deltaYSwitch = -0.3F;
|
||
break;
|
||
case "RIS":
|
||
deltaXSwitch = 1.3F;
|
||
deltaYSwitch = -0.3F;
|
||
break;
|
||
case "LIQ":
|
||
deltaXSwitch = 1.5F;
|
||
deltaYSwitch = -0.2F;
|
||
break;
|
||
default:
|
||
deltaXSwitch = 2;
|
||
deltaYSwitch = 0;
|
||
break;
|
||
}
|
||
|
||
var listaOggetti = new List<ObjectPDF> {
|
||
new RectanglePDF(8, 8, ColorPDF.GetBy_AreaBisogno(codArea)),
|
||
new FormattedTextAreaPDF
|
||
{
|
||
Text = areaBisogno.Abbreviazione,
|
||
FontBold = true,
|
||
FontColor = ColorPDF.Bianco,
|
||
DeltaX = deltaXSwitch,
|
||
DeltaY = deltaYSwitch,
|
||
FontSize=7
|
||
}
|
||
};
|
||
tabellaProdotti.Cells[iImmagine, h].ValueObjectList.AddRange(listaOggetti);
|
||
}
|
||
tabellaProdotti.Cells[iCodicecontratto, h].Value = pr["Area"].ToString();
|
||
|
||
}
|
||
else
|
||
{
|
||
if (raggruppaProdotti() == RaggruppaProdotti.Contratto)
|
||
{
|
||
float iDeltaY = pr["Area"].ToString().Length > 48 ? -2.5F : 0.1F;
|
||
tabellaProdotti.Cells[iImmagine, h].ColSpan = 3;
|
||
tabellaProdotti.Cells[iImmagine, h].ValueObject = new FormattedTextAreaPDF
|
||
{
|
||
Text = pr["Area"].ToString(),
|
||
FontBold = true,
|
||
FontSize = 7,
|
||
DeltaX = 11,
|
||
DeltaY = iDeltaY,
|
||
Width = 215,
|
||
TextVerticalAlign = ceTe.DynamicPDF.VAlign.Center
|
||
};
|
||
|
||
}
|
||
else
|
||
{
|
||
tabellaProdotti.Cells[iImmagine, h].ColSpan = 3;
|
||
tabellaProdotti.Cells[iImmagine, h].ValueObject = new FormattedTextAreaPDF
|
||
{
|
||
Text = pr["Area"].ToString(),
|
||
FontBold = true,
|
||
FontSize = 7,
|
||
DeltaX = 11
|
||
};
|
||
}
|
||
}
|
||
|
||
|
||
tabellaProdotti.Cells[iImmagine, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iCodicecontratto, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iDescrizione, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iSavingMap, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iControvaloreproposto, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iRischiomercato, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iRischiocredito, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iComplessita, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iLiquidita, h].BackgroundColor = ColorPDF.ConsulenzaUnica_Grigio_SfondoColonnaHeaderFooterTabella;
|
||
tabellaProdotti.Cells[iImmagine, h].FontBold =
|
||
tabellaProdotti.Cells[iCodicecontratto, h].FontBold =
|
||
tabellaProdotti.Cells[iDescrizione, h].FontBold =
|
||
tabellaProdotti.Cells[iControvaloreproposto, h].FontBold =
|
||
tabellaProdotti.Cells[iRischiomercato, h].FontBold =
|
||
tabellaProdotti.Cells[iRischiocredito, h].FontBold =
|
||
tabellaProdotti.Cells[iComplessita, h].FontBold =
|
||
tabellaProdotti.Cells[iLiquidita, h].FontBold = true;
|
||
|
||
} else if (!pr["Progetto"].ToString().Equals("")) {
|
||
|
||
|
||
tabellaProdotti.Cells[iCodicecontratto, h].ColSpan = 2;
|
||
tabellaProdotti.Cells[iCodicecontratto, h].Value = pr["Progetto"].ToString();
|
||
tabellaProdotti.Cells[iImmagine, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iCodicecontratto, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iDescrizione, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iSavingMap, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iControvaloreproposto, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iRischiomercato, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iRischiocredito, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iComplessita, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iLiquidita, h].BackgroundColor = Convert.ToBoolean(pr["BackgroundGray"]) ? ColorPDF.ConsulenzaUnica_Grigio_SfondoColonnaHeaderFooterTabella : ColorPDF.Bianco;
|
||
tabellaProdotti.Cells[iImmagine, h].FontBold =
|
||
tabellaProdotti.Cells[iCodicecontratto, h].FontBold =
|
||
tabellaProdotti.Cells[iDescrizione, h].FontBold =
|
||
tabellaProdotti.Cells[iControvaloreproposto, h].FontBold =
|
||
tabellaProdotti.Cells[iRischiomercato, h].FontBold =
|
||
tabellaProdotti.Cells[iRischiocredito, h].FontBold =
|
||
tabellaProdotti.Cells[iComplessita, h].FontBold =
|
||
tabellaProdotti.Cells[iLiquidita, h].FontBold = Convert.ToBoolean(pr["FontBold"]);
|
||
|
||
} else {
|
||
|
||
tabellaProdotti.Cells[iImmagine, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iCodicecontratto, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iDescrizione, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iSavingMap, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iControvaloreproposto, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iRischiomercato, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iRischiocredito, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iComplessita, h].BackgroundColor =
|
||
tabellaProdotti.Cells[iLiquidita, h].BackgroundColor = Convert.ToBoolean(pr["BackgroundGray"]) ? ColorPDF.ConsulenzaUnica_Grigio_SfondoColonnaHeaderFooterTabella : ColorPDF.Bianco;
|
||
tabellaProdotti.Cells[iImmagine, h].FontBold =
|
||
tabellaProdotti.Cells[iCodicecontratto, h].FontBold =
|
||
tabellaProdotti.Cells[iDescrizione, h].FontBold =
|
||
tabellaProdotti.Cells[iControvaloreproposto, h].FontBold =
|
||
tabellaProdotti.Cells[iRischiomercato, h].FontBold =
|
||
tabellaProdotti.Cells[iRischiocredito, h].FontBold =
|
||
tabellaProdotti.Cells[iComplessita, h].FontBold =
|
||
tabellaProdotti.Cells[iLiquidita, h].FontBold = Convert.ToBoolean(pr["FontBold"]);
|
||
}
|
||
|
||
tabellaProdotti.Cells[ iControvaloreproposto,h].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
tabellaProdotti.Cells[ iRischiomercato,h].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
tabellaProdotti.Cells[ iRischiocredito,h].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
tabellaProdotti.Cells[iComplessita, h].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
tabellaProdotti.Cells[iLiquidita, h].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
tabellaProdotti.FooterColumns.Add(new ColumnPDF("spazio", 15, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo) { FontSize = 6 });
|
||
tabellaProdotti.FooterColumns.Add(new ColumnPDF("Totale", 205, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo) { FontSize = 7 });
|
||
tabellaProdotti.FooterColumns.Add(new ColumnPDF("controvalore", 80, HorizontalAlignmentType.Destra, false, true, 7, ColumnType.Testo) { PaddingRight = 4, FontSize = 7 });
|
||
tabellaProdotti.FooterColumns.Add(new ColumnPDF("var", 40, HorizontalAlignmentType.Destra, false, true, 7, ColumnType.Testo) { PaddingRight = 10, FontSize = 7 });
|
||
tabellaProdotti.FooterColumns.Add(new ColumnPDF("risc", 55, HorizontalAlignmentType.Destra, false, true, 7, ColumnType.Testo) { PaddingRight = 4, FontSize = 7 });
|
||
tabellaProdotti.FooterColumns.Add(new ColumnPDF("compl", 60, HorizontalAlignmentType.Destra, false, true, 7, ColumnType.Testo) { PaddingRight = 5, FontSize = 7 });
|
||
tabellaProdotti.FooterColumns.Add(new ColumnPDF("liq", 60, HorizontalAlignmentType.Destra, false, true, 7, ColumnType.Testo) { FontSize = 7 });
|
||
|
||
DataRow drProdottifooter = dati.Tables["prodottifooter"].Rows[0];
|
||
tabellaProdotti.FooterCells[0, 0].Value = "";
|
||
tabellaProdotti.FooterCells[1, 0].Value = drProdottifooter["patrimonio"].ToString();
|
||
tabellaProdotti.FooterCells[2, 0].Value = Helper.FormatCurrency(drProdottifooter["Complessivo"].ToString());
|
||
tabellaProdotti.FooterCells[3, 0].Value = drProdottifooter["varDecodificato"].ToString();
|
||
tabellaProdotti.FooterCells[4, 0].Value = drProdottifooter["rischioCreditoDecodificato"].ToString();
|
||
tabellaProdotti.FooterCells[5, 0].Value = drProdottifooter["descrizioneClasseComplessita"].ToString(); ;
|
||
tabellaProdotti.FooterCells[6, 0].Value = "-";
|
||
|
||
|
||
//NOTA 40.2 - 40.9
|
||
if (getNota1().Length > 0)
|
||
{
|
||
AddElement(new SpacePDF(15));
|
||
tabellaProdotti.Notes.Add(
|
||
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
||
getNota1(),
|
||
new[] { "compl" },
|
||
"",
|
||
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella) { DeltaY = 5, FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify }
|
||
);
|
||
}
|
||
|
||
AddElement(tabellaProdotti);
|
||
#endregion
|
||
}
|
||
#endregion
|
||
|
||
#region focus emittenti
|
||
|
||
if (dati.Tables["emittentiObb"].Rows.Count >0 || dati.Tables["emittentiAz"].Rows.Count > 0 || dati.Tables["fondi"].Rows.Count > 0)
|
||
{
|
||
|
||
if (saltoPagina)
|
||
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
||
saltoPagina = true;
|
||
|
||
var intestazioneEmittenti = new ChapterHeadingPDF(
|
||
getCapitolo4(),
|
||
getTesto4(),
|
||
EnvironmentFacade.RendererFacade.XLeftLimit,
|
||
EnvironmentFacade.RendererFacade.YUpperLimit,
|
||
EnvironmentFacade.ReportEnvironment.FontFamily);
|
||
|
||
AddElement(intestazioneEmittenti.ToElement());
|
||
}
|
||
|
||
#region emittenti obbligazionari
|
||
//Adriano 07/09/2017: Per i Clienti Professionali bisogna fare modifiche sulla tabellaEmittentiObb per la Soglia di Concentrazione = 50 (Colonna 4) e Adeguatezza = "Adeguato" (Colonna 5)
|
||
if (dati.Tables["emittentiObb"].Rows.Count > 0)
|
||
{
|
||
var tabellaEmittentiObb = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["emittentiObb"], dati.Tables["emittentiObbfooter"])
|
||
{
|
||
Style = Style.ConsulenzaUnica,
|
||
Footer = true,
|
||
AlternateRow = false,
|
||
ShowBorderLastLine = false,
|
||
HeaderHeight = 30,
|
||
HeaderFontSize = 7,
|
||
AutoIncrementYWritable=true,
|
||
ShowSeparationLines = true,
|
||
ShowFooterSeparationLines = true
|
||
|
||
};
|
||
|
||
tabellaEmittentiObb.Columns.Add(new ColumnPDF("Emittente", 185, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Testo, "Emittenti", "Emittenti obbligazionari") { HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco, PaddingRight = 5 });
|
||
tabellaEmittentiObb.Columns.Add(new ColumnPDF("Controvaloreproposto", 65, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Decimale, "Controvaloreproposto", "Controvalore attuale (€)") { PaddingRight = 5, HeaderFontSize =6, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaEmittentiObb.Columns.Add(new ColumnPDF("Franchigia", 65, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Testo, "Franchigia", "Franchigia (€)") { PaddingRight = 5, HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaEmittentiObb.Columns.Add(new ColumnPDF("Concentrazione", 70, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Decimale, "Concentrazione", "Concentrazione (%)") { PaddingRight = 5, HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaEmittentiObb.Columns.Add(new ColumnPDF("Soglia", 70, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Decimale, "Sogliaconcentrazione", "Soglia di concentrazione (%)") { PaddingRight = 5, HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaEmittentiObb.Columns.Add(new ColumnPDF("Adeguatezza", 65, HorizontalAlignmentType.Centrato, false, false, 6, ColumnType.Testo, "Adeguatezza", "Adeguatezza") { HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco });
|
||
|
||
tabellaEmittentiObb.FooterColumns.Add(new ColumnPDF("Emittente", 185, HorizontalAlignmentType.Sinistra, true, true, 6, ColumnType.Testo) );
|
||
tabellaEmittentiObb.FooterColumns.Add(new ColumnPDF("Controvaloreproposto", 65, HorizontalAlignmentType.Destra, true, true, 6, ColumnType.Decimale) { PaddingRight = 4 });
|
||
tabellaEmittentiObb.FooterColumns.Add(new ColumnPDF("Franchigia", 65, HorizontalAlignmentType.Destra, true, true, 6, ColumnType.Decimale) { PaddingRight = 4 });
|
||
tabellaEmittentiObb.FooterColumns.Add(new ColumnPDF("Concentrazione", 70, HorizontalAlignmentType.Destra, true, true, 6, ColumnType.Decimale) { PaddingRight = 4 });
|
||
tabellaEmittentiObb.FooterColumns.Add(new ColumnPDF("Soglia", 70, HorizontalAlignmentType.Destra, true, true, 6, ColumnType.Decimale) { PaddingRight = 4 });
|
||
tabellaEmittentiObb.FooterColumns.Add(new ColumnPDF("Adeguatezza", 65, HorizontalAlignmentType.Centrato, true, true, 6, ColumnType.Testo) { PaddingRight = 4 });
|
||
|
||
for (int l = 0; l < dati.Tables["emittentiObb"].Rows.Count; l++)
|
||
{
|
||
DataRow concetrazione = dati.Tables["emittentiObb"].Rows[l];
|
||
int indexEmittente = 0;
|
||
int indexAdeguatezza = 5;
|
||
tabellaEmittentiObb.Cells[0, l].Value =concetrazione["Emittenti"].ToString().ToLower().Contains("titoli") ? " <i>"+concetrazione["Emittenti"].ToString()+"</i>" : concetrazione["Emittenti"].ToString() ;
|
||
|
||
|
||
switch (concetrazione["Adeguatezza"].ToString())
|
||
{
|
||
case "Adeguato":
|
||
concetrazione["Adeguatezza"] = "Adeguato";
|
||
tabellaEmittentiObb.Cells[indexAdeguatezza, l].FontColor = ColorPDF.Verde;
|
||
break;
|
||
case "Non adeguato":
|
||
concetrazione["Adeguatezza"] = "Non adeguato";
|
||
tabellaEmittentiObb.Cells[indexAdeguatezza, l].FontColor = ColorPDF.Rosso;
|
||
break;
|
||
default:
|
||
concetrazione["Adeguatezza"] = "n.a.";
|
||
tabellaEmittentiObb.Cells[indexAdeguatezza, l].FontColor = ColorPDF.Nero;
|
||
break;
|
||
}
|
||
tabellaEmittentiObb.Cells[1, l].HorizontalAlignment =
|
||
tabellaEmittentiObb.Cells[2, l].HorizontalAlignment =
|
||
tabellaEmittentiObb.Cells[3, l].HorizontalAlignment =
|
||
tabellaEmittentiObb.Cells[4, l].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
|
||
}
|
||
AddElement(tabellaEmittentiObb);
|
||
if (flagFiduciariaPlurimandato)
|
||
{
|
||
string testoobbligazionarie = "In tabella sono riportati gli emittenti relativi a tutte le obbligazioni detenute dai mandati fiduciari associati al medesimo fiduciante a cui appartiene il mandato " + datiSeiUnico.getClienteReport().codiceMandato+".";
|
||
AddElement(new SpacePDF(10));
|
||
AddElement(new FormattedTextAreaPDF("(*) " + testoobbligazionarie, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
}
|
||
AddElement(new SpacePDF(25));
|
||
}
|
||
#endregion
|
||
|
||
#region emittenti azionari
|
||
//Adriano 07/09/2017: Per i Clienti Professionali bisogna fare modifiche sulla tabellaEmittentiAz per la Soglia di Concentrazione = 50 (Colonna 4) e Adeguatezza = "Adeguato" (Colonna 5)
|
||
if (dati.Tables["emittentiAz"].Rows.Count > 0) {
|
||
var tabellaEmittentiAz = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["emittentiAz"], dati.Tables["emittentiAzfooter"])
|
||
{
|
||
Style = Style.ConsulenzaUnica,
|
||
Footer = true,
|
||
AlternateRow = false,
|
||
ShowBorderLastLine = false,
|
||
HeaderHeight = 30,
|
||
HeaderFontSize = 7,
|
||
ShowSeparationLines = true,
|
||
ShowFooterSeparationLines = true
|
||
|
||
};
|
||
|
||
tabellaEmittentiAz.Columns.Add(new ColumnPDF("Emittente", 185, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Testo, "Emittenti", "Emittenti azionari") { HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco, PaddingRight = 5 });
|
||
tabellaEmittentiAz.Columns.Add(new ColumnPDF("Controvaloreproposto", 65, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Decimale, "Controvaloreproposto", "Controvalore attuale (€)") {PaddingRight=5, HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaEmittentiAz.Columns.Add(new ColumnPDF("Franchigia", 65, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Testo, "Franchigia", "Franchigia (€)") { PaddingRight = 5, HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaEmittentiAz.Columns.Add(new ColumnPDF("Concentrazione", 70, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Decimale, "Concentrazione", "Concentrazione (%)") { PaddingRight = 5, HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaEmittentiAz.Columns.Add(new ColumnPDF("Soglia", 70, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Decimale, "Sogliaconcentrazione", "Soglia di concentrazione (%)") { PaddingRight = 5, HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaEmittentiAz.Columns.Add(new ColumnPDF("Adeguatezza", 65, HorizontalAlignmentType.Centrato, false, false, 6, ColumnType.Testo, "Adeguatezza", "Adeguatezza") { HeaderFontSize = 6, BackgroundColor = ColorPDF.Bianco });
|
||
|
||
|
||
tabellaEmittentiAz.FooterColumns.Add(new ColumnPDF("Emittente", 185, HorizontalAlignmentType.Sinistra, true, true, 6, ColumnType.Testo));
|
||
tabellaEmittentiAz.FooterColumns.Add(new ColumnPDF("Controvaloreproposto", 65, HorizontalAlignmentType.Destra, true, true,6, ColumnType.Decimale) { PaddingRight=4});
|
||
tabellaEmittentiAz.FooterColumns.Add(new ColumnPDF("Franchigia", 65, HorizontalAlignmentType.Destra, true, true, 6, ColumnType.Decimale){ PaddingRight=4});
|
||
tabellaEmittentiAz.FooterColumns.Add(new ColumnPDF("Concentrazione", 70, HorizontalAlignmentType.Destra, true, true, 6, ColumnType.Decimale){ PaddingRight=4});
|
||
tabellaEmittentiAz.FooterColumns.Add(new ColumnPDF("Soglia", 70, HorizontalAlignmentType.Destra, true, true, 6, ColumnType.Decimale){ PaddingRight=4});
|
||
tabellaEmittentiAz.FooterColumns.Add(new ColumnPDF("Adeguatezza", 65, HorizontalAlignmentType.Centrato, true, true, 6, ColumnType.Testo) { PaddingRight = 4 });
|
||
|
||
for (int l = 0; l < dati.Tables["emittentiAz"].Rows.Count; l++)
|
||
{
|
||
DataRow concetrazione = dati.Tables["emittentiAz"].Rows[l];
|
||
int indexEmittente = 0;
|
||
int indexAdeguatezza = 5;
|
||
|
||
tabellaEmittentiAz.Cells[0, l].Value = concetrazione["Emittenti"].ToString().ToLower().Contains("titoli") ? " <i>" + concetrazione["Emittenti"].ToString() + "</i>" : concetrazione["Emittenti"].ToString();
|
||
|
||
switch (concetrazione["Adeguatezza"].ToString())
|
||
{
|
||
case "Adeguato":
|
||
concetrazione["Adeguatezza"] = "Adeguato";
|
||
tabellaEmittentiAz.Cells[indexAdeguatezza, l].FontColor = ColorPDF.Verde;
|
||
break;
|
||
case "Non adeguato":
|
||
concetrazione["Adeguatezza"] = "Non adeguato";
|
||
tabellaEmittentiAz.Cells[indexAdeguatezza, l].FontColor = ColorPDF.Rosso;
|
||
break;
|
||
default:
|
||
concetrazione["Adeguatezza"] = "n.a.";
|
||
tabellaEmittentiAz.Cells[indexAdeguatezza, l].FontColor = ColorPDF.Nero;
|
||
break;
|
||
}
|
||
tabellaEmittentiAz.Cells[1, l].HorizontalAlignment =
|
||
tabellaEmittentiAz.Cells[2, l].HorizontalAlignment =
|
||
tabellaEmittentiAz.Cells[3, l].HorizontalAlignment =
|
||
tabellaEmittentiAz.Cells[4, l].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
}
|
||
AddElement(tabellaEmittentiAz);
|
||
if (flagFiduciariaPlurimandato)
|
||
{
|
||
string testoazionarie = "In tabella sono riportati gli emittenti relativi a tutte le azioni detenute dai mandati fiduciari associati al medesimo fiduciante a cui appartiene il mandato " + datiSeiUnico.getClienteReport().codiceMandato + ".";
|
||
AddElement(new SpacePDF(10));
|
||
AddElement(new FormattedTextAreaPDF("(*) " + testoazionarie, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
}
|
||
AddElement(new SpacePDF(25));
|
||
}
|
||
#endregion
|
||
|
||
#region fondi speculativi
|
||
if (dati.Tables["fondi"].Rows.Count > 0)
|
||
{
|
||
var tabellaFondi = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["fondi"], dati.Tables["fondifooter"])
|
||
{
|
||
Style = Style.ConsulenzaUnica,
|
||
Footer = true,
|
||
AlternateRow = false,
|
||
ShowBorderLastLine = false,
|
||
HeaderHeight = 30,
|
||
HeaderFontSize = 7,
|
||
RowHeight = 25,
|
||
ShowSeparationLines = true,
|
||
ShowFooterSeparationLines = true
|
||
};
|
||
|
||
tabellaFondi.Columns.Add(new ColumnPDF("Emittente", 150, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Emittenti", "Fondi speculativi") { HeaderFontSize = 7, PaddingRight = 5, BackgroundColor = ColorPDF.Bianco, FontSize = 7 });
|
||
tabellaFondi.Columns.Add(new ColumnPDF("Controvaloreproposto", 110, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Controvaloreproposto", "Controvalore attuale (€)") { DeltaYContent=4, PaddingRight = 5, HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco });
|
||
//tabellaFondi.Columns.Add(new ColumnPDF("Franchigia", 65, HorizontalAlignmentType.Destra, false, false, 7, ColumnType.Testo, "Franchigia", "Franchigia<br>controvalore (€)") { BackgroundColor = ColorPDF.Bianco });
|
||
tabellaFondi.Columns.Add(new ColumnPDF("Concentrazione", 100, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Concentrazione", "Concentrazione (%)") { DeltaYContent=4, PaddingRight = 5, HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaFondi.Columns.Add(new ColumnPDF("Soglia", 90, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "Sogliaconcentrazione", "Soglia di concentrazione (%)") { PaddingRight = 5, HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco });
|
||
tabellaFondi.Columns.Add(new ColumnPDF("Adeguatezza", 70, HorizontalAlignmentType.Centrato, false, false, 7, ColumnType.Testo, "Adeguatezza", "Adeguatezza") { PaddingRight = 5, HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco });
|
||
|
||
tabellaFondi.FooterColumns.Add(new ColumnPDF("Emittente", 150, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo));
|
||
tabellaFondi.FooterColumns.Add(new ColumnPDF("Controvaloreproposto", 110, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 4 });
|
||
//tabellaFondi.FooterColumns.Add(new ColumnPDF("Franchigia", 65, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Testo));
|
||
tabellaFondi.FooterColumns.Add(new ColumnPDF("Concentrazione", 100, HorizontalAlignmentType.Destra, true, true,7, ColumnType.Decimale) { PaddingRight = 4 });
|
||
tabellaFondi.FooterColumns.Add(new ColumnPDF("Soglia", 90, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 4 });
|
||
tabellaFondi.FooterColumns.Add(new ColumnPDF("Adeguatezza", 70, HorizontalAlignmentType.Centrato, true, true, 7, ColumnType.Testo) { PaddingRight = 4 });
|
||
|
||
for (int l = 0; l < dati.Tables["fondi"].Rows.Count; l++)
|
||
{
|
||
DataRow concetrazione = dati.Tables["fondi"].Rows[l];
|
||
int indexEmittente = 0;
|
||
int indexAdeguatezza = 4;
|
||
|
||
tabellaFondi.Cells[0, l].Value = concetrazione["Emittenti"].ToString().ToLower().Contains("titoli") ? " <i>" + concetrazione["Emittenti"].ToString() + "</i>" : concetrazione["Emittenti"].ToString();
|
||
tabellaFondi.Cells[3, l].Value = "n.a.";
|
||
tabellaFondi.Cells[indexAdeguatezza, l].Value = "n.a.";
|
||
tabellaFondi.Cells[indexAdeguatezza, l].FontColor = ColorPDF.Nero;
|
||
|
||
tabellaFondi.Cells[1, l].HorizontalAlignment =
|
||
tabellaFondi.Cells[2, l].HorizontalAlignment =
|
||
tabellaFondi.Cells[3, l].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
}
|
||
|
||
//switch (dati.Tables["fondiFooter"].Rows[0]["Adeguatezza"].ToString())
|
||
//{
|
||
// case "Adeguato":
|
||
// tabellaFondi.FooterCells[4, 0].FontColor = ColorPDF.Verde;
|
||
// break;
|
||
// case "Non adeguato":
|
||
// tabellaFondi.FooterCells[4, 0].FontColor = ColorPDF.Rosso;
|
||
// break;
|
||
// default:
|
||
// tabellaFondi.FooterCells[4, 0].FontColor = ColorPDF.Nero;
|
||
// break;
|
||
//}
|
||
AddElement(tabellaFondi);
|
||
if (flagFiduciariaPlurimandato)
|
||
{
|
||
string testofondi = "In tabella sono riportati tutti i fondi speculativi detenuti dai mandati fiduciari associati al medesimo fiduciante a cui appartiene il mandato " + datiSeiUnico.getClienteReport().codiceMandato + ".";
|
||
AddElement(new SpacePDF(10));
|
||
AddElement(new FormattedTextAreaPDF("(*) " + testofondi, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
}
|
||
AddElement(new SpacePDF(25));
|
||
|
||
}
|
||
#endregion
|
||
|
||
#endregion
|
||
|
||
#region Orizzonete Temporale Liquidità / Liquidabilità
|
||
if (dati.Tables["orizzonte"].Rows.Count == 5)
|
||
{
|
||
|
||
if (saltoPagina)
|
||
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
||
saltoPagina = true;
|
||
|
||
var intestazioneLiquidita = new ChapterHeadingPDF(
|
||
Helper.ReplaceVariables(getCapitolo5(), base.EnvironmentFacade.ReportEnvironment),
|
||
Helper.ReplaceVariables(getTesto6(), base.EnvironmentFacade.ReportEnvironment),
|
||
EnvironmentFacade.RendererFacade.XLeftLimit,
|
||
EnvironmentFacade.RendererFacade.YUpperLimit,
|
||
EnvironmentFacade.ReportEnvironment.FontFamily);
|
||
AddElement(intestazioneLiquidita.ToElement());
|
||
|
||
|
||
#region Grafico
|
||
|
||
var series = new List<Serie>();
|
||
var coloreSerieAreaAdeguata = new ColorPDF(228, 235, 238);
|
||
var coloreSerieAreaNonAdeguata = new ColorPDF(204, 217, 222);
|
||
|
||
var graficoCombination = new CombinationPDF(EnvironmentFacade.RendererFacade.XLeftLimit+80, 1F)
|
||
{
|
||
Name = "comb",
|
||
Height = 200,
|
||
Width = 400,
|
||
MinorGridAxisY = false,
|
||
BackColor = coloreSerieAreaNonAdeguata,
|
||
|
||
MarginAxisY = 0,
|
||
ShowLineAxisY = true,
|
||
ShowLabelAxisY = true,
|
||
StartFromZeroAxisY = true,
|
||
MaximumValueAxisY = 100, // valore fisso
|
||
IntervalNumberAxisY = 6,
|
||
CustomLabelAxisY = new List<CombinationPDFCustomLabel>(){
|
||
new CombinationPDFCustomLabel{Text = "0,00%", Value = 0d},
|
||
new CombinationPDFCustomLabel{Text = "20,00%", Value = 20d},
|
||
new CombinationPDFCustomLabel{Text = "40,00%", Value = 40d},
|
||
new CombinationPDFCustomLabel{Text = "60,00%", Value = 60d},
|
||
new CombinationPDFCustomLabel{Text = "80,00%", Value = 80d},
|
||
new CombinationPDFCustomLabel{Text = "100,00%", Value = 100d}
|
||
},
|
||
|
||
ShowLineAxisX = true,
|
||
ShowLabelAxisX = true,
|
||
StartFromZeroAxisX = true,
|
||
MaximumValueAxisX = 5, // valore fisso
|
||
IntervalNumberAxisX = 5,
|
||
CustomLabelAxisX = new List<CombinationPDFCustomLabel>(){
|
||
new CombinationPDFCustomLabel{Text = "", Value = 1d},
|
||
new CombinationPDFCustomLabel{Text = "", Value = 2d},
|
||
new CombinationPDFCustomLabel{Text = "", Value = 3d},
|
||
new CombinationPDFCustomLabel{Text = "", Value = 4d},
|
||
new CombinationPDFCustomLabel{Text = "", Value = 5d}
|
||
}
|
||
};
|
||
|
||
series.Add(
|
||
new Serie
|
||
{
|
||
Name = "AreaDiAdeguatezza",
|
||
Type = Dundas.Charting.WebControl.SeriesChartType.Area,
|
||
Color = coloreSerieAreaAdeguata,
|
||
BorderColor = ColorPDF.Nero,
|
||
BorderWidth = 1,
|
||
Points = new List<Point>() {
|
||
new Point {Values = new ValuesPointXY(0d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[4]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata},
|
||
new Point {Values = new ValuesPointXY(1d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[4]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata},
|
||
new Point {Values = new ValuesPointXY(1d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[3]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata},
|
||
new Point {Values = new ValuesPointXY(2d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[3]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata},
|
||
new Point {Values = new ValuesPointXY(2d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[2]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata},
|
||
new Point {Values = new ValuesPointXY(3d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[2]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata},
|
||
new Point {Values = new ValuesPointXY(3d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[1]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata},
|
||
new Point {Values = new ValuesPointXY(4d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[1]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata},
|
||
new Point {Values = new ValuesPointXY(4d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[0]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata},
|
||
new Point {Values = new ValuesPointXY(5d, Convert.ToDouble(dati.Tables["orizzonte"].Rows[0]["AdegOT"])),ShowLabelAxisY = false,ShowLabelAxisX = false,Color = coloreSerieAreaAdeguata}
|
||
}
|
||
}
|
||
);
|
||
|
||
graficoCombination.SeriesCollection = series;
|
||
|
||
AddElement(graficoCombination);
|
||
|
||
var wx = graficoCombination.Width / graficoCombination.IntervalNumberAxisX;
|
||
bool mostraAdeguatezza = dati.Tables["orizzonte"].AsEnumerable().FirstOrDefault(x => x.Field<string>("Adeguatezza").Equals("Adeguato")) != null ? true : false;
|
||
bool mostraNonAdeguatezza = dati.Tables["orizzonte"].AsEnumerable().FirstOrDefault(x => x.Field<string>("Adeguatezza").Equals("Non adeguato")) != null ? true : false;
|
||
if(mostraAdeguatezza)
|
||
AddElement(new FormattedTextAreaPDF("Area di adeguatezza", graficoCombination.X + 20) { DeltaY = -20, FontSize = 7, AutoIncrementYWritable = false });
|
||
if (mostraNonAdeguatezza)
|
||
AddElement(new FormattedTextAreaPDF("Area di non adeguatezza", graficoCombination.X + 300) { DeltaY = -190, FontSize = 7, AutoIncrementYWritable = false });
|
||
|
||
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[4]["Orizzonte"].ToString(), graficoCombination.X + 18 + wx * 0) {DeltaY=5, FontSize = 7, AutoIncrementYWritable = false });
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[3]["Orizzonte"].ToString(), graficoCombination.X + 18 + wx * 1) { DeltaY = 5, FontSize = 7, AutoIncrementYWritable = false });
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[2]["Orizzonte"].ToString(), graficoCombination.X + 18 + wx * 2) { DeltaY = 5, FontSize = 7, AutoIncrementYWritable = false });
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[1]["Orizzonte"].ToString(), graficoCombination.X + 18 + wx * 3) { DeltaY = 5, FontSize = 7, AutoIncrementYWritable = false });
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[0]["Orizzonte"].ToString(), graficoCombination.X + 18 + wx * 4) { DeltaY = 5, FontSize = 7, AutoIncrementYWritable = false });
|
||
|
||
float allocOT = Convert.ToSingle(dati.Tables["orizzonte"].Rows[4]["AllocOT"]);
|
||
allocOT = allocOT > 97 ? 97 : allocOT < 4 ? 4 : allocOT;
|
||
float deltaY = allocOT * -2;
|
||
float iDeltaY0 = Convert.ToSingle(dati.Tables["orizzonte"].Rows[0]["AllocOT"]) == 0 ? -2.5F : Convert.ToSingle(dati.Tables["orizzonte"].Rows[0]["AllocOT"]) == 100 ? 11 : 4;
|
||
float iDeltaY1 = Convert.ToSingle(dati.Tables["orizzonte"].Rows[1]["AllocOT"]) == 0 ? -2.5F : Convert.ToSingle(dati.Tables["orizzonte"].Rows[1]["AllocOT"]) == 100 ? 11 : 4;
|
||
float iDeltaY2 = Convert.ToSingle(dati.Tables["orizzonte"].Rows[2]["AllocOT"]) == 0 ? -2.5F : Convert.ToSingle(dati.Tables["orizzonte"].Rows[2]["AllocOT"]) == 100 ? 11 : 4;
|
||
float iDeltaY3 = Convert.ToSingle(dati.Tables["orizzonte"].Rows[3]["AllocOT"]) == 0 ? -2.5F : Convert.ToSingle(dati.Tables["orizzonte"].Rows[3]["AllocOT"]) == 100 ? 11 : 4;
|
||
float iDeltaY4 = Convert.ToSingle(dati.Tables["orizzonte"].Rows[4]["AllocOT"]) == 0 ? -2.5F : Convert.ToSingle(dati.Tables["orizzonte"].Rows[4]["AllocOT"]) == 100 ? 11 : 4;
|
||
|
||
|
||
float xg = graficoCombination.X + wx / 2 + wx * 0;
|
||
//AddElement(new RectanglePDF(xg, 7.000f, 7.000f, new ColorPDF(4, 112, 190)) { DeltaY = deltaY - 4, AutoIncrementYWritable = false, Angle = 45 });
|
||
AddElement(new RectanglePDF(xg, 7.000f, 7.000f, new ColorPDF(4, 112, 190)) { DeltaY = deltaY - iDeltaY4, AutoIncrementYWritable = false, Angle = 45 });
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[4]["AllocOTDesc"].ToString(), xg + 10) { DeltaY = deltaY - 3, FontSize = 7, AutoIncrementYWritable = false });
|
||
|
||
allocOT = Convert.ToSingle(dati.Tables["orizzonte"].Rows[3]["AllocOT"]);
|
||
allocOT = allocOT > 97 ? 97 : allocOT < 4 ? 4 : allocOT;
|
||
deltaY = allocOT * -2;
|
||
xg = graficoCombination.X + wx / 2 + wx * 1;
|
||
AddElement(new RectanglePDF(xg, 7.000f, 7.000f, new ColorPDF(4, 112, 190)) { DeltaY = deltaY - iDeltaY3, AutoIncrementYWritable = false, Angle = 45 });
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[3]["AllocOTDesc"].ToString(), xg + 10) { DeltaY = deltaY - 3, FontSize = 7, AutoIncrementYWritable = false });
|
||
|
||
allocOT = Convert.ToSingle(dati.Tables["orizzonte"].Rows[2]["AllocOT"]);
|
||
allocOT = allocOT > 97 ? 97 : allocOT < 4 ? 4 : allocOT;
|
||
deltaY = allocOT * -2;
|
||
xg = graficoCombination.X + wx / 2 + wx * 2;
|
||
AddElement(new RectanglePDF(xg, 7.000f, 7.000f, new ColorPDF(4, 112, 190)) { DeltaY = deltaY - iDeltaY2, AutoIncrementYWritable = false, Angle = 45 });
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[2]["AllocOTDesc"].ToString(), xg + 10) { DeltaY = deltaY - 3, FontSize = 7, AutoIncrementYWritable = false });
|
||
|
||
allocOT = Convert.ToSingle(dati.Tables["orizzonte"].Rows[1]["AllocOT"]);
|
||
allocOT = allocOT > 97 ? 97 : allocOT < 4 ? 4 : allocOT;
|
||
deltaY = allocOT * -2;
|
||
xg = graficoCombination.X + wx / 2 + wx * 3;
|
||
AddElement(new RectanglePDF(xg, 7.000f, 7.000f, new ColorPDF(4, 112, 190)) { DeltaY = deltaY - iDeltaY1, AutoIncrementYWritable = false, Angle = 45 });
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[1]["AllocOTDesc"].ToString(), xg + 10) { DeltaY = deltaY - 3, FontSize = 7, AutoIncrementYWritable = false });
|
||
|
||
allocOT = Convert.ToSingle(dati.Tables["orizzonte"].Rows[0]["AllocOT"]);
|
||
allocOT = allocOT > 97 ? 97 : allocOT < 4 ? 4 : allocOT;
|
||
deltaY = allocOT * -2;
|
||
xg = graficoCombination.X + wx / 2 + wx * 4;
|
||
AddElement(new RectanglePDF(xg, 7.000f, 7.000f, new ColorPDF(4, 112, 190)) { DeltaY = deltaY - iDeltaY0, AutoIncrementYWritable = false, Angle = 45 });
|
||
AddElement(new FormattedTextAreaPDF(dati.Tables["orizzonte"].Rows[0]["AllocOTDesc"].ToString(), xg + 10) { DeltaY = deltaY - 3, FontSize = 7, AutoIncrementYWritable = false });
|
||
|
||
|
||
AddElement(new SpacePDF(30));
|
||
|
||
#endregion
|
||
|
||
#region ADEGUATEZZA CAP ultimo
|
||
|
||
|
||
var tabellaProgetti = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["orizzonte"])
|
||
{
|
||
Style = Style.ConsulenzaUnica,
|
||
HeaderHeight = 30,
|
||
AlternateRow = false,
|
||
ShowSeparationLines = true,
|
||
Footer = false,
|
||
ShowFooterSeparationLines = true
|
||
};
|
||
|
||
tabellaProgetti.Columns.Add(new ColumnPDF("Oriztemp", 120, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Orizzonte", "Orizzonte<br>temporale") { HeaderFontSize = 7, FontSize=7});
|
||
tabellaProgetti.Columns.Add(new ColumnPDF("Quest", 90, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Questionario", "Questionario <br>MiFID (%)") { HeaderFontSize = 7, PaddingRight = 10, FontSize = 7 });
|
||
tabellaProgetti.Columns.Add(new ColumnPDF("Port", 90, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Portafoglioattuale", "Portafoglio <br>attuale (%)") { HeaderFontSize = 7, PaddingRight = 10, FontSize = 7 });
|
||
tabellaProgetti.Columns.Add(new ColumnPDF("Adeg", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "AdegOTString", "Adeguatezza per OT (%)") { HeaderFontSize = 7, PaddingRight = 10, FontSize = 7 });
|
||
tabellaProgetti.Columns.Add(new ColumnPDF("Alloc", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "AllocOTDesc", "Alloc. attuale per OT (%)") { HeaderFontSize = 7, PaddingRight = 10, FontSize = 7 });
|
||
tabellaProgetti.Columns.Add(new ColumnPDF("Adeguatezza", 80, HorizontalAlignmentType.Centrato, false, false, 7, ColumnType.Testo, "Adeguatezza", "Adeguatezza") { HeaderFontSize = 7, FontSize = 7 });
|
||
int z = 0;
|
||
foreach (DataRow r in dati.Tables["orizzonte"].Rows)
|
||
{
|
||
switch (r["Adeguatezza"].ToString())
|
||
{
|
||
case "S":
|
||
r["Adeguatezza"] = "Adeguato";
|
||
tabellaProgetti.Cells[5, z].FontColor = ColorPDF.Verde;
|
||
break;
|
||
case "N":
|
||
r["Adeguatezza"] = "Non adeguato";
|
||
tabellaProgetti.Cells[5, z].FontColor = ColorPDF.Rosso;
|
||
break;
|
||
default:
|
||
r["Adeguatezza"] = "n.a.";
|
||
tabellaProgetti.Cells[5, z].FontColor = ColorPDF.Nero;
|
||
break;
|
||
}
|
||
//tabellaProgetti.Cells[5, z].Value = r["Adeguatezza"] == null ? "n.a." : r["Adeguatezza"].ToString().Equals("S") ? "Adeguato" : r["Adeguatezza"].ToString().Equals("N") ? "Non adeguato" : r["Adeguatezza"].ToString();
|
||
// tabellaProgetti.Cells[5, z].FontColor = r["Adeguatezza"] == null ? ColorPDF.Nero : r["Adeguatezza"].ToString().Equals("S") ? ColorPDF.Verde : r["Adeguatezza"].ToString().Equals("N") ? ColorPDF.Rosso : ColorPDF.Nero;
|
||
tabellaProgetti.Cells[1, z].HorizontalAlignment =
|
||
tabellaProgetti.Cells[2, z].HorizontalAlignment =
|
||
tabellaProgetti.Cells[3, z].HorizontalAlignment =
|
||
tabellaProgetti.Cells[4, z].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
||
z++;
|
||
}
|
||
|
||
AddElement(tabellaProgetti);
|
||
if (flagFiduciariaPlurimandato)
|
||
{
|
||
string testoorizzonte = "La ripartizione del patrimonio $/Banca/$ sui diversi orizzonti temporali prende in considerazione tutti i prodotti detenuti dai mandati fiduciari associati al medesimo fiduciante a cui appartiene il mandato " + datiSeiUnico.getClienteReport().codiceMandato + ".";
|
||
AddElement(new SpacePDF(10));
|
||
AddElement(new FormattedTextAreaPDF("(*) " + datiSeiUnico.FormatBanca(testoorizzonte), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
||
}
|
||
#endregion
|
||
|
||
|
||
}
|
||
|
||
#endregion
|
||
|
||
}
|
||
|
||
protected sealed override DataTable GetDataTable()
|
||
{
|
||
return null;
|
||
}
|
||
|
||
protected sealed override DataSet GetDataSet()
|
||
{
|
||
//Adriano
|
||
#region Cliente professionale
|
||
var cliente = datiSeiUnico.clienteUnit().anagrafica;
|
||
|
||
bool profiloProfessionale;
|
||
bool profiloAggressivo;
|
||
bool profiloProfessionaleAggressivo;
|
||
|
||
Profiler profiler;
|
||
profiler = new Profiler(cliente);
|
||
|
||
profiloProfessionale = profiler.ProfiloProfessionale;
|
||
profiloAggressivo = profiler.ProfiloAggressivo;
|
||
profiloProfessionaleAggressivo = profiler.ProfiloProfessionaleAggressivo;
|
||
|
||
#endregion
|
||
//--Adriano
|
||
|
||
//Adriano: inserito var notaContrazioneProdottiComplessi da sostituire a chiamata diretta della getNota407() nel Draw(), da valorizzare solo in caso di Clienti retail
|
||
// essendo richiesta l'omissione della suddetta nota per i Clienti Professionali
|
||
notagradoCoperturaComplessita = "";
|
||
notaConcentrazioneProdottiComplessi = "";
|
||
if (!profiloProfessionale)
|
||
notaConcentrazioneProdottiComplessi = getNota407();
|
||
//--Adriano
|
||
#region datatable
|
||
var ds = new DataSet();
|
||
ds.Tables.Add(new DataTable("patrimoni"));
|
||
ds.Tables.Add(new DataTable("indicatori"));
|
||
ds.Tables.Add(new DataTable("prodotti"));
|
||
ds.Tables.Add(new DataTable("prodottifooter"));
|
||
ds.Tables.Add(new DataTable("emittentiObb"));
|
||
ds.Tables.Add(new DataTable("emittentiObbfooter"));
|
||
ds.Tables.Add(new DataTable("emittentiAz"));
|
||
ds.Tables.Add(new DataTable("emittentiAzfooter"));
|
||
ds.Tables.Add(new DataTable("fondi"));
|
||
ds.Tables.Add(new DataTable("fondifooter"));
|
||
ds.Tables.Add(new DataTable("orizzonte"));
|
||
|
||
ds.Tables["patrimoni"].Columns.Add(new DataColumn("Descrizione", typeof(string)));
|
||
ds.Tables["patrimoni"].Columns.Add(new DataColumn("Valore", typeof(string)));
|
||
|
||
ds.Tables["indicatori"].Columns.Add(new DataColumn("Indicatore", typeof(string)));
|
||
ds.Tables["indicatori"].Columns.Add(new DataColumn("Patrimonio", typeof(string)));
|
||
ds.Tables["indicatori"].Columns.Add(new DataColumn("Sogliamassima", typeof(string)));
|
||
ds.Tables["indicatori"].Columns.Add(new DataColumn("Gradocopertura", typeof(string)));
|
||
ds.Tables["indicatori"].Columns.Add(new DataColumn("Adeguatezza", typeof(string)));
|
||
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("Area", typeof(string)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("Progetto", typeof(string)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("CodiceContratto", typeof(string)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("Descrizione", typeof(string)));
|
||
// Modifica per Saving Map
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("SavingMap", typeof(string)));
|
||
// Fine Modifica
|
||
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("Controvalore", typeof(decimal)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("Rischiomercato", typeof(string)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("Rischiocredito", typeof(string)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("Complessita", typeof(string)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("Liquidita", typeof(string)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("Ordinamento", typeof(int)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("FontBold", typeof(bool)));
|
||
ds.Tables["prodotti"].Columns.Add(new DataColumn("BackgroundGray", typeof(bool)));
|
||
|
||
ds.Tables["prodottifooter"].Columns.Add(new DataColumn("patrimonio", typeof(string)));
|
||
ds.Tables["prodottifooter"].Columns.Add(new DataColumn("Complessivo", typeof(string)));
|
||
ds.Tables["prodottifooter"].Columns.Add(new DataColumn("varDecodificato", typeof(string)));
|
||
ds.Tables["prodottifooter"].Columns.Add(new DataColumn("rischioCreditoDecodificato", typeof(string)));
|
||
ds.Tables["prodottifooter"].Columns.Add(new DataColumn("descrizioneClasseComplessita", typeof(string)));
|
||
ds.Tables["prodottifooter"].Columns.Add(new DataColumn("FontBold", typeof(bool)));
|
||
ds.Tables["prodottifooter"].Columns.Add(new DataColumn("BackgroundGray", typeof(bool)));
|
||
#endregion
|
||
|
||
|
||
#region profilo finanziario
|
||
bool visualizzaTabellaIndicatoriSintesi = GetOption<Opzione4_1>().Valore;
|
||
bool visualizzaTabellaProdotti = GetOption<Opzione4_2>().Valore;
|
||
bool visualizzaSchedaEmittenti = GetOption<Opzione4_3>().Valore;
|
||
bool visualizzaSchedaLiquidita = GetOption<Opzione4_4>().Valore;
|
||
|
||
bool visualizzaDelegato = (String.IsNullOrEmpty(GetOption<Opzione5_3>().Valore)) ? false : true;
|
||
|
||
|
||
var adeguatezza = datiSeiUnico.rischioUnit().adeguatezza;
|
||
|
||
|
||
var dataprofilo = adeguatezza.adeguatezzaTopBean.caratteristicheCliente.dtInizioValiditaProfilo;
|
||
var dataProfiloEC = adeguatezza.adeguatezzaTopBean.caratteristicheCliente.dtInizioValiditaProfiloEC;
|
||
var delegato = getDelegato();
|
||
//var listaDelegati = adeguatezza.adeguatezzaTopBean.delegati;
|
||
//int idxDelegato = -1;
|
||
//if (visualizzaDelegato)
|
||
//{
|
||
// string cfDelegato = GetOption<Opzione5_3>().Valore;
|
||
// foreach ( var delegato in listaDelegati )
|
||
// {
|
||
// if (delegato.codiceFiscale.Equals(cfDelegato))
|
||
// {
|
||
// idxDelegato++;
|
||
// }
|
||
// }
|
||
//}
|
||
|
||
|
||
string profiloFinanziario = (adeguatezza.adeguatezzaTopBean.caratteristicheCliente.profilo.Equals(0) ?
|
||
"" : adeguatezza.adeguatezzaTopBean.caratteristicheCliente.profilo + " - ") + adeguatezza.adeguatezzaTopBean.profile;
|
||
|
||
ds.Tables["patrimoni"].Rows.Add(
|
||
"Profilo finanziario",
|
||
profiloFinanziario
|
||
);
|
||
ds.Tables["patrimoni"].Rows.Add(
|
||
"Data inizio validità",
|
||
dataprofilo != DateTime.MinValue ? dataprofilo.ToShortDateString().Substring(0, 10) : "n.a."
|
||
);
|
||
ds.Tables["patrimoni"].Rows.Add(
|
||
"Profilo esperienza e conoscenza",
|
||
adeguatezza.adeguatezzaTopBean.caratteristicheCliente.descrizioneEsperienzaConoscenza
|
||
);
|
||
ds.Tables["patrimoni"].Rows.Add(
|
||
"Data inizio validità",
|
||
dataProfiloEC != DateTime.MinValue ? dataProfiloEC.ToShortDateString().Substring(0, 10) : "n.a."
|
||
);
|
||
|
||
//if (!visualizzaDelegato)
|
||
//{
|
||
// ds.Tables["patrimoni"].Rows.Add(
|
||
// string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", base.EnvironmentFacade.ReportEnvironment)),
|
||
// dataprofilo == DateTime.MinValue
|
||
// ? "n.a." : adeguatezza.adeguatezzaTopBean.isAdeguato ? "Adeguato" : "Non adeguato"
|
||
// );
|
||
//}
|
||
//else
|
||
//{
|
||
// ds.Tables["patrimoni"].Rows.Add(
|
||
// string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", base.EnvironmentFacade.ReportEnvironment)),
|
||
// dataprofilo == DateTime.MinValue
|
||
// ? "n.a." : adeguatezza.adeguatezzaTopBean.isAdeguato ? "Adeguato" : "Non adeguato"
|
||
// );
|
||
//}
|
||
|
||
//ds.Tables["patrimoni"].Rows.Add(
|
||
// string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", base.EnvironmentFacade.ReportEnvironment)),
|
||
// dataprofilo == DateTime.MinValue
|
||
// ? "n.a." : adeguatezza.adeguatezzaTopBean.isAdeguato ? "Adeguato" : "Non adeguato"
|
||
//);
|
||
|
||
// ds.Tables["patrimoni"].Rows.Add(
|
||
// string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", base.EnvironmentFacade.ReportEnvironment)),
|
||
// dataprofilo == DateTime.MinValue
|
||
// ? "n.a." : adeguatezza.adeguatezzaTopBean.isAdeguato ? "Adeguato" : "n.a."
|
||
//);
|
||
|
||
ds.Tables["patrimoni"].Rows.Add(
|
||
string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", base.EnvironmentFacade.ReportEnvironment)),
|
||
//adeguatezza.adeguatezzaTopBean.isAdeguatoSpecified == false ? "n.a." : adeguatezza.adeguatezzaTopBean.isAdeguato ? "Adeguato" : "n.a."
|
||
//20180906 AC:
|
||
adeguatezza.adeguatezzaTopBean.isAdeguatoSpecified == false ? "Non Adeguato" : adeguatezza.adeguatezzaTopBean.isAdeguato ? "Adeguato" : "Non Adeguato"
|
||
);
|
||
|
||
|
||
|
||
|
||
|
||
|
||
#endregion
|
||
|
||
#region indicatore di sintesi
|
||
|
||
if (visualizzaTabellaIndicatoriSintesi)
|
||
{
|
||
try
|
||
{
|
||
gradoCoperturaRM = Convert.ToDouble(adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o => o.id == "RM").copertura.Replace(".", ",")) > 0 && Convert.ToDouble(adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o => o.id == "RM").copertura.Replace(".", ",")) < 90;
|
||
gradoCoperturaRC = Convert.ToDouble(adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o => o.id == "RC").copertura.Replace(".", ",")) > 0 && Convert.ToDouble(adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o => o.id == "RC").copertura.Replace(".", ",")) < 90;
|
||
}
|
||
catch
|
||
{}
|
||
foreach (var item in from a in adeguatezza.adeguatezzaTopBean.listaAdeguatezza orderby a.criterioOrdinamento select a)
|
||
|
||
{
|
||
|
||
//string adeguato = dataprofilo == DateTime.MinValue ? "<font color='#000000'>n.a.</font>" : item.isAdeguato.ToString().ToLower() == "true" ? "<font color='#00b046'>Adeguato</font>" : "<font color='#ff0000'>Non adeguato</font>";
|
||
|
||
|
||
string adeguato = item.isAdeguatoSpecified == false ? "<font color='#ff0000'>Non adeguato</font>" : item.isAdeguato.ToString().ToLower() == "true" ? "<font color='#00b046'>Adeguato</font>" : "<font color='#ff0000'>Non adeguato</font>";
|
||
|
||
|
||
//string indicatore = item.descrizioneFlag;
|
||
//BugFix #2398 Aggiunto controllo per mettere la lettera maiuscola al patrimonio e alla Sogliamassima
|
||
DataRow ro = ds.Tables["indicatori"].NewRow();
|
||
if (item.id == "CM" && profiloProfessionale == false)
|
||
notagradoCoperturaComplessita = getNota6(item.copertura);
|
||
|
||
ro["Indicatore"] = item.id=="CC" ? "Concentrazione prodotti <br>complessi (%)" : item.id=="CM" ? item.descrizioneFlag + "*" : (item.id=="RM" && gradoCoperturaRM) ? item.descrizioneFlag+"*" : item.id=="RC" && gradoCoperturaRC ? item.descrizioneFlag+"*" : item.descrizioneFlag;
|
||
ro["Patrimonio"] = item.descrizioneFlag.ToLower().Contains("emittenti") || item.descrizioneFlag.ToLower().Contains("liq") ? "-" : item.patrimonioFideuram.ToLower().Contains("n.a.") || item.patrimonioFideuram.ToLower().Contains("n.d.") || item.patrimonioFideuram.ToLower().Contains("n.c.") ? item.patrimonioFideuram.ToLower() : Helper.CapitalizeWords(item.patrimonioFideuram).Replace(".", ",");
|
||
#region gestione errata delegato
|
||
//if (visualizzaDelegato)
|
||
//{
|
||
// switch (item.descrizioneFlag.ToLower())
|
||
// {
|
||
// case "complessità":
|
||
// ro["Sogliamassima"] = delegato.desProfiloEC;
|
||
// ro["Adeguatezza"] = adeguato;
|
||
// break;
|
||
// case "frequenza":
|
||
// ro["Sogliamassima"] = item.soglia.ToLower().Contains("-") || item.soglia.ToLower().Contains("n.a.") || item.soglia.ToLower().Contains("n.d.") || item.soglia.ToLower().Contains("n.c.") ? item.soglia.ToLower() : item.soglia.ToLower().Contains("classe") || item.soglia.ToLower().Contains("alta") || item.soglia.ToLower().Contains("minima") || item.soglia.ToLower().Contains("bassa") || item.soglia.ToLower().Contains("media") || item.soglia.ToLower().Contains("rischio") ? Helper.CapitalizeWords(item.soglia) : item.soglia.Length == 2 ? item.soglia + ",00" : item.soglia.Contains(".") ? item.soglia.Replace(".", ",") : item.soglia;
|
||
// ro["Adeguatezza"] = adeguato;
|
||
// break;
|
||
// default:
|
||
// ro["Sogliamassima"] = item.soglia.ToLower().Contains("-") || item.soglia.ToLower().Contains("n.a.") || item.soglia.ToLower().Contains("n.d.") || item.soglia.ToLower().Contains("n.c.") ? item.soglia.ToLower() : item.soglia.ToLower().Contains("classe") || item.soglia.ToLower().Contains("alta") || item.soglia.ToLower().Contains("minima") || item.soglia.ToLower().Contains("bassa") || item.soglia.ToLower().Contains("media") || item.soglia.ToLower().Contains("rischio") ? Helper.CapitalizeWords(item.soglia) : item.soglia.Length == 2 ? item.soglia + ",00" : item.soglia.Contains(".") ? item.soglia.Replace(".", ",") : item.soglia;
|
||
// ro["Adeguatezza"] = adeguato;
|
||
// break;
|
||
// }
|
||
|
||
//}
|
||
//else
|
||
//{
|
||
// ro["Sogliamassima"] = item.soglia.ToLower().Contains("-") || item.soglia.ToLower().Contains("n.a.") || item.soglia.ToLower().Contains("n.d.") || item.soglia.ToLower().Contains("n.c.") ? item.soglia.ToLower() : item.soglia.ToLower().Contains("classe") || item.soglia.ToLower().Contains("alta") || item.soglia.ToLower().Contains("minima") || item.soglia.ToLower().Contains("bassa") || item.soglia.ToLower().Contains("media") || item.soglia.ToLower().Contains("rischio") ? Helper.CapitalizeWords(item.soglia) : item.soglia.Length == 2 ? item.soglia + ",00" : item.soglia.Contains(".") ? item.soglia.Replace(".", ",") : item.soglia;
|
||
// ro["Adeguatezza"] = adeguato;
|
||
|
||
//}
|
||
#endregion gestione errata delegato
|
||
ro["Sogliamassima"] = item.soglia.ToLower().Contains("-") || item.soglia.ToLower().Contains("n.a.") || item.soglia.ToLower().Contains("n.d.") || item.soglia.ToLower().Contains("n.c.") ? item.soglia.ToLower() : item.soglia.ToLower().Contains("classe") || item.soglia.ToLower().Contains("alta") || item.soglia.ToLower().Contains("minima") || item.soglia.ToLower().Contains("bassa") || item.soglia.ToLower().Contains("media") || item.soglia.ToLower().Contains("rischio") ? Helper.CapitalizeWords(item.soglia) : item.soglia.Length == 2 ? item.soglia + ",00" : item.soglia.Contains(".") ? item.soglia.Replace(".", ",") : item.soglia;
|
||
ro["Adeguatezza"] = adeguato;
|
||
ro["Gradocopertura"] = item.copertura.Contains("-") ? item.copertura : item.copertura !="n.c." ? item.copertura.Replace(".",",") : item.copertura;
|
||
ds.Tables["indicatori"].Rows.Add(ro);
|
||
}
|
||
|
||
}
|
||
#endregion
|
||
|
||
#region prodotti
|
||
|
||
if (visualizzaTabellaProdotti)
|
||
{
|
||
switch (raggruppaProdotti())
|
||
{
|
||
case RaggruppaProdotti.Categoria:
|
||
foreach (var item in from l in adeguatezza.listaProdottiCategoria.items orderby l.ordinamento, l.currentEquivalent descending select l)
|
||
{
|
||
ds.Tables["prodotti"].Rows.Add(
|
||
item.name,
|
||
"",//item.name, prova
|
||
"",
|
||
"",
|
||
// SavingMap
|
||
"",
|
||
// Fine
|
||
item.currentEquivalent,
|
||
getFormat(item.marketRisk),
|
||
"-",
|
||
"-",
|
||
"-",
|
||
item.ordinamento,
|
||
true,
|
||
true
|
||
);
|
||
ElencoProdotti(ds.Tables["prodotti"], item, item.ordinamento);
|
||
}
|
||
TotaleRisorseCategoria(ds.Tables["prodotti"], adeguatezza.listaProdottiCategoria, int.MaxValue);
|
||
break;
|
||
case RaggruppaProdotti.Contratto:
|
||
foreach (var item in from l in adeguatezza.listaProdottiContratti.items orderby l.currentEquivalent descending select l)
|
||
{
|
||
ds.Tables["prodotti"].Rows.Add(
|
||
item.name,
|
||
"",
|
||
"",
|
||
"",
|
||
// SavingMap
|
||
"",
|
||
// Fine
|
||
item.currentEquivalent,
|
||
getFormat(item.marketRisk),
|
||
"-",
|
||
"-",
|
||
"-",
|
||
item.ordinamento,
|
||
true,
|
||
true
|
||
);
|
||
ElencoProdotti(ds.Tables["prodotti"], item, item.ordinamento);
|
||
}
|
||
TotaleRisorseContratto(ds.Tables["prodotti"], adeguatezza.listaProdottiContratti, int.MaxValue);
|
||
break;
|
||
default:
|
||
foreach (var item in from l in adeguatezza.listaProdottiArea.items orderby l.ordinamento, l.currentEquivalent select l)
|
||
{
|
||
if (item.currentEquivalent > 0)
|
||
{
|
||
ds.Tables["prodotti"].Rows.Add(
|
||
item.name,
|
||
"",
|
||
"",
|
||
"",
|
||
// SavingMap
|
||
"",
|
||
// Fine
|
||
item.currentEquivalent,
|
||
getFormat(item.marketRisk),
|
||
"-",
|
||
"-",
|
||
"-",
|
||
item.ordinamento,
|
||
true,
|
||
true
|
||
);
|
||
ElencoProdotti(ds.Tables["prodotti"], item, item.ordinamento);
|
||
}
|
||
}
|
||
TotaleRisorseAreaBisogno(ds.Tables["prodotti"], adeguatezza.listaProdottiArea, int.MaxValue);
|
||
break;
|
||
}
|
||
|
||
DataRow rf = ds.Tables["prodottifooter"].NewRow();
|
||
rf["patrimonio"] = string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", base.EnvironmentFacade.ReportEnvironment));
|
||
rf["Complessivo"] = datiSeiUnico.CASA_TOTALE;
|
||
rf["varDecodificato"] = adeguatezza.listaProdottiArea.total.marketRisk;
|
||
rf["rischioCreditoDecodificato"] = adeguatezza.listaProdottiArea.total.creditRisk.Equals("n.a.") ? adeguatezza.listaProdottiArea.total.creditRisk : adeguatezza.listaProdottiArea.total.creditRisk.Substring(0, 1).ToUpper() + adeguatezza.listaProdottiArea.total.creditRisk.Substring(1, adeguatezza.listaProdottiArea.total.creditRisk.Length - 2) + adeguatezza.listaProdottiArea.total.creditRisk.Substring(adeguatezza.listaProdottiArea.total.creditRisk.Length - 1).ToUpper();
|
||
rf["descrizioneClasseComplessita"] = adeguatezza.listaProdottiArea.total.complexity.Substring(0, 1).ToUpper() + adeguatezza.listaProdottiArea.total.complexity.Substring(1);
|
||
rf["FontBold"] = true;
|
||
rf["BackgroundGray"] = true;
|
||
//rf["descrizioneClasseComplessita"] += getNota1().Length > 0 ? "*" : "";
|
||
ds.Tables["prodottifooter"].Rows.Add(rf);
|
||
|
||
}
|
||
|
||
|
||
#endregion
|
||
|
||
#region focus emittenti obbligazionari
|
||
|
||
if (visualizzaSchedaEmittenti)
|
||
{
|
||
ElencoConcentrazioneTitoli(
|
||
ds.Tables["emittentiObb"],
|
||
adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.obbligazionari,
|
||
0
|
||
);
|
||
TotaleConcentrazioneTitoli(ds.Tables["emittentiObbfooter"],
|
||
"Totale emittenti obbligazionari",
|
||
adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.ctvTotaleObbligazionari,
|
||
adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.concentrazioneTotObbligazionari);
|
||
}
|
||
|
||
|
||
|
||
#endregion
|
||
|
||
#region focus emittenti azionari
|
||
if (visualizzaSchedaEmittenti)
|
||
{
|
||
ElencoConcentrazioneTitoli(
|
||
ds.Tables["emittentiAz"],
|
||
adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.azionari,
|
||
0
|
||
);
|
||
TotaleConcentrazioneTitoli(
|
||
ds.Tables["emittentiAzfooter"],
|
||
"Totale emittenti azionari",
|
||
adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.ctvTotaleAzionari,
|
||
adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.concentrazioneTotAzionari
|
||
);
|
||
}
|
||
#endregion
|
||
|
||
#region focus fondi speculativi
|
||
|
||
if (visualizzaSchedaEmittenti)
|
||
{
|
||
ElencoConcentrazioneTitoli(
|
||
ds.Tables["fondi"],
|
||
adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.speculativi,
|
||
0
|
||
);
|
||
if(ds.Tables["fondi"].AsEnumerable().FirstOrDefault(o => o.Field<string>("Emittenti").ToLower().Contains("fondi speculativi")) != null)
|
||
ds.Tables["fondi"].Rows.Remove(ds.Tables["fondi"].AsEnumerable().FirstOrDefault(o => o.Field<string>("Emittenti").ToLower().Contains("fondi speculativi")));
|
||
TotaleConcentrazioneTitoli(
|
||
ds.Tables["fondifooter"],
|
||
"Totale fondi speculativi",
|
||
adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.ctvTotaleSpeculativi,
|
||
adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.concentrazioneTotSpeculativi);
|
||
}
|
||
|
||
|
||
#endregion
|
||
|
||
#region Orizzonte Temporale Liquidità / Liquidabilità
|
||
|
||
ds.Tables["orizzonte"].Columns.Add(new DataColumn("Orizzonte", typeof(string)));
|
||
ds.Tables["orizzonte"].Columns.Add(new DataColumn("Questionario", typeof(string)));
|
||
ds.Tables["orizzonte"].Columns.Add(new DataColumn("Portafoglioattuale", typeof(string)));
|
||
ds.Tables["orizzonte"].Columns.Add(new DataColumn("AdegOT", typeof(decimal)));
|
||
ds.Tables["orizzonte"].Columns.Add(new DataColumn("AdegOTString", typeof(string)));
|
||
ds.Tables["orizzonte"].Columns.Add(new DataColumn("AllocOT", typeof(string)));
|
||
ds.Tables["orizzonte"].Columns.Add(new DataColumn("AllocOTDesc", typeof(string)));
|
||
ds.Tables["orizzonte"].Columns.Add(new DataColumn("Adeguatezza", typeof(string)));
|
||
|
||
if (adeguatezza.adeguatezzaTopBean.elencoOrizzontiTemporali != null)
|
||
{
|
||
if (visualizzaSchedaLiquidita)
|
||
{
|
||
foreach (var item in adeguatezza.adeguatezzaTopBean.elencoOrizzontiTemporali)
|
||
{
|
||
ds.Tables["orizzonte"].Rows.Add(
|
||
//Orizzonte
|
||
item.timeHorizon,
|
||
//Questionario
|
||
item.questionnaireMiFIDSpecified ? Convert.ToDecimal(item.questionnaireMiFID).ToString() : "n.a.",
|
||
//Portafoglioattuale
|
||
Convert.ToDecimal(item.currentPortfolio),
|
||
//Adeguatezza OT
|
||
!adeguatezza.adeguatezzaTopBean.caratteristicheCliente.profilo.Equals(0) ?
|
||
Convert.ToDecimal(item.adequacyForHorizon) :
|
||
0,
|
||
//Adeguatezza OT stringa
|
||
!adeguatezza.adeguatezzaTopBean.caratteristicheCliente.profilo.Equals(0) ?
|
||
Convert.ToDecimal(item.adequacyForHorizon).ToString() :
|
||
"n.a.",
|
||
//Allocazione OT
|
||
Convert.ToDecimal( item.locationToHorizon),
|
||
//Allocazione OT DESC
|
||
datiSeiUnico.FormatDecimal("{0}",item.locationToHorizon),
|
||
//Adeguatezza
|
||
!item.questionnaireMiFIDSpecified ? "n.a." : item.adequacy
|
||
);
|
||
}
|
||
//dtProfilo.Rows.Add("Oltre 10 anni", "10.82", "27.00","100.00","10.82", true);
|
||
//dtProfilo.Rows.Add("Tra 7 e 10 anni", "25.00", "25.00", "100.00","25.00", false);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
#endregion
|
||
|
||
return ds;
|
||
}
|
||
|
||
private void ElencoProdotti(DataTable dt, Consulenza.DataServices.fideuram.data.service.prodottiAdeguatezzaBean item, int ordinamento)
|
||
{
|
||
if (item.items == null) return;
|
||
var items = !item.name.Contains("Previdenza") ?
|
||
from o in item.items orderby o.currentEquivalent descending select o :
|
||
from o in item.items orderby o.name select o ;
|
||
|
||
foreach (var it in from o in item.items orderby o.currentEquivalent descending select o)
|
||
{
|
||
string progetto = it.name;
|
||
string codiceContratto = "";
|
||
string descrizione = "";
|
||
string imageSaving = "";
|
||
if (it.contractId != null)
|
||
{
|
||
progetto = "";
|
||
codiceContratto = it.contractId;
|
||
descrizione = it.name;
|
||
if (it.savingMap)
|
||
//if (descrizione.Substring(0, 2).ToString().ToUpper() == "FV")
|
||
imageSaving = "SavingMap.png";
|
||
}
|
||
if (it.currentEquivalent > 0)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
progetto,
|
||
codiceContratto,
|
||
descrizione,
|
||
imageSaving,
|
||
it.currentEquivalent,
|
||
it.marketRisk != null ? getFormat(it.marketRisk) : "-",
|
||
progetto.Equals("") && it.creditRisk != null ? getFormat(it.creditRisk) : "-",
|
||
progetto.Equals("") && it.complexity != null ? getFormat(it.complexity) : "-",
|
||
progetto.Equals("") && it.liquidity != null ? it.liquidity : "-",
|
||
ordinamento,
|
||
progetto.Equals("") ? false : true,
|
||
progetto.Equals("") ? false : true
|
||
);
|
||
}
|
||
|
||
ElencoProdotti(dt, it, item.ordinamento);
|
||
}
|
||
}
|
||
private void ElencoProdotti(DataTable dt, Consulenza.DataServices.fideuram.data.service.prodottoAdeguatezzaBean item, int ordinamento)
|
||
{
|
||
if (item.items == null) return;
|
||
foreach (var it in from o in item.items orderby o.currentEquivalent descending select o)
|
||
{
|
||
string progetto = it.name;
|
||
string codiceContratto = "";
|
||
string descrizione = "";
|
||
string imageSaving = "";
|
||
if (it.contractId != null)
|
||
{
|
||
progetto = "";
|
||
codiceContratto = it.contractId;
|
||
descrizione = it.name;
|
||
if (it.savingMap)
|
||
//if (descrizione.Substring(0, 2).ToString().ToUpper() == "FV")
|
||
imageSaving = "SavingMap.png";
|
||
}
|
||
|
||
dt.Rows.Add(
|
||
"",
|
||
progetto,
|
||
codiceContratto,
|
||
descrizione,
|
||
imageSaving,
|
||
it.currentEquivalent,
|
||
it.marketRisk != null ? getFormat(it.marketRisk) : "-",
|
||
progetto.Equals("") && it.creditRisk != null ? getFormat(it.creditRisk) : "-",
|
||
progetto.Equals("") && it.complexity != null ? getFormat(it.complexity) : "-",
|
||
progetto.Equals("") && it.liquidity != null ? it.liquidity : "-",
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
|
||
ElencoProdotti(dt, it, ordinamento);
|
||
}
|
||
}
|
||
|
||
// AC
|
||
private void TotaleRisorseAreaBisogno(DataTable dt, listaProdottiAdeguatezza lPro, int ordinamento)
|
||
{
|
||
prodottoAdeguatezzaBean other = lPro.other;
|
||
decimal CASA_OC = datiSeiUnico.CASA_OC;
|
||
decimal CASA_CCN = datiSeiUnico.CASA_CCN;
|
||
decimal CASA_GPELIGO = datiSeiUnico.CASA_GPELIGO;
|
||
decimal CASA_FOGLIO = datiSeiUnico.CASA_TUOFOGLIO;
|
||
|
||
if (CASA_OC != 0 || CASA_CCN != 0 || CASA_GPELIGO != 0 || CASA_FOGLIO!=0)
|
||
{
|
||
DataRow ro = dt.NewRow();
|
||
ro["Area"] = "Totale risorse finanziarie";//"Totale risorse allocate";
|
||
ro["Progetto"] = "";
|
||
ro["CodiceContratto"] = "";
|
||
ro["Descrizione"] = "";
|
||
ro["Controvalore"] = datiSeiUnico.CASA_SUBTOTALE;
|
||
ro["Rischiomercato"] = lPro.financialResources.marketRisk;
|
||
ro["Rischiocredito"] = lPro.financialResources.creditRisk.Equals("n.a.") ? lPro.financialResources.creditRisk : lPro.financialResources.creditRisk.Substring(0, 1).ToUpper() + lPro.financialResources.creditRisk.Substring(1, lPro.financialResources.creditRisk.Length - 2) + lPro.financialResources.creditRisk.Substring(lPro.financialResources.creditRisk.Length - 1).ToUpper();
|
||
ro["Complessita"] = lPro.financialResources.complexity.Substring(0, 1).ToUpper() + lPro.financialResources.complexity.Substring(1);
|
||
ro["Liquidita"] = "-";
|
||
ro["Ordinamento"] = ordinamento;
|
||
ro["FontBold"] = true;
|
||
ro["BackgroundGray"] = true;
|
||
|
||
dt.Rows.Add(ro);
|
||
|
||
if (CASA_OC != 0)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
"Operazioni in corso",
|
||
"",
|
||
"",
|
||
// SavingMap
|
||
"",
|
||
// Fine
|
||
CASA_OC,
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
}
|
||
|
||
foreach (var ccn in from o in other.items where o.area == "Cc" && o.currentEquivalent < 0 orderby o.currentEquivalent select o)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
ccn.name,
|
||
"",
|
||
"",
|
||
// SavingMap
|
||
"",
|
||
// Fine
|
||
ccn.currentEquivalent,
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",//ccn.complexity,
|
||
ccn.liquidity != null ? ccn.liquidity : "Entro 12 mesi",
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
}
|
||
foreach (var self in from o in other.items where o.area == "Self" && o.codiceSottoProdotto.Equals("L191") orderby o.currentEquivalent select o)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
self.name,
|
||
"",
|
||
"",
|
||
// SavingMap
|
||
"",
|
||
// Fine
|
||
self.currentEquivalent,
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",
|
||
self.liquidity,
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
}
|
||
foreach (var self in from o in other.items where o.area == "Self" && o.codiceSottoProdotto.Equals("L192") orderby o.currentEquivalent select o)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
self.name,
|
||
"",
|
||
"",
|
||
// SavingMap
|
||
"",
|
||
// Fine
|
||
self.currentEquivalent,
|
||
"n.c",
|
||
"n.c",
|
||
"n.c",
|
||
self.liquidity,
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
}
|
||
|
||
foreach (var self in from o in other.items where o.area == "Self" && o.codiceSottoProdotto.Equals("V301") orderby o.currentEquivalent select o)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
self.name,
|
||
"",
|
||
"",
|
||
// SavingMap
|
||
"",
|
||
// Fine
|
||
self.currentEquivalent,
|
||
"n.c",
|
||
"n.c",
|
||
"n.c",
|
||
self.liquidity,
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
}
|
||
|
||
}
|
||
}
|
||
//private void TotaleRisorseAreaBisogno(DataTable dt, listaProdottiAdeguatezza lPro, int ordinamento)
|
||
//{
|
||
// prodottoAdeguatezzaBean other = lPro.other;
|
||
// decimal CASA_OC = datiSeiUnico.CASA_OC;
|
||
// decimal CASA_CCN = datiSeiUnico.CASA_CCN;
|
||
// decimal CASA_GPELIGO = datiSeiUnico.CASA_GPELIGO;
|
||
|
||
// if (CASA_OC != 0 || CASA_CCN != 0 || CASA_GPELIGO != 0)
|
||
// {
|
||
// DataRow ro = dt.NewRow();
|
||
// ro["Area"] = "Totale risorse finanziarie";//"Totale risorse allocate";
|
||
// ro["Progetto"] = "";
|
||
// ro["CodiceContratto"] = "";
|
||
// ro["Descrizione"] = "";
|
||
// ro["Controvalore"] = datiSeiUnico.CASA_SUBTOTALE;
|
||
// ro["Rischiomercato"] = lPro.financialResources.marketRisk;
|
||
// ro["Rischiocredito"] = lPro.financialResources.creditRisk.Equals("n.a.")? lPro.financialResources.creditRisk : lPro.financialResources.creditRisk.Substring(0, 1).ToUpper() + lPro.financialResources.creditRisk.Substring(1, lPro.financialResources.creditRisk.Length - 2) + lPro.financialResources.creditRisk.Substring(lPro.financialResources.creditRisk.Length - 1).ToUpper();
|
||
// ro["Complessita"] = lPro.financialResources.complexity.Substring(0, 1).ToUpper() + lPro.financialResources.complexity.Substring(1);
|
||
// ro["Liquidita"] = "-";
|
||
// ro["Ordinamento"] = ordinamento;
|
||
// ro["FontBold"] = true;
|
||
// ro["BackgroundGray"] = true;
|
||
|
||
// dt.Rows.Add(ro);
|
||
|
||
// if (CASA_OC != 0)
|
||
// {
|
||
// dt.Rows.Add(
|
||
// "",
|
||
// "Operazioni in corso",
|
||
// "",
|
||
// "",
|
||
// CASA_OC,
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// ordinamento,
|
||
// false,
|
||
// false
|
||
// );
|
||
// }
|
||
|
||
// foreach (var ccn in from o in other.items where o.area == "Cc" && o.currentEquivalent < 0 orderby o.currentEquivalent select o)
|
||
// {
|
||
// dt.Rows.Add(
|
||
// "",
|
||
// ccn.name,
|
||
// "",
|
||
// "",
|
||
// ccn.currentEquivalent,
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",//ccn.complexity,
|
||
// ccn.liquidity != null ? ccn.liquidity : "Entro 12 mesi",
|
||
// ordinamento,
|
||
// false,
|
||
// false
|
||
// );
|
||
// }
|
||
// foreach (var self in from o in other.items where o.area == "Self" && o.codiceSottoProdotto.Equals("L191") orderby o.currentEquivalent select o)
|
||
// {
|
||
// dt.Rows.Add(
|
||
// "",
|
||
// self.name,
|
||
// "",
|
||
// "",
|
||
// self.currentEquivalent,
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// self.liquidity,
|
||
// ordinamento,
|
||
// false,
|
||
// false
|
||
// );
|
||
// }
|
||
// foreach (var self in from o in other.items where o.area == "Self" && o.codiceSottoProdotto.Equals("L192") orderby o.currentEquivalent select o)
|
||
// {
|
||
// dt.Rows.Add(
|
||
// "",
|
||
// self.name,
|
||
// "",
|
||
// "",
|
||
// self.currentEquivalent,
|
||
// "n.c",
|
||
// "n.c",
|
||
// "n.c",
|
||
// self.liquidity,
|
||
// ordinamento,
|
||
// false,
|
||
// false
|
||
// );
|
||
// }
|
||
|
||
// }
|
||
//}
|
||
|
||
// AC
|
||
private void TotaleRisorseContratto(DataTable dt, listaProdottiAdeguatezza lPro, int ordinamento)
|
||
{
|
||
prodottoAdeguatezzaBean other = lPro.other;
|
||
decimal CASA_OC = datiSeiUnico.CASA_OC;
|
||
decimal CASA_CCN = datiSeiUnico.CASA_CCN;
|
||
decimal CASA_GPELIGO = 0;
|
||
decimal CASA_FOGLIO = 0;
|
||
|
||
if (CASA_OC != 0 || CASA_CCN != 0 || CASA_GPELIGO != 0 || CASA_FOGLIO!=0)
|
||
{
|
||
DataRow ro = dt.NewRow();
|
||
ro["Area"] = "Totale risorse finanziarie";
|
||
ro["Progetto"] = "";
|
||
ro["CodiceContratto"] = "";
|
||
ro["Descrizione"] = "";
|
||
ro["Controvalore"] = datiSeiUnico.CASA_SUBTOTALE + datiSeiUnico.CASA_GPELIGO + datiSeiUnico.CASA_TUOFOGLIO;
|
||
ro["Rischiomercato"] = lPro.financialResources.marketRisk; ;
|
||
ro["Rischiocredito"] = lPro.financialResources.creditRisk.Equals("n.a.") ? lPro.financialResources.creditRisk : lPro.financialResources.creditRisk.Substring(0, 1).ToUpper() + lPro.financialResources.creditRisk.Substring(1, lPro.financialResources.creditRisk.Length - 2) + lPro.financialResources.creditRisk.Substring(lPro.financialResources.creditRisk.Length - 1).ToUpper();
|
||
|
||
ro["Complessita"] = lPro.financialResources.complexity.Substring(0, 1).ToUpper() + lPro.financialResources.complexity.Substring(1);
|
||
ro["Liquidita"] = "-";
|
||
ro["Ordinamento"] = ordinamento;
|
||
ro["FontBold"] = true;
|
||
ro["BackgroundGray"] = true;
|
||
dt.Rows.Add(ro);
|
||
|
||
if (CASA_OC != 0)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
"Operazioni in corso",
|
||
"",
|
||
"",
|
||
CASA_OC,
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
}
|
||
|
||
foreach (var ccn in from o in other.items where o.area == "Cc" && o.currentEquivalent < 0 orderby o.currentEquivalent select o)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
ccn.name,
|
||
"",
|
||
"",
|
||
ccn.currentEquivalent,
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",//ccn.complexity,
|
||
ccn.liquidity != null ? ccn.liquidity : "Entro 12 mesi",
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
}
|
||
|
||
|
||
}
|
||
}
|
||
|
||
//private void TotaleRisorseContratto(DataTable dt, listaProdottiAdeguatezza lPro, int ordinamento)
|
||
//{
|
||
// prodottoAdeguatezzaBean other = lPro.other;
|
||
// decimal CASA_OC = datiSeiUnico.CASA_OC;
|
||
// decimal CASA_CCN = datiSeiUnico.CASA_CCN;
|
||
// decimal CASA_GPELIGO = 0;
|
||
|
||
// if (CASA_OC != 0 || CASA_CCN != 0 || CASA_GPELIGO != 0)
|
||
// {
|
||
// DataRow ro = dt.NewRow();
|
||
// ro["Area"] = "Totale risorse finanziarie";
|
||
// ro["Progetto"] = "";
|
||
// ro["CodiceContratto"] = "";
|
||
// ro["Descrizione"] = "";
|
||
// ro["Controvalore"] = datiSeiUnico.CASA_SUBTOTALE + datiSeiUnico.CASA_GPELIGO;
|
||
// ro["Rischiomercato"] = lPro.financialResources.marketRisk; ;
|
||
// ro["Rischiocredito"] = lPro.financialResources.creditRisk.Equals("n.a.") ? lPro.financialResources.creditRisk : lPro.financialResources.creditRisk.Substring(0, 1).ToUpper() + lPro.financialResources.creditRisk.Substring(1, lPro.financialResources.creditRisk.Length - 2) + lPro.financialResources.creditRisk.Substring(lPro.financialResources.creditRisk.Length - 1).ToUpper();
|
||
|
||
// ro["Complessita"] = lPro.financialResources.complexity.Substring(0, 1).ToUpper() + lPro.financialResources.complexity.Substring(1);
|
||
// ro["Liquidita"] = "-";
|
||
// ro["Ordinamento"] = ordinamento;
|
||
// ro["FontBold"] = true;
|
||
// ro["BackgroundGray"] = true;
|
||
// dt.Rows.Add(ro);
|
||
|
||
// if (CASA_OC != 0)
|
||
// {
|
||
// dt.Rows.Add(
|
||
// "",
|
||
// "Operazioni in corso",
|
||
// "",
|
||
// "",
|
||
// CASA_OC,
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// ordinamento,
|
||
// false,
|
||
// false
|
||
// );
|
||
// }
|
||
|
||
// foreach (var ccn in from o in other.items where o.area == "Cc" && o.currentEquivalent < 0 orderby o.currentEquivalent select o)
|
||
// {
|
||
// dt.Rows.Add(
|
||
// "",
|
||
// ccn.name,
|
||
// "",
|
||
// "",
|
||
// ccn.currentEquivalent,
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",//ccn.complexity,
|
||
// ccn.liquidity != null ? ccn.liquidity : "Entro 12 mesi",
|
||
// ordinamento,
|
||
// false,
|
||
// false
|
||
// );
|
||
// }
|
||
|
||
|
||
// }
|
||
//}
|
||
|
||
|
||
//AC
|
||
private void TotaleRisorseCategoria(DataTable dt, listaProdottiAdeguatezza lPro, int ordinamento)
|
||
{
|
||
prodottoAdeguatezzaBean other = lPro.other;
|
||
decimal CASA_OC = datiSeiUnico.CASA_OC;
|
||
decimal CASA_CCN = datiSeiUnico.CASA_CCN;
|
||
decimal CASA_GPELIGO = 0;
|
||
decimal CASA_FOGLIO = 0;
|
||
|
||
if (CASA_OC != 0 || CASA_CCN != 0 || CASA_GPELIGO != 0|| CASA_FOGLIO!=0)
|
||
{
|
||
DataRow ro = dt.NewRow();
|
||
ro["Area"] = "Totale risorse finanziarie";
|
||
ro["Progetto"] = "";
|
||
ro["CodiceContratto"] = "";
|
||
ro["Descrizione"] = "";
|
||
ro["Controvalore"] = datiSeiUnico.CASA_SUBTOTALE + datiSeiUnico.CASA_GPELIGO +datiSeiUnico.CASA_TUOFOGLIO;
|
||
ro["Rischiomercato"] = lPro.financialResources.marketRisk; ;
|
||
ro["Rischiocredito"] = lPro.financialResources.creditRisk.Equals("n.a.") ? lPro.financialResources.creditRisk : lPro.financialResources.creditRisk.Substring(0, 1).ToUpper() + lPro.financialResources.creditRisk.Substring(1, lPro.financialResources.creditRisk.Length - 2) + lPro.financialResources.creditRisk.Substring(lPro.financialResources.creditRisk.Length - 1).ToUpper();
|
||
ro["Complessita"] = lPro.financialResources.complexity.Substring(0, 1).ToUpper() + lPro.financialResources.complexity.Substring(1);
|
||
ro["Liquidita"] = "-";
|
||
ro["Ordinamento"] = ordinamento;
|
||
ro["FontBold"] = true;
|
||
ro["BackgroundGray"] = true;
|
||
dt.Rows.Add(ro);
|
||
|
||
if (CASA_OC != 0)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
"Operazioni in corso",
|
||
"",
|
||
"",
|
||
CASA_OC,
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
}
|
||
|
||
foreach (var ccn in from o in other.items where o.area == "Cc" && o.currentEquivalent < 0 orderby o.currentEquivalent select o)
|
||
{
|
||
dt.Rows.Add(
|
||
"",
|
||
ccn.name,
|
||
"",
|
||
"",
|
||
ccn.currentEquivalent,
|
||
"n.c.",
|
||
"n.c.",
|
||
"n.c.",//ccn.complexity,
|
||
ccn.liquidity != null ? ccn.liquidity : "Entro 12 mesi",
|
||
ordinamento,
|
||
false,
|
||
false
|
||
);
|
||
}
|
||
|
||
|
||
}
|
||
}
|
||
|
||
// private void TotaleRisorseCategoria(DataTable dt, listaProdottiAdeguatezza lPro, int ordinamento)
|
||
//{
|
||
// prodottoAdeguatezzaBean other = lPro.other;
|
||
// decimal CASA_OC = datiSeiUnico.CASA_OC;
|
||
// decimal CASA_CCN = datiSeiUnico.CASA_CCN;
|
||
// decimal CASA_GPELIGO = 0;
|
||
|
||
// if (CASA_OC != 0 || CASA_CCN != 0 || CASA_GPELIGO != 0)
|
||
// {
|
||
// DataRow ro = dt.NewRow();
|
||
// ro["Area"] = "Totale risorse finanziarie";
|
||
// ro["Progetto"] = "";
|
||
// ro["CodiceContratto"] = "";
|
||
// ro["Descrizione"] = "";
|
||
// ro["Controvalore"] = datiSeiUnico.CASA_SUBTOTALE + datiSeiUnico.CASA_GPELIGO;
|
||
// ro["Rischiomercato"] = lPro.financialResources.marketRisk; ;
|
||
// ro["Rischiocredito"] = lPro.financialResources.creditRisk.Equals("n.a.") ? lPro.financialResources.creditRisk : lPro.financialResources.creditRisk.Substring(0, 1).ToUpper() + lPro.financialResources.creditRisk.Substring(1, lPro.financialResources.creditRisk.Length - 2) + lPro.financialResources.creditRisk.Substring(lPro.financialResources.creditRisk.Length - 1).ToUpper();
|
||
// ro["Complessita"] = lPro.financialResources.complexity.Substring(0, 1).ToUpper() + lPro.financialResources.complexity.Substring(1);
|
||
// ro["Liquidita"] = "-";
|
||
// ro["Ordinamento"] = ordinamento;
|
||
// ro["FontBold"] = true;
|
||
// ro["BackgroundGray"] = true;
|
||
// dt.Rows.Add(ro);
|
||
|
||
// if (CASA_OC != 0)
|
||
// {
|
||
// dt.Rows.Add(
|
||
// "",
|
||
// "Operazioni in corso",
|
||
// "",
|
||
// "",
|
||
// CASA_OC,
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// ordinamento,
|
||
// false,
|
||
// false
|
||
// );
|
||
// }
|
||
|
||
// foreach (var ccn in from o in other.items where o.area == "Cc" && o.currentEquivalent < 0 orderby o.currentEquivalent select o)
|
||
// {
|
||
// dt.Rows.Add(
|
||
// "",
|
||
// ccn.name,
|
||
// "",
|
||
// "",
|
||
// ccn.currentEquivalent,
|
||
// "n.c.",
|
||
// "n.c.",
|
||
// "n.c.",//ccn.complexity,
|
||
// ccn.liquidity != null ? ccn.liquidity : "Entro 12 mesi",
|
||
// ordinamento,
|
||
// false,
|
||
// false
|
||
// );
|
||
// }
|
||
|
||
|
||
// }
|
||
//}
|
||
|
||
private void ElencoConcentrazioneTitoli(DataTable dt, Consulenza.DataServices.fideuram.data.service.itemConcentrazioneBean[] items,int livello)
|
||
{
|
||
livello++;
|
||
if (dt.Columns.Count == 0) {
|
||
if (dt.TableName == "fondi")
|
||
{
|
||
dt.Columns.Add(new DataColumn("Livello", typeof(int)));
|
||
dt.Columns.Add(new DataColumn("Emittenti", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Controvaloreproposto", typeof(decimal)));
|
||
|
||
dt.Columns.Add(new DataColumn("Concentrazione", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Sogliaconcentrazione", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Adeguatezza", typeof(string)));
|
||
}
|
||
else
|
||
{
|
||
dt.Columns.Add(new DataColumn("Livello", typeof(int)));
|
||
dt.Columns.Add(new DataColumn("Emittenti", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Controvaloreproposto", typeof(decimal)));
|
||
dt.Columns.Add(new DataColumn("Franchigia", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Concentrazione", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Sogliaconcentrazione", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Adeguatezza", typeof(string)));
|
||
}
|
||
}
|
||
if (items != null)
|
||
{
|
||
foreach (var concentrazione in from e in items orderby e.currentEquivalent descending select e)
|
||
{
|
||
string fra = "";
|
||
string Threshold="";
|
||
if (concentrazione.franchise.ToString() != "n.a.")
|
||
{
|
||
fra = concentrazione.franchise.Contains(".") ? Helper.FormatCurrency(concentrazione.franchise.Replace(".", ",")) : Helper.FormatCurrency(concentrazione.franchise);
|
||
Threshold = concentrazione.concentrationThreshold.ToString();
|
||
}
|
||
else
|
||
{
|
||
fra = concentrazione.franchise.ToString();
|
||
Threshold = fra;
|
||
}
|
||
if (dt.TableName == "fondi")
|
||
{
|
||
dt.Rows.Add(
|
||
livello,
|
||
concentrazione.name,
|
||
concentrazione.currentEquivalent,
|
||
|
||
concentrazione.concentration,
|
||
Threshold,
|
||
!concentrazione.adequacySpecified ? "n.a." : concentrazione.adequacy ? "Adeguato" : "Non adeguato"
|
||
);
|
||
}
|
||
else
|
||
{
|
||
dt.Rows.Add(
|
||
livello,
|
||
concentrazione.name,
|
||
concentrazione.currentEquivalent,
|
||
|
||
fra,
|
||
concentrazione.concentration,
|
||
Threshold,
|
||
!concentrazione.adequacySpecified ? "n.a." : concentrazione.adequacy ? "Adeguato" : "Non adeguato"
|
||
);
|
||
}
|
||
ElencoConcentrazioneTitoli(dt, concentrazione.items, livello);
|
||
}
|
||
}
|
||
}
|
||
private void TotaleConcentrazioneTitoli(DataTable dt,string descrizione, decimal controvaloreTotale,decimal concentrazioneTotale)
|
||
{
|
||
if (dt.Columns.Count == 0)
|
||
{
|
||
if (descrizione.ToLower().Contains("fondi"))
|
||
{
|
||
dt.Columns.Add(new DataColumn("Emittenti", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Controvaloreproposto", typeof(decimal)));
|
||
|
||
|
||
dt.Columns.Add(new DataColumn("Concentrazione", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Sogliaconcentrazione", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Adeguatezza", typeof(string)));
|
||
}
|
||
else
|
||
{
|
||
dt.Columns.Add(new DataColumn("Emittenti", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Controvaloreproposto", typeof(decimal)));
|
||
|
||
dt.Columns.Add(new DataColumn("Franchigia", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Concentrazione", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Sogliaconcentrazione", typeof(string)));
|
||
dt.Columns.Add(new DataColumn("Adeguatezza", typeof(string)));
|
||
}
|
||
}
|
||
if (!descrizione.ToLower().Contains("fondi"))
|
||
dt.Rows.Add(descrizione, controvaloreTotale, "-", concentrazioneTotale, "-", "");
|
||
else{
|
||
if (controvaloreTotale != 0)
|
||
dt.Rows.Add(descrizione, controvaloreTotale, concentrazioneTotale, "20,00", datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean.elencoConcentrazioneTitoli.speculativi[0].adequacy ? "<font color='#00b046'>Adeguato</font>" : "<font color='#ff0000'>Non adeguato</font>");
|
||
else
|
||
dt.Rows.Add(descrizione, controvaloreTotale, concentrazioneTotale, "20,00", "");
|
||
}
|
||
|
||
}
|
||
|
||
private string getFormat(string _valore)
|
||
{
|
||
string valore = "";
|
||
try
|
||
{
|
||
if (_valore.ToLower().Contains("classe") || _valore.ToLower().Contains("alta") || _valore.ToLower().Contains("bassa") || _valore.ToLower().Contains("media") || _valore.ToLower().Contains("rischio") || _valore.ToLower().Contains("minima"))
|
||
valore = Helper.CapitalizeWords(_valore);
|
||
else if (_valore.ToLower().Contains("n.c.") || _valore.ToLower().Contains("n.a.") || _valore.ToLower().Contains("n.d."))
|
||
valore = _valore.ToLower();
|
||
else
|
||
{
|
||
valore = Helper.FormatDecimal(_valore, 2);
|
||
valore.Replace(".", ",");//le aree principali hanno punto, altri virgola
|
||
}
|
||
|
||
}
|
||
catch
|
||
{
|
||
valore = _valore;
|
||
}
|
||
return valore;
|
||
}
|
||
|
||
public virtual RaggruppaProdotti raggruppaProdotti()
|
||
{
|
||
return GetOption<Opzione6_2>().RaggruppaProdotti;
|
||
|
||
}
|
||
|
||
public virtual string getNota1() {
|
||
var flagFiduciariaPlurimandato = datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean.flagfiduciariaPluriMandato;
|
||
string nota = "";
|
||
|
||
if (!flagFiduciariaPlurimandato)
|
||
{
|
||
nota += "Complessità massima dei prodotti che lei attualmente detiene presso $/Banca/$.";
|
||
|
||
}
|
||
else
|
||
nota += "Complessità massima dei prodotti detenuti dai mandati fiduciari associati al medesimo fiduciante a cui appartiene il mandato " + datiSeiUnico.getClienteReport().codiceMandato + ".";
|
||
|
||
return datiSeiUnico.FormatBanca(nota);
|
||
}
|
||
|
||
|
||
public virtual string getTesto1() {
|
||
return datiSeiUnico.FormatBanca("Di seguito sono riportati i risultati della valutazione di adeguatezza del patrimonio che lei detiene presso $/Banca/$, in riferimento a tutti gli indicatori di rischio che $/Banca/$ utilizza per valutare l'adeguatezza degli investimenti. Per ogni indicatore, ove previsti, sono riportati il livello massimo associato al suo profilo finanziario e il valore relativo al patrimonio che lei detiene presso $/Banca/$, con indicazione del corrispondente grado di copertura.");
|
||
}
|
||
//public virtual bool getIndicatoricomplessita(string copertura)
|
||
//{
|
||
// var grado = copertura.Replace(".", ",");
|
||
// if (Convert.ToDouble(grado) != 100)
|
||
// {
|
||
// notaindicatoricomplessitafe = true;
|
||
// return true;
|
||
// }
|
||
// else
|
||
// return false;
|
||
//}
|
||
//public virtual string getNotaIndicatori()
|
||
//{
|
||
// string nota = "";
|
||
// if (notaindicatoricomplessitafe)
|
||
// nota = " Alcuni dei prodotti del patrimonio $/Banca/$ non sono coperti in termini di Complessità. In questa casistica, a prescindere dai singoli indicatori di rischio, il patrimonio Fideuram viene considerato sempre come «Non Adeguato».";
|
||
// return datiSeiUnico.FormatBanca(nota);
|
||
//}
|
||
//indicatore di sintesi
|
||
public virtual string getNoteTabellaIndicatori()
|
||
{
|
||
var adeguatezzaFlag = datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean;
|
||
var flagSoggettoAdeguatezzaMifid = adeguatezzaFlag.flagSoggettoAdeguatezzaMifid;
|
||
flagFiduciariaPlurimandato = adeguatezzaFlag.flagfiduciariaPluriMandato;
|
||
string codicemandato = datiSeiUnico.getClienteReport().codiceMandato;
|
||
var flagEccessivaAdeguatezza = adeguatezzaFlag.flagVarAdeguatoExcessively; //datiSeiUnico.rischioUnit().rischio.rischioMercatoCredito.eccessivamenteAdeguato;
|
||
|
||
var delegato = getDelegato();
|
||
string nota = "";
|
||
string token = "";
|
||
|
||
if (!flagFiduciariaPlurimandato)
|
||
{
|
||
nota += "Complessità massima dei prodotti che lei attualmente detiene presso $/Banca/$.";
|
||
if (delegato.codiceFiscale != null)
|
||
{
|
||
nota += "<br><br>La soglia massima relativa all’indicatore di Complessità fa riferimento al profilo di Esperienza e Conoscenza del Legale Rappresentante/Delegato $/CognomeDelegato/$ $/NomeDelegato/$.";
|
||
}
|
||
}
|
||
else
|
||
nota += "Complessità massima dei prodotti detenuti dai mandati fiduciari associati al medesimo fiduciante a cui appartiene il mandato " + codicemandato + ".";
|
||
token = " ";
|
||
//da fare quella sotto 40.2 e 40.9 per fiduciarie: mancano dati anche su fe
|
||
|
||
if (flagFiduciariaPlurimandato)
|
||
nota += token + "La valutazione di adeguatezza del patrimonio $/Banca/$ prende in considerazione il patrimonio detenuto presso $/Banca/$ da tutti i mandati fiduciari associati al medesimo fiduciante a cui appartiene il mandato <" + codicemandato + ">. Pertanto, gli indicatori di rischio presenti in questa scheda relativi al patrimonio Fideuram sono calcolati considerando tutti i prodotti detenuti dai mandati fiduciari associati al medesimo fiduciante a cui appartiene il mandato " + codicemandato + ".";
|
||
|
||
token = " ";
|
||
|
||
if (flagSoggettoAdeguatezzaMifid) //40.3
|
||
{
|
||
nota += token + "<br><br><br>La valutazione di adeguatezza del patrimonio che lei detiene presso $/Banca/$ non è necessaria in quanto tutti i prodotti da lei detenuti presso $/Banca/$ non sono soggetti alla valutazione di adeguatezza MiFID.";
|
||
token = " ";
|
||
}
|
||
if (flagEccessivaAdeguatezza)
|
||
{//40.4
|
||
nota += token + "<br><br><br>Il patrimonio che lei detiene presso $/Banca/$ risulta adeguato al suo profilo finanziario. Le segnaliamo, tuttavia, che il livello di Rischio Mercato (VaR) del patrimonio che lei detiene presso $/Banca/$ si posiziona su un valore sensibilmente inferiore rispetto alla soglia minima attribuita al suo profilo finanziario.";
|
||
token = " ";
|
||
}
|
||
token = " ";
|
||
|
||
if (delegato != null)
|
||
nota = datiSeiUnico.FormatDelegato(nota,delegato.nome,delegato.cognome);
|
||
return datiSeiUnico.FormatBanca(nota);
|
||
|
||
}
|
||
public virtual string getNota407() //40.7
|
||
{
|
||
|
||
|
||
var gradoCopertura =
|
||
(datiSeiUnico.rischioUnit().adeguatezza.listaProdottiArea.total.complexity.ToLower() == "alta" ||
|
||
datiSeiUnico.rischioUnit().adeguatezza.listaProdottiArea.total.complexity.ToLower() == "molto alta") &&
|
||
datiSeiUnico.rischioUnit().adeguatezza.listaProdottiArea.total.currentEquivalent < 100000m;
|
||
string nota = "";
|
||
|
||
//string rm = gradoCoperturaRM ? "Rischio Mercato (VaR)" : "";
|
||
//string rc = gradoCoperturaRM && gradoCoperturaRC ? " e di Rischio Credito" : !gradoCoperturaRM && gradoCoperturaRC ? " Rischio Credito" : "";
|
||
if (gradoCopertura)
|
||
{
|
||
nota += "Il patrimonio che lei detiene presso $/Banca/$ risulta non adeguato al suo profilo finanziario in quanto non è possibile detenere prodotti a complessità \"Alta\" o \"Molto Alta\" all'interno di un patrimonio inferiore a 100.000 Euro.";
|
||
|
||
|
||
}
|
||
return datiSeiUnico.FormatBanca(nota);
|
||
}
|
||
public virtual string getNota5RMRC() //40.5 copertura rischio mercato var e rischio credito
|
||
{
|
||
//gradoCoperturaRM =Convert.ToDecimal(datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o=>o.id=="RM").copertura) > 0 && Convert.ToDecimal(datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o=>o.id=="RM").copertura) < 90;
|
||
//gradoCoperturaRC = Convert.ToDecimal(datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o => o.id == "RC").copertura) > 0 && Convert.ToDecimal(datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean.listaAdeguatezza.AsEnumerable().FirstOrDefault(o => o.id == "RC").copertura) < 90;
|
||
|
||
string nota = "";
|
||
|
||
string rm =gradoCoperturaRM ? "Rischio Mercato (VaR)" : "";
|
||
string rc=gradoCoperturaRM && gradoCoperturaRC ? " e di Rischio Credito" : !gradoCoperturaRM && gradoCoperturaRC ? " Rischio Credito" : "";
|
||
if (gradoCoperturaRM || gradoCoperturaRC)
|
||
{
|
||
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 + ", 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 string getNota6(string copertura) //40.6 copertura complessità
|
||
{
|
||
var coperturagrado =copertura=="n.c." ? 0 : Convert.ToDouble(copertura.Replace(".",","));
|
||
string nota = "";
|
||
|
||
if (coperturagrado > 0 && coperturagrado < 100)
|
||
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 Complessità: in questo caso, a prescindere dai singoli indicatori di rischio, il patrimonio $/Banca/$ viene considerato sempre come non adeguato.";
|
||
return datiSeiUnico.FormatBanca(nota);
|
||
}
|
||
|
||
|
||
//prodotti
|
||
public virtual string getTesto3()
|
||
{
|
||
string nota = "Nella tabella sottostante sono riportati i prodotti che lei detiene presso $/Banca/$, con evidenza dei principali indicatori di rischio.";
|
||
string token = "";
|
||
switch (raggruppaProdotti())
|
||
{
|
||
case RaggruppaProdotti.AreaBisogno:
|
||
nota+= token +" I prodotti sono raggruppati per area di bisogno e, dove necessario, per progetto di investimento.";
|
||
token = " ";
|
||
break;
|
||
case RaggruppaProdotti.Categoria:
|
||
nota+= token + " I prodotti sono raggruppati secondo la categoria di appartenenza.";
|
||
token = " ";
|
||
break;
|
||
case RaggruppaProdotti.Contratto:
|
||
nota+= token + " I prodotti sono raggruppati secondo il contratto di appartenenza.";
|
||
token = " ";
|
||
break;
|
||
}
|
||
return datiSeiUnico.FormatBanca(nota);
|
||
}
|
||
|
||
|
||
//focus emittenti
|
||
public virtual string getCapitolo4() {
|
||
return datiSeiUnico.FormatBanca("Adeguatezza: focus su concentrazione emittenti");
|
||
}
|
||
//focus emittenti
|
||
public virtual string getTesto4() {
|
||
return datiSeiUnico.FormatBanca("In questa scheda sono riportati i risultati della valutazione di adeguatezza del patrimonio che lei detiene presso $/Banca/$, in riferimento all'indicatore di concentrazione. Per gli emittenti e i fondi speculativi del patrimonio che lei detiene presso $/Banca/$ sono riportati, ove previsti, il confronto tra il controvalore \"attuale\" e il controvalore sotto il quale non si applica il controllo di concentrazione (\"franchigia\"), e il confronto tra la concentrazione \"attuale\" e la soglia massima definita dal modello di adeguatezza.");
|
||
}
|
||
|
||
//Orizzonete Temporale Liquidità / Liquidabilità
|
||
public virtual string getCapitolo5()
|
||
{
|
||
return "Adeguatezza: focus su liquidità/liquidabilità";
|
||
}
|
||
//Orizzonete Temporale Liquidità / Liquidabilità
|
||
public virtual string getTesto6()
|
||
{
|
||
return datiSeiUnico.FormatBanca("In questa scheda sono riportati i risultati della valutazione di adeguatezza del patrimonio che lei detiene presso $/Banca/$, in riferimento all'indicatore di liquidità/liquidabilità. Nel grafico sono indicate l'area di adeguatezza e l'area di non adeguatezza: la prima individua le situazioni in cui le caratteristiche di durata e di liquidità dei prodotti che lei detiene presso $/Banca/$ sono coerenti con i suoi orizzonti temporali di investimento, derivanti dalle risposte che lei ha fornito alla domanda 9 del questionario di profilatura.");
|
||
}
|
||
public dettDelegatoBean getDelegato()
|
||
{
|
||
var listaDelegati = datiSeiUnico.rischioUnit().adeguatezza.adeguatezzaTopBean.delegati;
|
||
bool visualizzaDelegato = (String.IsNullOrEmpty(GetOption<Opzione5_3>().Valore)) ? false : true;
|
||
string cfDelegato = GetOption<Opzione5_3>().Valore;
|
||
|
||
dettDelegatoBean delegato = new dettDelegatoBean();
|
||
if ( listaDelegati != null)
|
||
delegato = (from o in listaDelegati where o.codiceFiscale == cfDelegato select o).LastOrDefault();
|
||
|
||
|
||
return delegato;
|
||
}
|
||
|
||
}
|
||
}
|
||
|