1056 lines
66 KiB
C#
1056 lines
66 KiB
C#
using System;
|
|
using Consulenza.ReportWriter.Business;
|
|
using Consulenza.ReportWriter.Business.OBJ_PDF;
|
|
using System.Data;
|
|
using Consulenza.ReportCommon;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using Consulenza.DataServices.fideuram.data.service;
|
|
using Consulenza.ReportWriter.Business.CUSTOM_PDF.ConsulenzaUnica;
|
|
|
|
|
|
namespace Consulenza.ReportWriter.Manager.Section.Unica
|
|
{
|
|
public class S54 : Entity.Section
|
|
{
|
|
/// <summary>
|
|
///S54.PropostaPiramideBisogni idSezione = 97
|
|
/// </summary>
|
|
|
|
|
|
|
|
public S54(EnvironmentFacade environmentFacade, int idSection)
|
|
: base(environmentFacade, idSection)
|
|
{
|
|
try
|
|
{
|
|
|
|
|
|
Draw();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SectionLogger.Write("S54", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment);
|
|
}
|
|
}
|
|
|
|
protected override sealed void Draw()
|
|
{
|
|
var dati = GetDataSet();
|
|
bool isAdeguata = datiSeiUnico.flagAdeguatezzaPro();
|
|
|
|
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
|
var intestazione = new SectionHeadingPDF(
|
|
(isAdeguata ? "Proposta" : "Operazioni richieste") + ": piramide dei bisogni",
|
|
|
|
EnvironmentFacade.RendererFacade.XLeftLimit,
|
|
EnvironmentFacade.RendererFacade.YUpperLimit,
|
|
EnvironmentFacade.ReportEnvironment.FontFamily);
|
|
|
|
AddElement(intestazione.ToElement());
|
|
#region Tabella delle Aree di Bisogno
|
|
if (dati.Tables["area"].Rows.Count > 0)
|
|
{
|
|
#region Testo Introduttivo
|
|
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(7));
|
|
}
|
|
#endregion
|
|
|
|
var tabellaAree = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["area"], dati.Tables["areafooter"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = false,
|
|
RowsPadding = 10,
|
|
HeaderHeight = 30,
|
|
HeaderMargin = 5F,
|
|
FooterYOffset = 5F
|
|
|
|
};
|
|
|
|
#region Definizione Colonne
|
|
string contro = ctvPianificato() ? "Controvalore<br>pianificato (€)" : "Controvalore<br>modello (€)";
|
|
tabellaAree.Columns.Add(new ColumnPDF("Area2", 170, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Objectpdf, "Area", "Area di bisogno") { HeaderFontSize = 7, FontSize = 7, DeltaYContent = 1, ScaleColumnTypeImage = 0.5F });
|
|
tabellaAree.Columns.Add(new ColumnPDF("VaR", 40, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Var", "VaR (%)") { HeaderFontSize = 7, FontSize = 7, DeltaYContent = 5, HeaderPaddingRight = 10, PaddingRight = 10 });
|
|
tabellaAree.Columns.Add(new ColumnPDF("ControvaloreAttuale", 85, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "ControvaloreAttuale", "Controvalore<BR>attuale (€)") { HeaderFontSize = 7, FontSize = 7, DeltaYContent = 5, HeaderPaddingRight = 10 });
|
|
|
|
tabellaAree.Columns.Add(new ColumnPDF("ControvalorePianificatoModello", 80, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "ControvalorePianificatoModello", contro) { HeaderFontSize = 7, FontSize = 7, HeaderPaddingRight = 7, DeltaYContent = 5 });
|
|
|
|
tabellaAree.Columns.Add(new ColumnPDF("OperazioniProposte", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "OperazioniProposte", "Operazioni<br>" + (isAdeguata ? "proposte (€)" : "richieste (€)")) { HeaderFontSize = 7, FontSize = 7, HeaderPaddingRight = 3, DeltaYContent = 5, PaddingRight = 4 });
|
|
tabellaAree.Columns.Add(new ColumnPDF("ControvaloreProposto", 75, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "ControvaloreProposto", "Controvalore<br>" + (isAdeguata ? "proposto (€)" : "prospettico (€)")) { HeaderFontSize = 7, FontSize = 7, HeaderPaddingRight = 3, DeltaYContent = 5, PaddingRight = 4 });
|
|
#endregion
|
|
|
|
#region Definizione Footer
|
|
tabellaAree.FooterColumns.Add(new ColumnPDF("Area", 170, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo) { FontSize = 7 });
|
|
tabellaAree.FooterColumns.Add(new ColumnPDF("VaR", 40, HorizontalAlignmentType.Destra, false, false, 7, ColumnType.Testo) { PaddingRight = 9, FontSize = 7 });
|
|
tabellaAree.FooterColumns.Add(new ColumnPDF("ControvaloreAttuale", 85, HorizontalAlignmentType.Destra, false, false, 7, ColumnType.Decimale) { FontSize = 7 });
|
|
|
|
tabellaAree.FooterColumns.Add(new ColumnPDF("ControvalorePianificatoModello", 80, HorizontalAlignmentType.Destra, false, false, 7, ColumnType.Decimale) { FontSize = 7 });
|
|
tabellaAree.FooterColumns.Add(new ColumnPDF("OperazioniProposte", 70, HorizontalAlignmentType.Destra, false, false, 7, ColumnType.Decimale) { PaddingRight = 3, FontSize = 7 });
|
|
tabellaAree.FooterColumns.Add(new ColumnPDF("ControvaloreProposto", 75, HorizontalAlignmentType.Destra, false, false, 7, ColumnType.Decimale) { FontSize = 7 });
|
|
#endregion
|
|
|
|
#region Formattazione Tabella Area
|
|
int i = 0;
|
|
foreach (DataRow r in dati.Tables["area"].Rows)
|
|
{
|
|
// Aggiunge i puntini per le Migliaia
|
|
tabellaAree.Cells[2, i].Value = Helper.FormatCurrency(r["ControvaloreAttuale"].ToString());
|
|
tabellaAree.Cells[3, i].Value = Helper.FormatCurrency(r["ControvalorePianificatoModello"].ToString());
|
|
tabellaAree.Cells[4, i].Value = Helper.FormatCurrency(r["OperazioniProposte"].ToString());
|
|
tabellaAree.Cells[5, i].Value = Helper.FormatCurrency(r["ControvaloreProposto"].ToString());
|
|
// Allinea i valori numerici a destra
|
|
tabellaAree.Cells[1, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaAree.Cells[2, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaAree.Cells[3, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaAree.Cells[4, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaAree.Cells[5, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
|
|
tabellaAree.Cells[0, i].ValueObjectList.Add(new ImagePDF(0, 1, dati.Tables["area"].Rows[i].ItemArray[0].ToString())
|
|
{
|
|
DeltaX = 3,
|
|
DeltaY = 0,
|
|
Scale = 0.66f,
|
|
Height = 27,
|
|
Width = 145
|
|
});
|
|
var textArea = new FormattedTextAreaPDF(dati.Tables["area"].Rows[i].ItemArray[1].ToString(), 0)
|
|
{
|
|
DeltaY = 8f,
|
|
FontSize = 8f
|
|
};
|
|
var labelSize = Helper.GetNumericStringWidth(textArea.Text);
|
|
float addition = 0;
|
|
switch (textArea.Text)
|
|
{
|
|
case "Investimento":
|
|
case "Previdenza":
|
|
addition = 3;
|
|
break;
|
|
case "Riserva":
|
|
addition = 2;
|
|
break;
|
|
case "Liquidità":
|
|
addition = 1;
|
|
break;
|
|
case "Extra Rendimento":
|
|
addition = 6;
|
|
break;
|
|
}
|
|
textArea.DeltaX = 76 + addition - labelSize;
|
|
textArea.Text = Helper.FirstCharToUpper(textArea.Text);
|
|
tabellaAree.Cells[0, i].ValueObjectList.Add(textArea);
|
|
|
|
i++;
|
|
}
|
|
int a = 0;
|
|
foreach (DataRow r in dati.Tables["areafooter"].Rows)
|
|
{
|
|
|
|
tabellaAree.FooterCells[0, a].FontBold =
|
|
tabellaAree.FooterCells[1, a].FontBold =
|
|
tabellaAree.FooterCells[2, a].FontBold =
|
|
tabellaAree.FooterCells[3, a].FontBold =
|
|
tabellaAree.FooterCells[4, a].FontBold =
|
|
tabellaAree.FooterCells[5, a].FontBold = Convert.ToBoolean(r["FontBold"]);
|
|
a++;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Nota Tabella Area
|
|
|
|
AddElement(tabellaAree);
|
|
//AddElement(new SpacePDF(2));
|
|
AddElement(new LinePDF(EnvironmentFacade.RendererFacade.XLeftLimit, EnvironmentFacade.RendererFacade.XLeftLimit + tabellaAree.Width, 1F, ColorPDF.Standard_Grigio_SfondoColonnaTabella));
|
|
//if (getNota1().Length > 0)
|
|
//{
|
|
// AddElement(new SpacePDF(5));
|
|
// AddElement(new FormattedTextAreaPDF(getNota1(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
//}
|
|
if (getNota1().Length > 0)
|
|
tabellaAree.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNota1(),
|
|
new[] { "VaR" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, DeltaY = 5 }
|
|
);
|
|
#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region Tabella dei Progetti di Investimento
|
|
|
|
if (dati.Tables["investimento"].Rows.Count > 0)
|
|
{
|
|
DataTable dt = dati.Tables["investimento"].AsEnumerable().OrderByDescending(o => o.Field<decimal>("ControvaloreAttuale")).CopyToDataTable();
|
|
#region Testo Introduttivo
|
|
if (getTesto2().Length > 0)
|
|
{
|
|
|
|
AddElement(new SpacePDF(getNota1().Length > 0 ? 25 : 20));
|
|
AddElement(new FormattedTextAreaPDF(getTesto2(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(7));
|
|
}
|
|
#endregion
|
|
|
|
var tabellaProgetti = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dt, dati.Tables["investimentofooter"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = false,
|
|
HeaderHeight = 30,
|
|
HeaderMargin = 5F,
|
|
FooterYOffset = 5F
|
|
};
|
|
|
|
#region Definizione Colonne
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("Progetto", 110, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Progetto", "Progetto di investimento") { HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("DurataResidua", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "DurataResidua", "Durata<br>residua") { PaddingRight = 3, HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 7, PaddingLeft = 7 });
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("VaR", 40, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Var", "VaR (%)") { PaddingRight = 10, HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("ControvaloreAttuale", 75, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "ControvaloreAttuale", "Controvalore<BR>attuale (€)") { PaddingRight = 4, FontSize = 7, HeaderFontSize = 7, HeaderPaddingLeft = 7 });
|
|
|
|
if (ctvPianificato())
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("ControvalorePianificatoModello", 80, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "ControvalorePianificatoModello", "Controvalore<BR>pianificato (€)") { PaddingRight = 4, HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 7 });
|
|
else
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("ControvaloreModello", 80, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "ControvaloreModello", "Controvalore<br>modello (€)") { PaddingRight = 4, HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 7 });
|
|
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("OperazioniProposte", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "OperazioniProposte", "Operazioni<BR>" + (isAdeguata ? "proposte (€)" : "richieste (€)")) { PaddingRight = 4, HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 7 });
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("ControvaloreProposto", 75, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "ControvaloreProposto", "Controvalore<BR>" + (isAdeguata ? "proposto (€)" : "prospettico (€)")) { PaddingRight = 5, FontSize = 7, HeaderFontSize = 7, HeaderPaddingLeft = 7 });
|
|
#endregion
|
|
|
|
#region Definizione Footer
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("Progetto", 110, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo) { PaddingRight = 3 });
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("DurataResidua", 60, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Testo) { PaddingRight = 3 });
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("VaR", 40, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Testo));
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("ControvaloreAttuale", 85, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 3 });
|
|
|
|
if (ctvPianificato())
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("ControvalorePianificatoModello", 80, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 3 });
|
|
else
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("ControvaloreModello", 80, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 3 });
|
|
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("OperazioniProposte", 70, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 3 });
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("ControvaloreProposto", 75, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 1 });
|
|
#endregion
|
|
|
|
#region Formattazione Tabella Area
|
|
int i = 0;
|
|
foreach (DataRow r in dt.Rows)
|
|
{
|
|
// Aggiunge i puntini per le Migliaia
|
|
tabellaProgetti.Cells[3, i].Value = Helper.FormatCurrency(r["ControvaloreAttuale"].ToString());
|
|
tabellaProgetti.Cells[4, i].Value = ctvPianificato() ? Helper.FormatCurrency(r["ControvalorePianificatoModello"].ToString()) : Helper.FormatCurrency(r["ControvaloreModello"].ToString());
|
|
tabellaProgetti.Cells[5, i].Value = Helper.FormatCurrency(r["OperazioniProposte"].ToString());
|
|
tabellaProgetti.Cells[6, i].Value = Helper.FormatCurrency(r["ControvaloreProposto"].ToString());
|
|
|
|
|
|
// Allinea i valori numerici a destra
|
|
tabellaProgetti.Cells[2, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaProgetti.Cells[3, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaProgetti.Cells[4, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaProgetti.Cells[5, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaProgetti.Cells[6, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
i++;
|
|
}
|
|
|
|
#region Nota Tabella Investimento
|
|
if (getNota2().Length > 0)
|
|
tabellaProgetti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNota2(),
|
|
new[] { "VaR" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, DeltaY = 5 }
|
|
);
|
|
|
|
AddElement(tabellaProgetti);
|
|
|
|
#endregion
|
|
|
|
|
|
#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region Tabella dei Progetti di previdenza
|
|
|
|
if (dati.Tables["previdenza"].Rows.Count > 0)
|
|
{
|
|
if (dati.Tables["investimento"].Rows.Count + // progetto rows
|
|
1 + // progetto headerv
|
|
1 + // progetto footer
|
|
(getNota1().Length > 0 ? 1 : 0) + // nota1
|
|
(getNota2().Length > 0 ? 1 : 0) + // nota2
|
|
(getNota3().Length > 0 ? 1 : 0) + // nota3
|
|
dati.Tables["areafooter"].Rows.Count // progetto footers
|
|
> 9
|
|
&& dati.Tables["previdenza"].Rows.Count > 0)
|
|
{
|
|
AddElement(new ImagePDF(435, 0.15F, "changepage.png") { AutoIncrementYWritable = false, Y = EnvironmentFacade.RendererFacade.YLowerLimit - 5 });
|
|
AddElement(new FormattedTextAreaPDF("continua alla pagina successiva", 450, 200) { FontSize = 6, AutoIncrementYWritable = false, Y = EnvironmentFacade.RendererFacade.YLowerLimit - 5, AbsolutePosition = true });
|
|
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
|
AddElement(new SpacePDF(2));
|
|
AddElement(new ImagePDF(EnvironmentFacade.RendererFacade.XLeftLimit, 0.15F, "changepage.png") { Y = EnvironmentFacade.RendererFacade.YUpperLimit + 2, AutoIncrementYWritable = false });
|
|
AddElement(new FormattedTextAreaPDF("continua dalla pagina precedente", EnvironmentFacade.RendererFacade.XLeftLimit + 15, 200) { Y = EnvironmentFacade.RendererFacade.YUpperLimit + 2, FontSize = 6, AutoIncrementYWritable = true, AbsolutePosition = true });
|
|
//AddElement(new SpacePDF(20));
|
|
}
|
|
else
|
|
{
|
|
//AddElement(new SpacePDF(15));
|
|
}
|
|
|
|
DataTable dtpre = dati.Tables["previdenza"].AsEnumerable().OrderBy(o => o.Field<string>("Progetto")).ThenByDescending(o => o.Field<decimal>("ControvaloreAttuale")).CopyToDataTable();
|
|
#region Testo Introduttivo
|
|
if (getTesto3().Length > 0)
|
|
{
|
|
AddElement(new SpacePDF(getNota2().Length > 0 ? 25 : 20));
|
|
AddElement(new FormattedTextAreaPDF(getTesto3(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(7));
|
|
}
|
|
#endregion
|
|
|
|
var tabellaProgetti = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dtpre, dati.Tables["previdenzafooter"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
AlternateRow = false,
|
|
ShowSeparationLines = false,
|
|
HeaderHeight = 30,
|
|
HeaderMargin = 5F,
|
|
FooterYOffset = 5F
|
|
};
|
|
|
|
#region Definizione Tabella Previdenza
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("Progetto", 170, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Progetto", "Previdenza") { HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("VaR", 40, HorizontalAlignmentType.Destra, false, false, 7, ColumnType.Testo, "Var", "VaR (%)") { PaddingRight = 10, HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("ControvaloreAttuale", 85, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "ControvaloreAttuale", "Controvalore<BR>attuale (€)") { PaddingRight = 5, HeaderPaddingLeft = 7, FontSize = 7, HeaderFontSize = 7 });
|
|
if (ctvPianificato())
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("ControvalorePianificatoModello", 80, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "ControvalorePianificatoModello", "Controvalore<BR>pianificato (€)") { PaddingRight = 5, FontSize = 7, HeaderPaddingLeft = 7, HeaderFontSize = 7 });
|
|
else
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("ControvaloreModello", 80, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "ControvaloreModello", "Controvalore<br>modello (€)") { PaddingRight = 5, FontSize = 7, HeaderFontSize = 7, HeaderPaddingLeft = 7 });
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("OperazioniProposte", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "OperazioniProposte", "Operazioni<BR>" + (isAdeguata ? "proposte (€)" : "richieste (€)")) { PaddingRight = 5, FontSize = 7, HeaderFontSize = 7, HeaderPaddingLeft = 7 });
|
|
tabellaProgetti.Columns.Add(new ColumnPDF("ControvaloreProposto", 75, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Decimale, "ControvaloreProposto", "Controvalore<BR>" + (isAdeguata ? "proposto (€)" : "prospettico (€)")) { PaddingRight = 5, FontSize = 7, HeaderFontSize = 7, HeaderPaddingLeft = 7 });
|
|
#endregion
|
|
|
|
#region Definizione Footer
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("Progetto", 170, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo));
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("VaR", 40, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Testo) { PaddingRight = 10 });
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("ControvaloreAttuale", 85, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 5 });
|
|
if (ctvPianificato())
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("ControvalorePianificatoModello", 80, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 5 });
|
|
else
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("ControvaloreModello", 80, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 5 });
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("OperazioniProposte", 70, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 5 });
|
|
tabellaProgetti.FooterColumns.Add(new ColumnPDF("ControvaloreProposto", 75, HorizontalAlignmentType.Destra, true, true, 7, ColumnType.Decimale) { PaddingRight = 1 });
|
|
#endregion
|
|
|
|
#region Formattazione Tabella Area
|
|
int i = 0;
|
|
foreach (DataRow r in dtpre.Rows)
|
|
{
|
|
//// Aggiunge i puntini per le Migliaia
|
|
|
|
tabellaProgetti.Cells[2, i].Value = Helper.FormatCurrency(r["ControvaloreAttuale"].ToString());
|
|
tabellaProgetti.Cells[3, i].Value = Helper.FormatCurrency(ctvPianificato() ? r["ControvalorePianificatoModello"].ToString() : r["ControvaloreModello"].ToString());
|
|
tabellaProgetti.Cells[4, i].Value = Helper.FormatCurrency(r["OperazioniProposte"].ToString());
|
|
tabellaProgetti.Cells[5, i].Value = Helper.FormatCurrency(r["ControvaloreProposto"].ToString());
|
|
|
|
// Allinea i valori numerici a destra
|
|
tabellaProgetti.Cells[1, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaProgetti.Cells[2, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaProgetti.Cells[3, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaProgetti.Cells[4, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabellaProgetti.Cells[5, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
i++;
|
|
}
|
|
#endregion
|
|
|
|
#region Nota Tabella Previdenza
|
|
if (getNota3().Length > 0)
|
|
tabellaProgetti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNota3(),
|
|
new[] { "VaR" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify, DeltaY = 5 }
|
|
);
|
|
|
|
AddElement(tabellaProgetti);
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
/// <summary>
|
|
/// Recupera i dati necessari alla Section restituendo un DataTable.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
protected sealed override DataTable GetDataTable()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
protected override DataSet GetDataSet()
|
|
{
|
|
#region Definizione Dataset
|
|
var ds = new DataSet();
|
|
ds.Tables.Add(new DataTable("area"));
|
|
ds.Tables.Add(new DataTable("areafooter"));
|
|
ds.Tables.Add(new DataTable("investimento"));
|
|
ds.Tables.Add(new DataTable("investimentofooter"));
|
|
ds.Tables.Add(new DataTable("previdenza"));
|
|
ds.Tables.Add(new DataTable("previdenzafooter"));
|
|
|
|
ds.Tables["area"].Columns.Add(new DataColumn("Area", typeof(string)));
|
|
ds.Tables["area"].Columns.Add(new DataColumn("Description", typeof(string)));
|
|
ds.Tables["area"].Columns.Add(new DataColumn("VaR", typeof(string)));
|
|
ds.Tables["area"].Columns.Add(new DataColumn("ControvaloreAttuale", typeof(decimal)));
|
|
ds.Tables["area"].Columns.Add(new DataColumn("ControvalorePianificatoModello", typeof(decimal)));
|
|
ds.Tables["area"].Columns.Add(new DataColumn("OperazioniProposte", typeof(decimal)));
|
|
ds.Tables["area"].Columns.Add(new DataColumn("ControvaloreProposto", typeof(decimal)));
|
|
|
|
ds.Tables["areafooter"].Columns.Add(new DataColumn("Area", typeof(string)));
|
|
ds.Tables["areafooter"].Columns.Add(new DataColumn("VaR", typeof(string)));
|
|
ds.Tables["areafooter"].Columns.Add(new DataColumn("ControvaloreAttuale", typeof(string)));
|
|
ds.Tables["areafooter"].Columns.Add(new DataColumn("ControvalorePianificatoModello", typeof(string)));
|
|
ds.Tables["areafooter"].Columns.Add(new DataColumn("OperazioniProposte", typeof(string)));
|
|
ds.Tables["areafooter"].Columns.Add(new DataColumn("ControvaloreProposto", typeof(string)));
|
|
ds.Tables["areafooter"].Columns.Add(new DataColumn("FontBold", typeof(bool)));
|
|
ds.Tables["areaFooter"].Columns.Add(new DataColumn("BackgroundGray", typeof(bool)));
|
|
|
|
|
|
ds.Tables["investimento"].Columns.Add(new DataColumn("Progetto", typeof(string)));
|
|
ds.Tables["investimento"].Columns.Add(new DataColumn("DurataResidua", typeof(string)));
|
|
ds.Tables["investimento"].Columns.Add(new DataColumn("VaR", typeof(string)));
|
|
ds.Tables["investimento"].Columns.Add(new DataColumn("ControvaloreAttuale", typeof(decimal)));
|
|
if (ctvPianificato())
|
|
ds.Tables["investimento"].Columns.Add(new DataColumn("ControvalorePianificatoModello", typeof(decimal)));
|
|
else
|
|
ds.Tables["investimento"].Columns.Add(new DataColumn("ControvaloreModello", typeof(decimal)));
|
|
ds.Tables["investimento"].Columns.Add(new DataColumn("OperazioniProposte", typeof(decimal)));
|
|
ds.Tables["investimento"].Columns.Add(new DataColumn("ControvaloreProposto", typeof(decimal)));
|
|
|
|
|
|
ds.Tables["investimentofooter"].Columns.Add(new DataColumn("Progetto", typeof(string)));
|
|
ds.Tables["investimentofooter"].Columns.Add(new DataColumn("DurataResidua", typeof(string)));
|
|
ds.Tables["investimentofooter"].Columns.Add(new DataColumn("VaR", typeof(string)));
|
|
ds.Tables["investimentofooter"].Columns.Add(new DataColumn("ControvaloreAttuale", typeof(string)));
|
|
if (ctvPianificato())
|
|
ds.Tables["investimentofooter"].Columns.Add(new DataColumn("ControvalorePianificatoModello", typeof(string)));
|
|
else
|
|
ds.Tables["investimentofooter"].Columns.Add(new DataColumn("ControvaloreModello", typeof(string)));
|
|
ds.Tables["investimentofooter"].Columns.Add(new DataColumn("OperazioniProposte", typeof(string)));
|
|
ds.Tables["investimentofooter"].Columns.Add(new DataColumn("ControvaloreProposto", typeof(string)));
|
|
ds.Tables["investimentofooter"].Columns.Add(new DataColumn("CanLastRow", typeof(bool)));
|
|
|
|
|
|
ds.Tables["previdenza"].Columns.Add(new DataColumn("Progetto", typeof(string)));
|
|
ds.Tables["previdenza"].Columns.Add(new DataColumn("VaR", typeof(string)));
|
|
ds.Tables["previdenza"].Columns.Add(new DataColumn("ControvaloreAttuale", typeof(decimal)));
|
|
if (ctvPianificato())
|
|
ds.Tables["previdenza"].Columns.Add(new DataColumn("ControvalorePianificatoModello", typeof(decimal)));
|
|
else
|
|
ds.Tables["previdenza"].Columns.Add(new DataColumn("ControvaloreModello", typeof(decimal)));
|
|
ds.Tables["previdenza"].Columns.Add(new DataColumn("OperazioniProposte", typeof(decimal)));
|
|
ds.Tables["previdenza"].Columns.Add(new DataColumn("ControvaloreProposto", typeof(decimal)));
|
|
|
|
|
|
ds.Tables["previdenzafooter"].Columns.Add(new DataColumn("Progetto", typeof(string)));
|
|
ds.Tables["previdenzafooter"].Columns.Add(new DataColumn("VaR", typeof(string)));
|
|
ds.Tables["previdenzafooter"].Columns.Add(new DataColumn("ControvaloreAttuale", typeof(string)));
|
|
if (ctvPianificato())
|
|
ds.Tables["previdenzafooter"].Columns.Add(new DataColumn("ControvalorePianificatoModello", typeof(string)));
|
|
else
|
|
ds.Tables["previdenzafooter"].Columns.Add(new DataColumn("ControvaloreModello", typeof(string)));
|
|
ds.Tables["previdenzafooter"].Columns.Add(new DataColumn("OperazioniProposte", typeof(string)));
|
|
ds.Tables["previdenzafooter"].Columns.Add(new DataColumn("ControvaloreProposto", typeof(string)));
|
|
ds.Tables["previdenzafooter"].Columns.Add(new DataColumn("CanLastRow", typeof(bool)));
|
|
#endregion
|
|
|
|
#region DatiSeiUnico
|
|
|
|
var piramideModello = datiSeiUnico.piramideModelloUnit().piramideModello.areaModello.Where(o => o.visible == true).OrderBy(o => o.ordinamento);
|
|
|
|
var pianificazioneVerticaleAttuale = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale;
|
|
var pianificazioneVerticalePianificato = datiSeiUnico.propostaUnit().stPianificazioneVerticale;
|
|
var stDettaglioProposta = datiSeiUnico.propostaUnit().stDettaglioProposta;
|
|
|
|
|
|
#endregion
|
|
|
|
#region OLD CODE Aree + Footer
|
|
//#region Aree + Footer
|
|
|
|
//foreach (var item in piramideModello)
|
|
//{
|
|
// var valori = pianificazioneVerticalePianificato.stAreePianificazione.FirstOrDefault(oo => oo.area.Equals(item.area));
|
|
// ds.Tables["area"].Rows.Add(
|
|
// string.Format("{0}.png", new AreaBisogno(item.area).NomePerImmagine),
|
|
// item.descrizioneArea,
|
|
// valori.coperturaAreaPro == 0 ? "n.c." : valori.varAreaPro.ToString(),
|
|
// valori.ctvArea,
|
|
// ctvPianificato() ? valori.ctvPianificato : (from o in piramideModello where o.area == item.area select o).LastOrDefault().percentualeArea / 100 * stDettaglioProposta.risorseFinanziarieBF,
|
|
// valori.ctvAreaPro - valori.ctvArea,
|
|
// valori.ctvAreaPro
|
|
|
|
// );
|
|
//}
|
|
|
|
|
|
//var PIANIFICATO_SUBTOTALE = ctvPianificato() ?
|
|
// pianificazioneVerticalePianificato.ctvPianificato
|
|
// - (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvPianificato).LastOrDefault()
|
|
// - (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvPianificato).LastOrDefault() :
|
|
// pianificazioneVerticaleAttuale.risorseFinanziarieBF;
|
|
|
|
//var PIANIFICATO_OC = ctvPianificato() ?
|
|
// pianificazioneVerticalePianificato.partiteViaggianti :
|
|
// pianificazioneVerticaleAttuale.partiteViaggianti;
|
|
|
|
//var PIANIFICATO_CCN = ctvPianificato() ?
|
|
// (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvPianificato).LastOrDefault() :
|
|
// pianificazioneVerticaleAttuale.contoCorrenteNegativo;
|
|
|
|
|
|
|
|
|
|
|
|
//// AC
|
|
|
|
////var a = pianificazioneVerticalePianificato.stAreePianificazione.Where(a => a.area == "Self" && a.progetti.FirstOrDefault().posizioniPortafoglio.FirstOrDefault().prodottoFinanziario.codInterno == "XY").LastOrDefault().ctvPianificato;
|
|
//decimal PIANIFICATO_GPELIGO;
|
|
//if (ctvPianificato())
|
|
//{
|
|
// var e = pianificazioneVerticalePianificato.stAreePianificazione.Where(a => a.area == "Self" && a.progetti.FirstOrDefault().posizioniPortafoglio.FirstOrDefault().prodottoFinanziario.codInterno == "XY").LastOrDefault();
|
|
// if (e != null)
|
|
// {
|
|
// PIANIFICATO_GPELIGO = e.ctvPianificato;
|
|
// }
|
|
// else
|
|
// PIANIFICATO_GPELIGO = 0;
|
|
//}
|
|
|
|
//else
|
|
// PIANIFICATO_GPELIGO = datiSeiUnico.ATTUTALE_GPELIGO;
|
|
|
|
|
|
|
|
//decimal PIANIFICATO_FOGLIO;
|
|
//if (ctvPianificato())
|
|
//{
|
|
// var e = pianificazioneVerticalePianificato.stAreePianificazione.Where(a => a.area == "Self" && a.progetti.FirstOrDefault().posizioniPortafoglio.FirstOrDefault().prodottoFinanziario.codInterno == "FO").LastOrDefault();
|
|
// if (e != null)
|
|
// {
|
|
// PIANIFICATO_FOGLIO = e.ctvPianificato;
|
|
// }
|
|
// else
|
|
// PIANIFICATO_FOGLIO = 0;
|
|
//}
|
|
|
|
//else
|
|
// PIANIFICATO_FOGLIO = datiSeiUnico.ATTUTALE_TUOFOGLIO;
|
|
|
|
////var PIANIFICATO_GPELIGO = ctvPianificato() ?
|
|
//// (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvPianificato).LastOrDefault() :
|
|
//// datiSeiUnico.ATTUTALE_GPELIGO;
|
|
|
|
//// var PIANIFICATO_FOGLIO = ctvPianificato() ?
|
|
//////(from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvPianificato).LastOrDefault()
|
|
|
|
////:
|
|
//// datiSeiUnico.ATTUTALE_TUOFOGLIO;
|
|
////--AC
|
|
|
|
//var PIANIFICATO_TOTALE = ctvPianificato() ?
|
|
// pianificazioneVerticalePianificato.ctvPianificato :
|
|
// pianificazioneVerticaleAttuale.patrimonioTotaleRFA;
|
|
|
|
//if ((datiSeiUnico.ATTUTALE_OC != 0 || PIANIFICATO_OC != 0 || datiSeiUnico.PROPOSTO_CCN != 0) ||
|
|
// (datiSeiUnico.ATTUTALE_CCN != 0 || PIANIFICATO_CCN != 0 || datiSeiUnico.PROPOSTO_CCN != 0) ||
|
|
// (datiSeiUnico.ATTUTALE_GPELIGO != 0 || PIANIFICATO_GPELIGO != 0 || datiSeiUnico.PROPOSTO_GPELIGO != 0) ||
|
|
// (datiSeiUnico.ATTUTALE_TUOFOGLIO != 0 || PIANIFICATO_FOGLIO != 0 || datiSeiUnico.PROPOSTO_TUOFOGLIO != 0)
|
|
// )
|
|
//{
|
|
// DataRow dr = ds.Tables["areafooter"].NewRow();
|
|
// dr["Area"] = string.Format("Totale risorse allocate");
|
|
// dr["VaR"] = stDettaglioProposta.rischioMercatoDec;
|
|
// dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_SUBTOTALE;
|
|
// dr["ControvalorePianificatoModello"] = PIANIFICATO_SUBTOTALE;
|
|
// dr["OperazioniProposte"] = datiSeiUnico.PROPOSTO_SUBTOTALE - datiSeiUnico.ATTUTALE_SUBTOTALE;
|
|
// dr["ControvaloreProposto"] = datiSeiUnico.PROPOSTO_SUBTOTALE;
|
|
// dr["FontBold"] = true;
|
|
// dr["BackgroundGray"] = true;
|
|
// ds.Tables["areafooter"].Rows.Add(dr);
|
|
|
|
// if (datiSeiUnico.ATTUTALE_OC != 0 || PIANIFICATO_OC != 0 || datiSeiUnico.PROPOSTO_OC != 0)
|
|
// {
|
|
// dr = ds.Tables["areafooter"].NewRow();
|
|
// dr["Area"] = string.Format("Operazioni in corso");
|
|
// dr["VaR"] = "-";
|
|
// dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_OC;
|
|
// dr["ControvalorePianificatoModello"] = "-";
|
|
// dr["OperazioniProposte"] = datiSeiUnico.PROPOSTO_OC - datiSeiUnico.ATTUTALE_OC;
|
|
// dr["ControvaloreProposto"] = datiSeiUnico.PROPOSTO_OC;
|
|
// dr["FontBold"] = false;
|
|
// dr["BackgroundGray"] = false;
|
|
// ds.Tables["areafooter"].Rows.Add(dr);
|
|
// }
|
|
|
|
// if (datiSeiUnico.ATTUTALE_CCN != 0 || PIANIFICATO_CCN != 0 || datiSeiUnico.PROPOSTO_CCN != 0)
|
|
// {
|
|
// dr = ds.Tables["areafooter"].NewRow();
|
|
// dr["Area"] = string.Format("Conto corrente");
|
|
// dr["VaR"] = "n.c.";
|
|
// dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_CCN;
|
|
// dr["ControvalorePianificatoModello"] = "-";
|
|
// dr["OperazioniProposte"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvAreaPro).LastOrDefault() != null ?
|
|
// (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvAreaPro).LastOrDefault() - datiSeiUnico.ATTUTALE_CCN : 0;//datiSeiUnico.PROPOSTO_CCN - datiSeiUnico.ATTUTALE_CCN;
|
|
// dr["ControvaloreProposto"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvAreaPro).LastOrDefault();//datiSeiUnico.PROPOSTO_CCN;
|
|
// dr["FontBold"] = false;
|
|
// dr["BackgroundGray"] = false;
|
|
// ds.Tables["areafooter"].Rows.Add(dr);
|
|
// }
|
|
|
|
// // AC
|
|
|
|
// if (datiSeiUnico.ATTUTALE_GPELIGO != 0 || PIANIFICATO_GPELIGO != 0 || datiSeiUnico.PROPOSTO_GPELIGO != 0)
|
|
// {
|
|
// dr = ds.Tables["areafooter"].NewRow();
|
|
// dr["Area"] = string.Format("Liquidità negativa GP Eligo");
|
|
// dr["VaR"] = "n.c.";
|
|
// dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_GPELIGO;
|
|
// dr["ControvalorePianificatoModello"] = "-";
|
|
// dr["OperazioniProposte"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault() != null ?
|
|
// (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault() - datiSeiUnico.ATTUTALE_CCN : 0;//datiSeiUnico.PROPOSTO_CCN - datiSeiUnico.ATTUTALE_CCN;
|
|
// dr["ControvaloreProposto"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault();//datiSeiUnico.PROPOSTO_GPELIGO;
|
|
// dr["FontBold"] = false;
|
|
// dr["BackgroundGray"] = false;
|
|
// ds.Tables["areafooter"].Rows.Add(dr);
|
|
// }
|
|
|
|
// if (datiSeiUnico.ATTUTALE_TUOFOGLIO != 0 || PIANIFICATO_FOGLIO != 0 || datiSeiUnico.PROPOSTO_TUOFOGLIO != 0)
|
|
// {
|
|
// dr = ds.Tables["areafooter"].NewRow();
|
|
// dr["Area"] = string.Format("Liquidità Il Mio Foglio");
|
|
// dr["VaR"] = "n.c.";
|
|
// dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_TUOFOGLIO;
|
|
// dr["ControvalorePianificatoModello"] = "-";
|
|
// dr["OperazioniProposte"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault() != null ?
|
|
// (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault() - datiSeiUnico.ATTUTALE_CCN : 0;//datiSeiUnico.PROPOSTO_CCN - datiSeiUnico.ATTUTALE_CCN;
|
|
// dr["ControvaloreProposto"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault();//datiSeiUnico.PROPOSTO_GPELIGO;
|
|
// dr["FontBold"] = false;
|
|
// dr["BackgroundGray"] = false;
|
|
// ds.Tables["areafooter"].Rows.Add(dr);
|
|
// }
|
|
|
|
// //--AC
|
|
|
|
|
|
//}
|
|
|
|
//DataRow drTot = ds.Tables["areafooter"].NewRow();
|
|
//drTot["Area"] = string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment));
|
|
//drTot["VaR"] = stDettaglioProposta.rischioMercatoDec + (getNota1().Length > 0 ? "*" : "");
|
|
//drTot["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_TOTALE;
|
|
//drTot["ControvalorePianificatoModello"] = PIANIFICATO_SUBTOTALE;
|
|
//drTot["OperazioniProposte"] = datiSeiUnico.PROPOSTO_TOTALE - datiSeiUnico.ATTUTALE_TOTALE;
|
|
//drTot["ControvaloreProposto"] = datiSeiUnico.PROPOSTO_TOTALE;
|
|
//drTot["FontBold"] = true;
|
|
//drTot["BackgroundGray"] = true;
|
|
//ds.Tables["areafooter"].Rows.Add(drTot);
|
|
|
|
//#endregion
|
|
#endregion
|
|
|
|
#region Aree + Footer
|
|
|
|
foreach (var item in piramideModello)
|
|
{
|
|
var valori = pianificazioneVerticalePianificato.stAreePianificazione.FirstOrDefault(oo => oo.area.Equals(item.area));
|
|
ds.Tables["area"].Rows.Add(
|
|
string.Format("{0}.png", new AreaBisogno(item.area).NomePerImmagine),
|
|
item.descrizioneArea,
|
|
valori.coperturaAreaPro == 0 ? "n.c." : valori.varAreaPro.ToString(),
|
|
valori.ctvArea,
|
|
ctvPianificato() ? valori.ctvPianificato : (from o in piramideModello where o.area == item.area select o).LastOrDefault().percentualeArea / 100 * stDettaglioProposta.risorseFinanziarieBF,
|
|
valori.ctvAreaPro - valori.ctvArea,
|
|
valori.ctvAreaPro
|
|
|
|
);
|
|
}
|
|
|
|
|
|
var PIANIFICATO_SUBTOTALE = ctvPianificato() ?
|
|
pianificazioneVerticalePianificato.ctvPianificato
|
|
- (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvPianificato).LastOrDefault()
|
|
- (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvPianificato).LastOrDefault() :
|
|
pianificazioneVerticaleAttuale.risorseFinanziarieBF;
|
|
|
|
var PIANIFICATO_OC = ctvPianificato() ?
|
|
pianificazioneVerticalePianificato.partiteViaggianti :
|
|
pianificazioneVerticaleAttuale.partiteViaggianti;
|
|
|
|
var PIANIFICATO_CCN = ctvPianificato() ?
|
|
(from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvPianificato).LastOrDefault() :
|
|
pianificazioneVerticaleAttuale.contoCorrenteNegativo;
|
|
|
|
// AC
|
|
|
|
//var a = pianificazioneVerticalePianificato.stAreePianificazione.Where(a => a.area == "Self" && a.progetti.FirstOrDefault().posizioniPortafoglio.FirstOrDefault().prodottoFinanziario.codInterno == "XY").LastOrDefault().ctvPianificato;
|
|
decimal PIANIFICATO_GPELIGO = 0;
|
|
decimal PIANIFICATO_FOGLIO = 0;
|
|
if (ctvPianificato())
|
|
{
|
|
//var e = pianificazioneVerticalePianificato.stAreePianificazione.Where(a => a.area == "Self" && a.progetti.FirstOrDefault().posizioniPortafoglio.FirstOrDefault().prodottoFinanziario.codInterno == "XY").LastOrDefault();
|
|
var eProgetti = pianificazioneVerticalePianificato.stAreePianificazione.Where(a => a.area == "Self");
|
|
if (eProgetti.ToList().FirstOrDefault().progetti.FirstOrDefault().posizioniPortafoglio == null)
|
|
{
|
|
PIANIFICATO_GPELIGO = 0;
|
|
PIANIFICATO_FOGLIO = 0;
|
|
}
|
|
else
|
|
{
|
|
var eGPELIGO = pianificazioneVerticalePianificato.stAreePianificazione.Where(a => a.progetti.FirstOrDefault().posizioniPortafoglio.FirstOrDefault().prodottoFinanziario.codInterno == "XY").LastOrDefault();
|
|
if (eGPELIGO != null)
|
|
PIANIFICATO_GPELIGO = eGPELIGO.ctvPianificato;
|
|
else
|
|
PIANIFICATO_GPELIGO = 0;
|
|
|
|
var eFOGLIO = pianificazioneVerticalePianificato.stAreePianificazione.Where(a => a.progetti.FirstOrDefault().posizioniPortafoglio.FirstOrDefault().prodottoFinanziario.codInterno == "FO").LastOrDefault();
|
|
if (eFOGLIO != null)
|
|
PIANIFICATO_FOGLIO = eFOGLIO.ctvPianificato;
|
|
else
|
|
PIANIFICATO_FOGLIO = 0;
|
|
}
|
|
}
|
|
|
|
else
|
|
{
|
|
PIANIFICATO_GPELIGO = datiSeiUnico.ATTUTALE_GPELIGO;
|
|
PIANIFICATO_FOGLIO = datiSeiUnico.ATTUTALE_TUOFOGLIO;
|
|
}
|
|
|
|
|
|
//if (ctvPianificato())
|
|
//{
|
|
// var e = pianificazioneVerticalePianificato.stAreePianificazione.Where(a => a.area == "Self" && a.progetti.FirstOrDefault().posizioniPortafoglio.FirstOrDefault().prodottoFinanziario.codInterno == "FO").LastOrDefault();
|
|
// if (e != null)
|
|
// {
|
|
// PIANIFICATO_FOGLIO = e.ctvPianificato;
|
|
// }
|
|
// else
|
|
// PIANIFICATO_FOGLIO = 0;
|
|
//}
|
|
|
|
//else
|
|
// PIANIFICATO_FOGLIO = datiSeiUnico.ATTUTALE_TUOFOGLIO;
|
|
|
|
//var PIANIFICATO_GPELIGO = ctvPianificato() ?
|
|
// (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvPianificato).LastOrDefault() :
|
|
// datiSeiUnico.ATTUTALE_GPELIGO;
|
|
|
|
// var PIANIFICATO_FOGLIO = ctvPianificato() ?
|
|
////(from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvPianificato).LastOrDefault()
|
|
|
|
//:
|
|
// datiSeiUnico.ATTUTALE_TUOFOGLIO;
|
|
//--AC
|
|
|
|
var PIANIFICATO_TOTALE = ctvPianificato() ?
|
|
pianificazioneVerticalePianificato.ctvPianificato :
|
|
pianificazioneVerticaleAttuale.patrimonioTotaleRFA;
|
|
|
|
if ((datiSeiUnico.ATTUTALE_OC != 0 || PIANIFICATO_OC != 0 || datiSeiUnico.PROPOSTO_CCN != 0) ||
|
|
(datiSeiUnico.ATTUTALE_CCN != 0 || PIANIFICATO_CCN != 0 || datiSeiUnico.PROPOSTO_CCN != 0) ||
|
|
(datiSeiUnico.ATTUTALE_GPELIGO != 0 || PIANIFICATO_GPELIGO != 0 || datiSeiUnico.PROPOSTO_GPELIGO != 0) ||
|
|
(datiSeiUnico.ATTUTALE_TUOFOGLIO != 0 || PIANIFICATO_FOGLIO != 0 || datiSeiUnico.PROPOSTO_TUOFOGLIO != 0)
|
|
)
|
|
{
|
|
DataRow dr = ds.Tables["areafooter"].NewRow();
|
|
dr["Area"] = string.Format("Totale risorse allocate");
|
|
dr["VaR"] = stDettaglioProposta.rischioMercatoDec;
|
|
dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_SUBTOTALE;
|
|
dr["ControvalorePianificatoModello"] = PIANIFICATO_SUBTOTALE;
|
|
dr["OperazioniProposte"] = datiSeiUnico.PROPOSTO_SUBTOTALE - datiSeiUnico.ATTUTALE_SUBTOTALE;
|
|
dr["ControvaloreProposto"] = datiSeiUnico.PROPOSTO_SUBTOTALE;
|
|
dr["FontBold"] = true;
|
|
dr["BackgroundGray"] = true;
|
|
ds.Tables["areafooter"].Rows.Add(dr);
|
|
|
|
if (datiSeiUnico.ATTUTALE_OC != 0 || PIANIFICATO_OC != 0 || datiSeiUnico.PROPOSTO_OC != 0)
|
|
{
|
|
dr = ds.Tables["areafooter"].NewRow();
|
|
dr["Area"] = string.Format("Operazioni in corso");
|
|
dr["VaR"] = "-";
|
|
dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_OC;
|
|
dr["ControvalorePianificatoModello"] = "-";
|
|
dr["OperazioniProposte"] = datiSeiUnico.PROPOSTO_OC - datiSeiUnico.ATTUTALE_OC;
|
|
dr["ControvaloreProposto"] = datiSeiUnico.PROPOSTO_OC;
|
|
dr["FontBold"] = false;
|
|
dr["BackgroundGray"] = false;
|
|
ds.Tables["areafooter"].Rows.Add(dr);
|
|
}
|
|
|
|
if (datiSeiUnico.ATTUTALE_CCN != 0 || PIANIFICATO_CCN != 0 || datiSeiUnico.PROPOSTO_CCN != 0)
|
|
{
|
|
dr = ds.Tables["areafooter"].NewRow();
|
|
dr["Area"] = string.Format("Conto corrente");
|
|
dr["VaR"] = "n.c.";
|
|
dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_CCN;
|
|
dr["ControvalorePianificatoModello"] = "-";
|
|
dr["OperazioniProposte"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvAreaPro).LastOrDefault() != null ?
|
|
(from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvAreaPro).LastOrDefault() - datiSeiUnico.ATTUTALE_CCN : 0;//datiSeiUnico.PROPOSTO_CCN - datiSeiUnico.ATTUTALE_CCN;
|
|
dr["ControvaloreProposto"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Cc" select o.ctvAreaPro).LastOrDefault();//datiSeiUnico.PROPOSTO_CCN;
|
|
dr["FontBold"] = false;
|
|
dr["BackgroundGray"] = false;
|
|
ds.Tables["areafooter"].Rows.Add(dr);
|
|
}
|
|
|
|
// AC
|
|
|
|
if (datiSeiUnico.ATTUTALE_GPELIGO != 0 || PIANIFICATO_GPELIGO != 0 || datiSeiUnico.PROPOSTO_GPELIGO != 0)
|
|
{
|
|
dr = ds.Tables["areafooter"].NewRow();
|
|
dr["Area"] = string.Format("Liquidità negativa GP Eligo");
|
|
dr["VaR"] = "n.c.";
|
|
dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_GPELIGO;
|
|
dr["ControvalorePianificatoModello"] = "-";
|
|
dr["OperazioniProposte"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault() != null ?
|
|
(from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault() - datiSeiUnico.ATTUTALE_CCN : 0;//datiSeiUnico.PROPOSTO_CCN - datiSeiUnico.ATTUTALE_CCN;
|
|
dr["ControvaloreProposto"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault();//datiSeiUnico.PROPOSTO_GPELIGO;
|
|
dr["FontBold"] = false;
|
|
dr["BackgroundGray"] = false;
|
|
ds.Tables["areafooter"].Rows.Add(dr);
|
|
}
|
|
|
|
if (datiSeiUnico.ATTUTALE_TUOFOGLIO != 0 || PIANIFICATO_FOGLIO != 0 || datiSeiUnico.PROPOSTO_TUOFOGLIO != 0)
|
|
{
|
|
dr = ds.Tables["areafooter"].NewRow();
|
|
dr["Area"] = string.Format("Liquidità Il Mio Foglio");
|
|
dr["VaR"] = "n.c.";
|
|
dr["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_TUOFOGLIO;
|
|
dr["ControvalorePianificatoModello"] = "-";
|
|
dr["OperazioniProposte"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault() != null ?
|
|
(from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault() - datiSeiUnico.ATTUTALE_CCN : 0;//datiSeiUnico.PROPOSTO_CCN - datiSeiUnico.ATTUTALE_CCN;
|
|
dr["ControvaloreProposto"] = (from o in pianificazioneVerticalePianificato.stAreePianificazione where o.area == "Self" select o.ctvAreaPro).LastOrDefault();//datiSeiUnico.PROPOSTO_GPELIGO;
|
|
dr["FontBold"] = false;
|
|
dr["BackgroundGray"] = false;
|
|
ds.Tables["areafooter"].Rows.Add(dr);
|
|
}
|
|
|
|
//--AC
|
|
|
|
|
|
}
|
|
|
|
DataRow drTot = ds.Tables["areafooter"].NewRow();
|
|
drTot["Area"] = string.Format("Patrimonio {0}", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment));
|
|
drTot["VaR"] = stDettaglioProposta.rischioMercatoDec + (getNota1().Length > 0 ? "*" : "");
|
|
drTot["ControvaloreAttuale"] = datiSeiUnico.ATTUTALE_TOTALE;
|
|
drTot["ControvalorePianificatoModello"] = PIANIFICATO_SUBTOTALE;
|
|
drTot["OperazioniProposte"] = datiSeiUnico.PROPOSTO_TOTALE - datiSeiUnico.ATTUTALE_TOTALE;
|
|
drTot["ControvaloreProposto"] = datiSeiUnico.PROPOSTO_TOTALE;
|
|
drTot["FontBold"] = true;
|
|
drTot["BackgroundGray"] = true;
|
|
ds.Tables["areafooter"].Rows.Add(drTot);
|
|
|
|
#endregion
|
|
|
|
#region Progetti Investimento
|
|
|
|
if (mostraInvestimento())
|
|
{
|
|
|
|
var areaInvProposta = (from v in pianificazioneVerticalePianificato.stAreePianificazione.ToList() where v.area == "Inv" select v).LastOrDefault();
|
|
var areaInvAttuale = (from v in pianificazioneVerticaleAttuale.aree.ToList() where v.area == "Inv" select v).LastOrDefault();
|
|
if (areaInvProposta.ctvAreaPro != 0 || areaInvAttuale.ctvArea != 0)
|
|
{
|
|
foreach (var item in from p in areaInvProposta.progetti join a in areaInvAttuale.progetti on p.chiaveProgetto equals a.chiaveProgetto select new { attuale = a, proposta = p })
|
|
{
|
|
// Non devo inserire Progetti se "controvalore attuale" o "controvalore modello"
|
|
// o "controvalore pianificato" o "controvalore proposto" = zero
|
|
if ((item.proposta.ctvProgetto + item.proposta.ctvPianificato + item.proposta.ctvProgettoPro +
|
|
(item.attuale.progettoModello.percentualeProgetto / 100) * pianificazioneVerticaleAttuale.risorseFinanziarieBF) != 0)
|
|
{
|
|
ds.Tables["investimento"].Rows.Add(
|
|
item.proposta.nomeProgetto,
|
|
item.attuale.durataResidua == null ? "-" : item.attuale.durataResidua.ToString(),
|
|
item.proposta.varProgettoProDec,
|
|
item.proposta.ctvProgetto,
|
|
ctvPianificato() ? item.proposta.ctvPianificato :
|
|
(item.attuale.progettoModello.percentualeProgetto / 100) * pianificazioneVerticaleAttuale.risorseFinanziarieBF,
|
|
item.proposta.ctvProgettoPro - item.proposta.ctvProgetto,
|
|
item.proposta.ctvProgettoPro
|
|
);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// tmp
|
|
//ds.Tables["investimento"].Rows.Add("test", "test", "test", 0m, 0m, 0m, 0m);
|
|
//ds.Tables["investimento"].Rows.Add("test", "test", "test", 0m, 0m, 0m, 0m);
|
|
//ds.Tables["investimento"].Rows.Add("test", "test", "test", 0m, 0m, 0m, 0m);
|
|
|
|
if (ds.Tables["investimento"].Rows.Count > 0)
|
|
{
|
|
ds.Tables["investimentofooter"].Rows.Add(
|
|
"Totale Investimento",
|
|
"",
|
|
areaInvProposta.varAreaPro,
|
|
Helper.FormatCurrency(areaInvAttuale.ctvArea.ToString()),
|
|
ctvPianificato() ? Helper.FormatCurrency(areaInvAttuale.ctvPianificatoArea.ToString()) :
|
|
Helper.FormatCurrency((areaInvAttuale.percArea / 100 * pianificazioneVerticaleAttuale.risorseFinanziarieBF).ToString()),
|
|
Helper.FormatCurrency((areaInvProposta.ctvAreaPro - areaInvAttuale.ctvArea).ToString()),
|
|
Helper.FormatCurrency(areaInvProposta.ctvAreaPro.ToString()),
|
|
false
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Progetti Previdenza
|
|
|
|
if (mostraPrevidenza())
|
|
{
|
|
|
|
var areaPreProposta = (from v in pianificazioneVerticalePianificato.stAreePianificazione.ToList() where v.area == "Pre" select v).FirstOrDefault();
|
|
var areaPreAttuale = (from v in pianificazioneVerticaleAttuale.aree.ToList() where v.area == "Pre" select v).FirstOrDefault();
|
|
|
|
if (areaPreProposta.ctvAreaPro != 0 || areaPreAttuale.ctvArea != 0)
|
|
{
|
|
foreach (var item in from p in areaPreProposta.progetti join a in areaPreAttuale.progetti on p.chiaveProgetto equals a.chiaveProgetto select new { attuale = a, proposta = p })
|
|
{
|
|
if ((item.proposta.ctvProgetto + item.proposta.ctvPianificato + item.proposta.ctvProgettoPro +
|
|
(item.attuale.progettoModello.percentualeProgetto / 100) * pianificazioneVerticaleAttuale.risorseFinanziarieBF) != 0)
|
|
{
|
|
ds.Tables["previdenza"].Rows.Add(
|
|
item.proposta.nomeProgetto,
|
|
item.proposta.varProgettoProDec,
|
|
item.proposta.ctvProgetto,
|
|
ctvPianificato() ? item.proposta.ctvPianificato :
|
|
(item.attuale.progettoModello.percentualeProgetto / 100) * pianificazioneVerticaleAttuale.risorseFinanziarieBF,
|
|
item.proposta.ctvProgettoPro - item.proposta.ctvProgetto,
|
|
item.proposta.ctvProgettoPro
|
|
);
|
|
}
|
|
}
|
|
|
|
if (ds.Tables["previdenza"].Rows.Count > 0)
|
|
{
|
|
ds.Tables["previdenzafooter"].Rows.Add(
|
|
"Totale Previdenza",
|
|
areaPreProposta.varAreaPro,
|
|
Helper.FormatCurrency(areaPreAttuale.ctvArea.ToString()),
|
|
ctvPianificato() ? Helper.FormatCurrency(areaPreAttuale.ctvPianificatoArea.ToString()) :
|
|
Helper.FormatCurrency((areaPreAttuale.percArea / 100 * pianificazioneVerticaleAttuale.risorseFinanziarieBF).ToString()),
|
|
Helper.FormatCurrency((areaPreProposta.ctvAreaPro - areaPreAttuale.ctvArea).ToString()),
|
|
Helper.FormatCurrency(areaPreProposta.ctvAreaPro.ToString()),
|
|
false
|
|
);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
return ds;
|
|
}
|
|
|
|
public virtual bool mostraInvestimento()
|
|
{
|
|
return GetOption<Opzione4_1>().Valore;
|
|
}
|
|
|
|
public virtual bool mostraPrevidenza()
|
|
{
|
|
return GetOption<Opzione4_2>().Valore;
|
|
}
|
|
|
|
public virtual bool ctvPianificato()
|
|
{
|
|
return GetOption<Opzione3>().Valore;
|
|
}
|
|
public virtual string getTesto1()
|
|
{
|
|
string nota = string.Empty;
|
|
bool Adeguata = datiSeiUnico.flagAdeguatezzaPro();
|
|
if (!Adeguata)
|
|
{
|
|
nota += "Nella tabella sottostante sono riportate, per ogni area di bisogno, l'allocazione corrente, pianificata e prospettica delle risorse finanziarie, che lei detiene presso $/Banca/$, destinate ai singoli progetti di investimento. Inoltre viene mostrato il controvalore delle operazioni da lei richieste al suo private banker.";
|
|
}
|
|
else if (ctvPianificato()) nota += "Nella tabella sottostante sono riportate, per ogni area di bisogno, l'allocazione corrente, pianificata e proposta delle risorse finanziarie che lei detiene presso $/Banca/$. Inoltre viene mostrato il controvalore delle operazioni proposte su ogni area di bisogno.";
|
|
else nota += "Nella tabella sottostante sono riportate, per ogni area di bisogno, l'allocazione corrente, ottimale e proposta delle risorse finanziarie che lei detiene presso $/Banca/$. Inoltre viene mostrato il controvalore delle operazioni proposte su ogni area di bisogno.";
|
|
return nota.Replace("$/Banca/$", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment));
|
|
}
|
|
public virtual string getNota1()
|
|
{
|
|
decimal gradoCopertura = datiSeiUnico.propostaUnit().stDettaglioProposta.copertura;
|
|
string nota = "";
|
|
if (gradoCopertura < 100 && Convert.ToDouble(gradoCopertura) != 0)
|
|
{
|
|
nota += "(*) Grado di copertura prodotti in termini di Rischio Mercato (VaR): {0}.";
|
|
}
|
|
return string.Format(nota, Helper.FormatDecimal(gradoCopertura.ToString(), 2));
|
|
}
|
|
public virtual string getTesto2()
|
|
{
|
|
bool _isControvalore = !GetOption<Opzione3>().Valore;
|
|
bool Adeguata = datiSeiUnico.flagAdeguatezzaPro();
|
|
string nota = "";
|
|
if (!Adeguata)
|
|
{
|
|
nota += "Nella tabella sottostante sono riportate l'allocazione corrente, pianificata e prospettica delle risorse finanziarie, che lei detiene presso $/Banca/$, destinate ai singoli progetti di investimento. Inoltre viene mostrato il controvalore delle operazioni da lei richieste al suo private banker.";
|
|
}
|
|
else if (ctvPianificato()) nota += "Nella tabella sottostante sono riportate l'allocazione corrente, pianificata e proposta delle risorse finanziarie, che lei detiene presso $/Banca/$, destinate ai singoli progetti di investimento. Inoltre viene mostrato il controvalore delle operazioni proposte su ogni progetto di investimento.";
|
|
else nota += "Nella tabella sottostante sono riportate l'allocazione corrente, ottimale e proposta delle risorse finanziarie, che lei detiene presso $/Banca/$, destinate ai singoli progetti di investimento. Inoltre viene mostrato il controvalore delle operazioni proposte su ogni progetto di investimento.";
|
|
return datiSeiUnico.FormatBanca(nota);// nota.Replace("$/Banca/$", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment));
|
|
}
|
|
public virtual string getNota2()
|
|
{
|
|
decimal gradoCopertura = datiSeiUnico.propostaUnit().stPianificazioneVerticale.stAreePianificazione.Where(o => o.area == "Inv").FirstOrDefault().coperturaAreaPro;
|
|
string nota = "";
|
|
if (gradoCopertura < 100 && Convert.ToDouble(gradoCopertura) != 0)
|
|
nota += "Grado di copertura prodotti in termini di Rischio Mercato (VaR): {0}.";
|
|
return string.Format(nota, Helper.FormatDecimal(gradoCopertura.ToString(), 2));
|
|
}
|
|
public virtual string getTesto3()
|
|
{
|
|
// bool _isControvalore = !GetOption<Opzione3>().Valore;
|
|
string nota = "";
|
|
bool Adeguata = datiSeiUnico.flagAdeguatezzaPro();
|
|
if (!Adeguata)
|
|
{
|
|
nota += "Nella tabella sottostante sono riportate l'allocazione corrente, pianificata e prospettica delle risorse finanziarie, che lei detiene presso $/Banca/$, destinate alle aree \"Previdenza Essenziale\" e \"Previdenza Secondaria\". Inoltre viene mostrato il controvalore delle operazioni da lei richieste al suo private banker.";
|
|
}
|
|
else if (ctvPianificato()) nota += "Nella tabella sottostante sono riportate l'allocazione corrente, pianificata e proposta delle risorse finanziarie, che lei detiene presso $/Banca/$, destinate alle aree \"Previdenza Essenziale\" e \"Previdenza Secondaria\". Inoltre viene mostrato il controvalore delle operazioni proposte su ognuna delle due aree.";
|
|
else nota += "Nella tabella sottostante sono riportate l'allocazione corrente, ottimale e proposta delle risorse finanziarie, che lei detiene presso $/Banca/$, destinate alle aree \"Previdenza Essenziale\" e \"Previdenza Secondaria\". Inoltre viene mostrato il controvalore delle operazioni proposte su ognuna delle due aree.";
|
|
return nota.Replace("$/Banca/$", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment));
|
|
}
|
|
public virtual string getNota3()
|
|
{
|
|
decimal gradoCopertura = datiSeiUnico.propostaUnit().stPianificazioneVerticale.stAreePianificazione.Where(o => o.area == "Pre").FirstOrDefault().coperturaAreaPro;
|
|
string nota = "";
|
|
if (gradoCopertura < 100 && Convert.ToDouble(gradoCopertura) != 0)
|
|
{
|
|
nota += "Grado di copertura prodotti in termini di Rischio Mercato (VaR): {0}.";
|
|
}
|
|
return string.Format(nota, Helper.FormatDecimal(gradoCopertura.ToString(), 2));
|
|
}
|
|
}
|
|
}
|