1016 lines
51 KiB
C#
1016 lines
51 KiB
C#
using ceTe.DynamicPDF;
|
|
using Consulenza.ReportCommon;
|
|
using Consulenza.ReportWriter.Business;
|
|
using Consulenza.ReportWriter.Business.CHART_PDF;
|
|
using Consulenza.ReportWriter.Business.Entity;
|
|
using Consulenza.ReportWriter.Business.OBJ_PDF;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
|
|
namespace Consulenza.ReportWriter.Manager.Section.Unica
|
|
{
|
|
/// <summary>
|
|
/// Scheda 2. Sintesi Cliente. IdSezione 45
|
|
/// </summary>
|
|
public class S2 : Entity.Section
|
|
{
|
|
public S2(EnvironmentFacade environmentFacade, int idSection)
|
|
: base(environmentFacade, idSection)
|
|
{
|
|
try
|
|
{
|
|
Draw();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SectionLogger.Write("S2", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment);
|
|
}
|
|
}
|
|
|
|
//protected override sealed void Draw()
|
|
//{
|
|
// var dati = GetDataSet();
|
|
|
|
// AddElement(new SpacePDF(15));
|
|
|
|
// #region Testo introduttivo grafico
|
|
// AddElement(new FormattedTextAreaPDF(getTesto1(), EnvironmentFacade.RendererFacade.XLeftLimit) {FontSize=7, TextHorizontalAlign = TextAlign.Justify });
|
|
// #endregion
|
|
|
|
// AddElement(new SpacePDF(15));
|
|
|
|
// #region Tabella info del cliente
|
|
// var tabellaInfoCliente = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["cliente"])
|
|
// {
|
|
// Style = Style.ConsulenzaUnica,
|
|
// Header = false,
|
|
// Footer = false,
|
|
// AlternateRow = false,
|
|
// RowHeight = 25,
|
|
// WidthSeparationLines = 0
|
|
// };
|
|
// tabellaInfoCliente.Columns.Add(new ColumnPDF("descrizione", 150, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo, "descrizione", string.Empty) {HeaderFontSize=7, FontSize=7});
|
|
// tabellaInfoCliente.Columns.Add(new ColumnPDF("valore", 370, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "valore", string.Empty) { HeaderFontSize = 7, PaddingLeft = 5, FontSize = 7 });
|
|
|
|
// AddElement(tabellaInfoCliente);
|
|
|
|
// #endregion
|
|
|
|
// AddElement(new SpacePDF(15));
|
|
|
|
// #region Tabella rischio
|
|
// var tabellaRischio = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["rischio"])
|
|
// {
|
|
// Style = Style.ConsulenzaUnica,
|
|
// Footer = false,
|
|
// AlternateRow = false,
|
|
// ShowBorderLastLine = true,
|
|
// ShowBorderHeader = true,
|
|
// WidthSeparationLines = 0,
|
|
// YOffset = 10,
|
|
// RowHeight = 25
|
|
// };
|
|
|
|
// tabellaRischio.Columns.Add(new ColumnPDF("Rischio", 173, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo, "Rischio", string.Empty) { HeaderFontSize = 7, FontSize = 7, HeaderBackgroundColor = ColorPDF.Bianco});
|
|
// tabellaRischio.Columns.Add(new ColumnPDF("ProfiloFinanziario", 172, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "ProfiloFinanziario", "Limite massimo profilo finanziario") { HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 7});
|
|
// string colonna = "Patrimonio $/Banca/$".Replace("$/Banca/$", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment)).Replace("SIM", "");
|
|
// tabellaRischio.Columns.Add(new ColumnPDF("PatrimonioCasa", 173, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "PatrimonioCasa", colonna) { HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 7});
|
|
|
|
// int i = 0;
|
|
// foreach (DataRow ro in dati.Tables["rischio"].Rows)
|
|
// {
|
|
// tabellaRischio.Cells[1, i].HorizontalAlignment =
|
|
// tabellaRischio.Cells[2, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
|
|
// i++;
|
|
// }
|
|
|
|
|
|
// AddElement(tabellaRischio);
|
|
|
|
// #endregion
|
|
|
|
|
|
|
|
// if (dati.Tables["elencoPatrimonio"].Rows.Count > 0)
|
|
// {
|
|
|
|
// AddElement(new SpacePDF(15));
|
|
|
|
// #region Testo introduttivo grafico
|
|
// AddElement(new FormattedTextAreaPDF(getTesto2(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7 });
|
|
// #endregion
|
|
|
|
// AddElement(new SpacePDF(15));
|
|
|
|
// #region Tabella patrimonio complessivo
|
|
// var tabellaPatrimonio = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["patrimonio"])
|
|
// {
|
|
// Style = Style.ConsulenzaUnica,
|
|
// Header = false,
|
|
// Footer = false,
|
|
// AlternateRow = false,
|
|
// ShowBorderLastLine = false,
|
|
// RowHeight = 25
|
|
// };
|
|
// tabellaPatrimonio.Columns.Add(new ColumnPDF("descrizione", 150, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo, "descrizione", string.Empty) { FontSize = 7});
|
|
// tabellaPatrimonio.Columns.Add(new ColumnPDF("valore", 370, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "valore", string.Empty) { FontSize = 7, PaddingLeft = 5 });
|
|
|
|
// AddElement(tabellaPatrimonio);
|
|
|
|
// #endregion
|
|
|
|
// AddElement(new SpacePDF(15));
|
|
|
|
// #region Grafico a barre
|
|
// int c=0;
|
|
|
|
// bool FirstTwoRowsSumLinked=true;
|
|
|
|
// foreach (DataRow item in dati.Tables["elencoPatrimonio"].Rows)
|
|
// {
|
|
// if (c < 2)
|
|
// {
|
|
// if (Convert.ToDouble(item.ItemArray[4].ToString()) == 0)
|
|
// {
|
|
// FirstTwoRowsSumLinked = false;
|
|
// break;
|
|
// }
|
|
// }
|
|
// c++;
|
|
// }
|
|
|
|
// if (dati.Tables["elencoPatrimonio"].Rows.Count > 0)
|
|
// {
|
|
// var graficoBarre = new StackedPDF(EnvironmentFacade.RendererFacade.XLeftLimit + 100, 1F)
|
|
// {
|
|
// HeightSingleBar = 40,
|
|
// Width = 400,
|
|
// MinorGridAxisY = true,
|
|
// ShowLineAxisX = true,
|
|
// ShowLineAxisY = true,
|
|
// LabelFormatAxisY = FormatType.Decimale2,
|
|
// DinamicFloatXEtichettaLateraleBarra = true,
|
|
// FirstTwoRowsSumLinked = FirstTwoRowsSumLinked,
|
|
// RemoveWhiteSpaceBetweenChartAndAxisX = true,
|
|
// MarginAxisY = 0,
|
|
// MarginAxisYFromTop = 0
|
|
// };
|
|
|
|
// var serieCollezione = new List<Serie> { new Serie { Name = "Patrimoni", Border = true} };
|
|
|
|
// var dtGraficoBarre = dati.Tables["elencoPatrimonio"];
|
|
// foreach (DataRow item in dtGraficoBarre.Rows)
|
|
// {
|
|
// serieCollezione[0].Points.Add(new Point
|
|
// {
|
|
// Color = new ColorPDF(Convert.ToInt32(item["Red"]), Convert.ToInt32(item["Green"]), Convert.ToInt32(item["Blue"])),
|
|
// Value = Convert.ToDouble(item["Controvalore"]),
|
|
|
|
// ShowLabelAxisY = true,
|
|
|
|
// LabelAxisY = Helper.FormatCurrency(item["Controvalore"].ToString()),
|
|
// FontSizeLabelAxisY = 7,
|
|
// FontBoldLabelAxisY = false,
|
|
// //FontColorLabelAxisY = ColorPDF.Grigio_TitoloPiccoloImmobiliare
|
|
|
|
// ShowLabelAxisX = true,
|
|
// LabelAxisX = string.Format("{0}<BR/><i>({1})<i>", item["Patrimonio"].ToString(), Helper.FormatPercentage(Convert.ToDecimal(item["Percentuale"]), 2)),
|
|
// FontSizeLabelAxisX = 7,
|
|
// //FontColorLabelAxisX = ColorPDF.Grigio_TitoloPiccoloImmobiliare,
|
|
// });
|
|
// }
|
|
|
|
// graficoBarre.SeriesCollection = serieCollezione;
|
|
|
|
// AddElement(graficoBarre);
|
|
// }
|
|
// #endregion
|
|
|
|
// #region Nota del PatrimonioCasa
|
|
|
|
|
|
// if (GetNote1().Length > 0)
|
|
// {
|
|
// AddElement(new SpacePDF(30));
|
|
// AddElement(new FormattedTextAreaPDF(GetNote1(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6 });
|
|
// }
|
|
// #endregion
|
|
// }
|
|
//}
|
|
|
|
|
|
protected override sealed void Draw()
|
|
{
|
|
var dati = GetDataSet();
|
|
|
|
AddElement(new SpacePDF(15));
|
|
|
|
#region Testo introduttivo grafico
|
|
AddElement(new FormattedTextAreaPDF(getTesto1(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = TextAlign.Justify });
|
|
#endregion
|
|
|
|
AddElement(new SpacePDF(15));
|
|
|
|
#region Tabella info del cliente
|
|
var tabellaInfoCliente = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["cliente"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
Header = false,
|
|
Footer = false,
|
|
AlternateRow = false,
|
|
RowHeight = 25,
|
|
WidthSeparationLines = 0
|
|
};
|
|
tabellaInfoCliente.Columns.Add(new ColumnPDF("descrizione", 150, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo, "descrizione", string.Empty) { HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaInfoCliente.Columns.Add(new ColumnPDF("valore", 370, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "valore", string.Empty) { HeaderFontSize = 7, PaddingLeft = 5, FontSize = 7 });
|
|
|
|
AddElement(tabellaInfoCliente);
|
|
if (dati.Tables.Contains("dtClienteDueColonne"))
|
|
{
|
|
var tabellaCliente = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["dtClienteDueColonne"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
Header = false,
|
|
Footer = false,
|
|
AlternateRow = false,
|
|
RowHeight = 25,
|
|
WidthSeparationLines = 0
|
|
};
|
|
tabellaCliente.Columns.Add(new ColumnPDF("controvalore", 150, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo, "controvalore", string.Empty) { HeaderFontSize = 7, FontSize = 7 });
|
|
tabellaCliente.Columns.Add(new ColumnPDF("valore", 110, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "valore", string.Empty) { HeaderFontSize = 7, PaddingLeft = 5, FontSize = 7 });
|
|
tabellaCliente.Columns.Add(new ColumnPDF("descrizione", 150, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo, "descrizione", string.Empty) { HeaderFontSize = 7, PaddingLeft = 5, FontSize = 7 });
|
|
tabellaCliente.Columns.Add(new ColumnPDF("val", 110, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "val", string.Empty) { HeaderFontSize = 7, PaddingLeft = 5, FontSize = 7 });
|
|
|
|
tabellaCliente.Cells[2, 1].BackgroundColor = dati.Tables["dtClienteDueColonne"].Rows[1]["descrizione"].ToString() == "" ? ColorPDF.Bianco : ColorPDF.Standard_Grigio_SfondoColonnaTabella;
|
|
tabellaCliente.Cells[1, 1].FontColor = ColorPDF.Nero;
|
|
|
|
AddElement(tabellaCliente);
|
|
}
|
|
|
|
#endregion
|
|
|
|
AddElement(new SpacePDF(15));
|
|
|
|
|
|
#region Tabella rischio
|
|
var tabellaRischio = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["rischio"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
Footer = false,
|
|
AlternateRow = false,
|
|
ShowBorderLastLine = true,
|
|
ShowBorderHeader = true,
|
|
WidthSeparationLines = 0,
|
|
YOffset = 10,
|
|
RowHeight = 25
|
|
};
|
|
|
|
tabellaRischio.Columns.Add(new ColumnPDF("Rischio", 173, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo, "Rischio", string.Empty) { HeaderFontSize = 7, FontSize = 7, HeaderBackgroundColor = ColorPDF.Bianco });
|
|
tabellaRischio.Columns.Add(new ColumnPDF("ProfiloFinanziario", 172, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "ProfiloFinanziario", "Limite massimo profilo finanziario") { HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 7 });
|
|
string colonna = "Patrimonio $/Banca/$".Replace("$/Banca/$", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment)).Replace("SIM", "");
|
|
tabellaRischio.Columns.Add(new ColumnPDF("PatrimonioCasa", 173, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "PatrimonioCasa", colonna) { HeaderFontSize = 7, FontSize = 7, HeaderPaddingLeft = 7 });
|
|
|
|
int i = 0;
|
|
foreach (DataRow ro in dati.Tables["rischio"].Rows)
|
|
{
|
|
tabellaRischio.Cells[1, i].HorizontalAlignment =
|
|
tabellaRischio.Cells[2, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
|
|
i++;
|
|
}
|
|
|
|
|
|
AddElement(tabellaRischio);
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
if (dati.Tables["elencoPatrimonio"].Rows.Count > 0)
|
|
{
|
|
|
|
AddElement(new SpacePDF(15));
|
|
|
|
#region Testo introduttivo grafico
|
|
AddElement(new FormattedTextAreaPDF(getTesto2(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7 });
|
|
#endregion
|
|
|
|
AddElement(new SpacePDF(15));
|
|
|
|
#region Tabella patrimonio complessivo
|
|
var tabellaPatrimonio = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["patrimonio"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
Header = false,
|
|
Footer = false,
|
|
AlternateRow = false,
|
|
ShowBorderLastLine = false,
|
|
RowHeight = 25
|
|
};
|
|
tabellaPatrimonio.Columns.Add(new ColumnPDF("descrizione", 150, HorizontalAlignmentType.Sinistra, true, true, 7, ColumnType.Testo, "descrizione", string.Empty) { FontSize = 7 });
|
|
tabellaPatrimonio.Columns.Add(new ColumnPDF("valore", 370, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "valore", string.Empty) { FontSize = 7, PaddingLeft = 5 });
|
|
|
|
AddElement(tabellaPatrimonio);
|
|
|
|
#endregion
|
|
|
|
AddElement(new SpacePDF(15));
|
|
|
|
#region Grafico a barre
|
|
int c = 0;
|
|
|
|
bool FirstTwoRowsSumLinked = true;
|
|
|
|
foreach (DataRow item in dati.Tables["elencoPatrimonio"].Rows)
|
|
{
|
|
if (c < 2)
|
|
{
|
|
if (Convert.ToDouble(item.ItemArray[4].ToString()) == 0)
|
|
{
|
|
FirstTwoRowsSumLinked = false;
|
|
break;
|
|
}
|
|
}
|
|
c++;
|
|
}
|
|
|
|
Int64 iTotale = 0;
|
|
string sTotale = "";
|
|
string sProquota = "";
|
|
bool _RemoveWhiteSpaceToTheRightAxisX = true;
|
|
if (dati.Tables["elencoPatrimonio"].Rows.Count > 0)
|
|
{
|
|
var graficoBarre = new StackedPDF(EnvironmentFacade.RendererFacade.XLeftLimit + 100, 1F)
|
|
{
|
|
HeightSingleBar = 40,
|
|
Width = 400,
|
|
MinorGridAxisY = true,
|
|
ShowLineAxisX = true,
|
|
ShowLineAxisY = true,
|
|
LabelFormatAxisY = FormatType.Intero,
|
|
DinamicFloatXEtichettaLateraleBarra = true,
|
|
FirstTwoRowsSumLinked = FirstTwoRowsSumLinked,
|
|
RemoveWhiteSpaceBetweenChartAndAxisX = _RemoveWhiteSpaceToTheRightAxisX,
|
|
MarginAxisY = 0,
|
|
MarginAxisYFromTop = 0,
|
|
|
|
};
|
|
|
|
|
|
var serieCollezione = new List<Serie> { new Serie { Name = "Patrimoni", Border = true }, new Serie { Name = "ProQuota", Border = true } };
|
|
|
|
var dtGraficoBarre = dati.Tables["elencoPatrimonio"];
|
|
double dDelta = 0;
|
|
foreach (DataRow item in dtGraficoBarre.Rows)
|
|
{
|
|
if (item["Patrimonio"].ToString().ToUpper() == "IMMOBILIARE" && (Convert.ToDouble(item["Controvalore"]) != Convert.ToDouble(item["Proquota"])))
|
|
{
|
|
dDelta = Convert.ToDouble(item["Controvalore"]) - Convert.ToDouble(item["Proquota"]);
|
|
iTotale = Convert.ToInt64(item["Controvalore"]);
|
|
sTotale = Helper.FormatCurrency((Convert.ToDouble(item["Controvalore"])).ToString());
|
|
|
|
|
|
serieCollezione[0].Points.Add(new Point
|
|
{
|
|
// Proquota
|
|
Color = new ColorPDF(148, 180, 198),
|
|
Value = Convert.ToDouble(item["Proquota"]),
|
|
|
|
ShowLabelAxisY = false,
|
|
|
|
LabelAxisY = Helper.FormatCurrency((Convert.ToDouble(item["Controvalore"])).ToString()),
|
|
FontSizeLabelAxisY = 7,
|
|
FontBoldLabelAxisY = false,
|
|
//FontColorLabelAxisY = ColorPDF.Grigio_TitoloPiccoloImmobiliare
|
|
|
|
ShowLabelAxisX = true,
|
|
LabelAxisX = string.Format("{0}<BR/><i>({1})<i>", item["Patrimonio"].ToString(), Helper.FormatPercentage(Convert.ToDecimal(item["Percentuale"]), 2)),
|
|
FontSizeLabelAxisX = 7,
|
|
|
|
//FontColorLabelAxisX = ColorPDF.Grigio_TitoloPiccoloImmobiliare,
|
|
});
|
|
|
|
sProquota = Helper.FormatCurrency(item["Proquota"].ToString());
|
|
|
|
serieCollezione[1].Points.Add(new Point
|
|
{
|
|
// Totale - Proquota
|
|
Color = new ColorPDF(Convert.ToInt32(item["Red"]), Convert.ToInt32(item["Green"]), Convert.ToInt32(item["Blue"])),
|
|
Value = (Convert.ToDouble(item["Controvalore"]) - Convert.ToDouble(item["Proquota"])),
|
|
|
|
ShowLabelAxisY = false,
|
|
|
|
LabelAxisY = Helper.FormatCurrency((Convert.ToDouble(item["Proquota"])).ToString()),
|
|
|
|
FontSizeLabelAxisY = 7,
|
|
FontBoldLabelAxisY = false,
|
|
//FontColorLabelAxisY = ColorPDF.Grigio_TitoloPiccoloImmobiliare
|
|
|
|
ShowLabelAxisX = false,
|
|
LabelAxisX = string.Format("{0}<BR/><i>({1})<i>", item["Patrimonio"].ToString(), Helper.FormatPercentage(Convert.ToDecimal(item["Percentuale"]), 2)),
|
|
FontSizeLabelAxisX = 7,
|
|
//FontColorLabelAxisX = ColorPDF.Grigio_TitoloPiccoloImmobiliare,
|
|
});
|
|
}
|
|
else
|
|
{
|
|
serieCollezione[0].Points.Add(new Point
|
|
{
|
|
Color = new ColorPDF(Convert.ToInt32(item["Red"]), Convert.ToInt32(item["Green"]), Convert.ToInt32(item["Blue"])),
|
|
Value = Convert.ToDouble(item["Controvalore"]),
|
|
|
|
ShowLabelAxisY = true,
|
|
|
|
LabelAxisY = Helper.FormatCurrency(Convert.ToDouble(item["Controvalore"]).ToString()),
|
|
FontSizeLabelAxisY = 7,
|
|
FontBoldLabelAxisY = false,
|
|
//FontColorLabelAxisY = ColorPDF.Grigio_TitoloPiccoloImmobiliare
|
|
|
|
ShowLabelAxisX = true,
|
|
LabelAxisX = string.Format("{0}<BR/><i>({1})<i>", item["Patrimonio"].ToString(), Helper.FormatPercentage(Convert.ToDecimal(item["Percentuale"]), 2)),
|
|
FontSizeLabelAxisX = 7,
|
|
//FontColorLabelAxisX = ColorPDF.Grigio_TitoloPiccoloImmobiliare,
|
|
});
|
|
|
|
serieCollezione[1].Points.Add(new Point
|
|
{
|
|
Color = new ColorPDF(148, 180, 198),
|
|
Value = 0,
|
|
|
|
ShowLabelAxisY = false,
|
|
LabelAxisY = Helper.FormatCurrency("0,00"),
|
|
|
|
FontSizeLabelAxisY = 7,
|
|
FontBoldLabelAxisY = false,
|
|
//FontColorLabelAxisY = ColorPDF.Grigio_TitoloPiccoloImmobiliare
|
|
|
|
ShowLabelAxisX = false,
|
|
LabelAxisX = string.Format("{0}<BR/><i>({1})<i>", item["Patrimonio"].ToString(), Helper.FormatPercentage(Convert.ToDecimal(item["Percentuale"]), 2)),
|
|
FontSizeLabelAxisX = 7,
|
|
//FontColorLabelAxisX = ColorPDF.Grigio_TitoloPiccoloImmobiliare,
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
#region Commento 20181119 - TEST per Evolutiva ProQuota
|
|
|
|
//if (dati.Tables["elencoPatrimonio"].Rows.Count > 0)
|
|
//{
|
|
// var graficoBarre = new StackedPDF(EnvironmentFacade.RendererFacade.XLeftLimit + 100, 1F)
|
|
// {
|
|
// HeightSingleBar = 40,
|
|
// Width = 400,
|
|
// MinorGridAxisY = true,
|
|
// ShowLineAxisX = true,
|
|
// ShowLineAxisY = true,
|
|
// LabelFormatAxisY = FormatType.Decimale2,
|
|
// DinamicFloatXEtichettaLateraleBarra = true,
|
|
// FirstTwoRowsSumLinked = FirstTwoRowsSumLinked,
|
|
// RemoveWhiteSpaceBetweenChartAndAxisX = true,
|
|
// MarginAxisY = 0,
|
|
// MarginAxisYFromTop = 0
|
|
// };
|
|
|
|
//var serieCollezione = new List<Serie> { new Serie { Name = "Patrimoni", Border = true} };
|
|
|
|
//var dtGraficoBarre = dati.Tables["elencoPatrimonio"];
|
|
//foreach (DataRow item in dtGraficoBarre.Rows)
|
|
//{
|
|
// serieCollezione[0].Points.Add(new Point
|
|
// {
|
|
// Color = new ColorPDF(Convert.ToInt32(item["Red"]), Convert.ToInt32(item["Green"]), Convert.ToInt32(item["Blue"])),
|
|
// Value = Convert.ToDouble(item["Controvalore"]),
|
|
|
|
// ShowLabelAxisY = true,
|
|
|
|
// LabelAxisY = Helper.FormatCurrency(item["Controvalore"].ToString()),
|
|
// FontSizeLabelAxisY = 7,
|
|
// FontBoldLabelAxisY = false,
|
|
// //FontColorLabelAxisY = ColorPDF.Grigio_TitoloPiccoloImmobiliare
|
|
|
|
// ShowLabelAxisX = true,
|
|
// LabelAxisX = string.Format("{0}<BR/><i>({1})<i>", item["Patrimonio"].ToString(), Helper.FormatPercentage(Convert.ToDecimal(item["Percentuale"]), 2)),
|
|
// FontSizeLabelAxisX = 7,
|
|
// //FontColorLabelAxisX = ColorPDF.Grigio_TitoloPiccoloImmobiliare,
|
|
// });
|
|
//}
|
|
#endregion
|
|
|
|
graficoBarre.SeriesCollection = serieCollezione;
|
|
|
|
AddElement(graficoBarre);
|
|
|
|
//var maxValue = serieCollezione[0].Points.Max(x => x.Value);
|
|
double maxValue = Helper.Round(graficoBarre.GetMaximumValuePoints(), false);
|
|
double percentuale_Y = (graficoBarre.GetMaximumValuePoints() * 100) / maxValue;
|
|
Int32 iLabel_X = Convert.ToInt32((percentuale_Y * graficoBarre.Width) / 100) + Convert.ToInt16(EnvironmentFacade.RendererFacade.XLeftLimit) + 70; //450;
|
|
if (iLabel_X > 435)
|
|
iLabel_X = 435;
|
|
|
|
Int32 iLabel_Y = 0;
|
|
if (GetOption<Opzione1>().ReportAnonimo)
|
|
iLabel_Y = 523;
|
|
else
|
|
iLabel_Y = 575;
|
|
|
|
//AddElement(new FormattedTextAreaPDF("<b>Immobiliare</b>", iLabel_X)
|
|
//{
|
|
// FontSize = 7,
|
|
// //Y = 525
|
|
// Y = 685
|
|
//});
|
|
|
|
#region Immagini e Label per Proquota
|
|
if (dDelta > 0 && dDelta != Convert.ToDouble(sTotale))
|
|
{
|
|
var imageLabelTotale = new ImagePDF(iLabel_X, 0.8F, "LabelTotale.png", Align.Left, iLabel_Y);
|
|
var imageLabelProquota = new ImagePDF(iLabel_X, 0.8F, "LabelProquota.png", Align.Left, iLabel_Y + 12);
|
|
|
|
AddElement(imageLabelProquota);
|
|
AddElement(imageLabelTotale);
|
|
|
|
AddElement(new FormattedTextAreaPDF("Totale: " + sTotale, iLabel_X + 13)
|
|
{
|
|
FontSize = 7,
|
|
Y = iLabel_Y,
|
|
//Y = 700
|
|
});
|
|
|
|
AddElement(new FormattedTextAreaPDF("Pro quota: " + sProquota, iLabel_X + 13)
|
|
{
|
|
FontSize = 7,
|
|
Y = iLabel_Y + 12,
|
|
//Y = 710
|
|
});
|
|
}
|
|
else
|
|
{
|
|
AddElement(new FormattedTextAreaPDF(sTotale, iLabel_X + 13)
|
|
{
|
|
FontSize = 7,
|
|
Y = iLabel_Y,
|
|
//Y = 700
|
|
});
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region Nota del PatrimonioCasa
|
|
|
|
|
|
if (GetNote1().Length > 0)
|
|
{
|
|
//AddElement(new SpacePDF(30));
|
|
if (GetOption<Opzione1>().ReportAnonimo)
|
|
AddElement(new SpacePDF(35));
|
|
else
|
|
AddElement(new SpacePDF(35));
|
|
|
|
AddElement(new FormattedTextAreaPDF(GetNote1(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 6 });
|
|
}
|
|
#endregion
|
|
}
|
|
}
|
|
|
|
protected sealed override DataTable GetDataTable()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
//protected override DataSet GetDataSet()
|
|
//{
|
|
// #region Definizione Tabelle
|
|
// var ds = new DataSet();
|
|
// ds.Tables.Add(new DataTable("cliente"));
|
|
// ds.Tables.Add(new DataTable("rischio"));
|
|
// ds.Tables.Add(new DataTable("patrimonio"));
|
|
// ds.Tables.Add(new DataTable("elencoPatrimonio"));
|
|
// #endregion
|
|
|
|
// #region Estrazione Chiave PB + Servizi
|
|
|
|
|
|
// var dataPatrimonioComplessivo = datiSeiUnico.patrimonioUnit().patrimonioComplessivo;
|
|
|
|
// var rischioPatrimonioCasa = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale.varInfos;
|
|
// var questionarioCliente = datiSeiUnico.piramideModelloUnit().questionarioMifid;
|
|
// var displayInfo = datiSeiUnico.displayInfos().tipoPatrimonioDisplayInfos;
|
|
|
|
// var cliente = datiSeiUnico.clienteUnit().anagrafica;
|
|
|
|
// #endregion
|
|
|
|
// //Adriano
|
|
// #region Cliente professionale
|
|
|
|
// bool profiloProfessionale;
|
|
// bool profiloAggressivo;
|
|
// bool profiloProfessionaleAggressivo;
|
|
|
|
// Profiler profiler = new Profiler(cliente);
|
|
|
|
// profiloProfessionale = profiler.ProfiloProfessionale;
|
|
// profiloAggressivo = profiler.ProfiloAggressivo;
|
|
// profiloProfessionaleAggressivo = profiler.ProfiloProfessionaleAggressivo;
|
|
|
|
// #endregion
|
|
// //--Adriano
|
|
|
|
// #region Dati del Cliente
|
|
|
|
// ds.Tables["cliente"].Columns.Add(new DataColumn("Descrizione", typeof(string)));
|
|
// ds.Tables["cliente"].Columns.Add(new DataColumn("Valore", typeof(string)));
|
|
// string contrattoDiConsulenza = "";
|
|
// if ("Nessun Contratto".Equals(cliente.contrattoReport))
|
|
// contrattoDiConsulenza = cliente.contrattoReport;
|
|
// else
|
|
// {
|
|
// //Adriano 7/9/17 9.14 modificato per Clienti Professionali
|
|
// //Per il momento serve solo per far stampare il report secondo le richieste per i Clienti Professionali, in seguito dovrebbe essere lo stesso contratto decodificato correttamente se censito nel DB
|
|
// //if (profiloProfessionale)
|
|
// // contrattoDiConsulenza = cliente.contrattoReport + " Professionale del " + cliente.dtSottoscrizione.ToString("dd/MM/yyyy");
|
|
|
|
// //else
|
|
// contrattoDiConsulenza = cliente.contrattoReport + " del " + cliente.dtSottoscrizione.ToString("dd/MM/yyyy");
|
|
// }
|
|
// //--Adriano
|
|
// //originale
|
|
// //contrattoDiConsulenza = cliente.contrattoReport + " del " + cliente.dtSottoscrizione.ToString("dd/MM/yyyy");
|
|
// if (!GetOption<Opzione1>().ReportAnonimo)
|
|
// {
|
|
// ds.Tables["cliente"].Rows.Add("Cliente", string.Format("{0} {1}", cliente.cognome, cliente.nome));
|
|
// ds.Tables["cliente"].Rows.Add("Codice fiscale/Part. IVA", cliente.partitaIva != null ? cliente.partitaIva : cliente.codiceFiscale);
|
|
// ds.Tables["cliente"].Rows.Add("Contratto di consulenza", contrattoDiConsulenza);
|
|
// ds.Tables["cliente"].Rows.Add("Profilo finanziario", string.Format("{0}", cliente.descProfilo));
|
|
// }
|
|
// else
|
|
// {
|
|
|
|
// ds.Tables["cliente"].Rows.Add("Contratto di consulenza", contrattoDiConsulenza);
|
|
// ds.Tables["cliente"].Rows.Add("Profilo finanziario", string.Format("{0}", cliente.descProfilo));
|
|
// }
|
|
|
|
// #endregion
|
|
|
|
// #region Rischio del cliente e del Patrimonio Casa
|
|
|
|
// ds.Tables["rischio"].Columns.Add(new DataColumn("Rischio", typeof(string)));
|
|
// ds.Tables["rischio"].Columns.Add(new DataColumn("ProfiloFinanziario", typeof(string)));
|
|
|
|
// ds.Tables["rischio"].Columns.Add(new DataColumn("PatrimonioCasa", typeof(string)));
|
|
|
|
// //Adriano Per i clienti professionali il rischio mercato sarà 50 (profileVarMax)
|
|
// //Per il momento serve solo per la stampa Report secondo le richieste. In seguito il dato dovrebbe arrivare direttamente corretto (se previsto nel DB)
|
|
// //if (profiloProfessionaleAggressivo)
|
|
// // ds.Tables["rischio"].Rows.Add("Rischio Mercato (VaR %)",
|
|
// // questionarioCliente != null ? Helper.FormatDecimal(50.ToString(), 2) : "n.a.",
|
|
// // rischioPatrimonioCasa.varDecodificato);
|
|
// //else
|
|
// ds.Tables["rischio"].Rows.Add("Rischio Mercato (VaR %)",
|
|
// questionarioCliente != null ? Helper.FormatDecimal(questionarioCliente.profileVarMax.ToString(), 2) : "n.a.",
|
|
// rischioPatrimonioCasa.varDecodificato);
|
|
// //--Adriano
|
|
|
|
// //originale
|
|
// //ds.Tables["rischio"].Rows.Add("Rischio Mercato (VaR %)",
|
|
// // questionarioCliente != null ? Helper.FormatDecimal(questionarioCliente.profileVarMax.ToString(), 2) : "n.a.",
|
|
// // rischioPatrimonioCasa.varDecodificato);
|
|
|
|
// ds.Tables["rischio"].Rows.Add("Rischio Credito",
|
|
// questionarioCliente != null ? Helper.CapitalizeWords(questionarioCliente.profileClassRiskMax) : "n.a.",
|
|
// (rischioPatrimonioCasa.rischioCreditoDecodificato.ToUpper().Contains("CLASSE")) ? Helper.CapitalizeWords(rischioPatrimonioCasa.rischioCreditoDecodificato) : rischioPatrimonioCasa.rischioCreditoDecodificato);
|
|
|
|
// #endregion
|
|
|
|
// #region Patrimonio complessivo
|
|
|
|
// ds.Tables["patrimonio"].Columns.Add(new DataColumn("Descrizione", typeof(string)));
|
|
// ds.Tables["patrimonio"].Columns.Add(new DataColumn("Valore", typeof(string)));
|
|
|
|
// var testoPatrimonio = string.Format("Patrimonio complessivo (€){0}", GetNote1().Length > 0 ? "*" : string.Empty);
|
|
// ds.Tables["patrimonio"].Rows.Add(testoPatrimonio, Helper.FormatCurrency(datiSeiUnico.CMP_TOTALEPOSITIVO.ToString()));
|
|
|
|
// #endregion
|
|
|
|
// #region Elenco patrimoni per grafico a barre
|
|
|
|
// ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Patrimonio", typeof(string)));
|
|
// ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Red", typeof(int)));
|
|
// ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Green", typeof(int)));
|
|
// ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Blue", typeof(int)));
|
|
// ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Controvalore", typeof(decimal)));
|
|
// ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Percentuale", typeof(decimal)));
|
|
// ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Ordinamento", typeof(int)));
|
|
// if (dataPatrimonioComplessivo.elencoSlice != null)
|
|
// {
|
|
// foreach (var item in dataPatrimonioComplessivo.elencoSlice)
|
|
// {
|
|
// var mapDisplayInfo = displayInfo.Where(l => l.key == item.codice).ToArray();
|
|
// string titolo = "";
|
|
// if (item.descrizione.Contains("SanPaolo") || item.descrizione.Contains("Fideuram") || item.descrizione.Contains("Altri"))
|
|
// {
|
|
// bool CASA_NEG = (datiSeiUnico.CASA_CCN + datiSeiUnico.CASA_GPELIGO) != 0;
|
|
// if (item.descrizione.Contains("SanPaolo") || item.descrizione.Contains("Fideuram"))
|
|
// titolo = string.Format(item.descrizione + "{0}", CASA_NEG ? "*" : "");
|
|
// else
|
|
// if (item.descrizione.Contains("Altri"))
|
|
// titolo = string.Format(item.descrizione + "{0}", (datiSeiUnico.TRZ_CCN != 0) ? "*" : "");
|
|
// }
|
|
// else
|
|
// titolo = item.descrizione;
|
|
// var colore = new ColorPDF(mapDisplayInfo[0].value.fill);
|
|
// var ordinamento = mapDisplayInfo[0].value.order;
|
|
|
|
// ds.Tables["elencoPatrimonio"].Rows.Add(titolo, colore.Red, colore.Green, colore.Blue, item.ctv, item.peso * 100, ordinamento);
|
|
// }
|
|
|
|
// ds.Tables["elencoPatrimonio"].AsEnumerable().OrderBy(r => r.Field<int>("Ordinamento"));
|
|
// }
|
|
// #endregion
|
|
|
|
// return ds;
|
|
//}
|
|
|
|
protected override DataSet GetDataSet()
|
|
{
|
|
#region Definizione Tabelle
|
|
var ds = new DataSet();
|
|
ds.Tables.Add(new DataTable("cliente"));
|
|
ds.Tables.Add(new DataTable("dtClienteDueColonne"));
|
|
ds.Tables.Add(new DataTable("rischio"));
|
|
ds.Tables.Add(new DataTable("patrimonio"));
|
|
ds.Tables.Add(new DataTable("elencoPatrimonio"));
|
|
#endregion
|
|
|
|
#region Estrazione Chiave PB + Servizi
|
|
|
|
|
|
var dataPatrimonioComplessivo = datiSeiUnico.patrimonioUnit().patrimonioComplessivo;
|
|
/**************************** Fix per clienti sempre sospesi 31/08/2021 - Andrea ****************************************************************/
|
|
var chiavePB = datiSeiUnico.all().promotoreBancario.chiavePb;
|
|
/***************************************************************************************************************/
|
|
|
|
var rischioPatrimonioCasa = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale.varInfos;
|
|
var questionarioCliente = datiSeiUnico.piramideModelloUnit().questionarioMifid;
|
|
var displayInfo = datiSeiUnico.displayInfos().tipoPatrimonioDisplayInfos;
|
|
|
|
var cliente = datiSeiUnico.clienteUnit().anagrafica;
|
|
|
|
#endregion
|
|
|
|
//Adriano
|
|
#region Cliente professionale
|
|
|
|
bool profiloProfessionale;
|
|
bool profiloAggressivo;
|
|
bool profiloProfessionaleAggressivo;
|
|
|
|
Profiler profiler = new Profiler(cliente);
|
|
|
|
profiloProfessionale = profiler.ProfiloProfessionale;
|
|
profiloAggressivo = profiler.ProfiloAggressivo;
|
|
profiloProfessionaleAggressivo = profiler.ProfiloProfessionaleAggressivo;
|
|
|
|
#endregion
|
|
//--Adriano
|
|
|
|
#region Dati del Cliente
|
|
|
|
ds.Tables["cliente"].Columns.Add(new DataColumn("Descrizione", typeof(string)));
|
|
ds.Tables["cliente"].Columns.Add(new DataColumn("Valore", typeof(string)));
|
|
var dtClienteDueColonne = ds.Tables["dtClienteDueColonne"];
|
|
dtClienteDueColonne.Columns.Add(new DataColumn("controvalore"));
|
|
dtClienteDueColonne.Columns.Add(new DataColumn("valore"));
|
|
dtClienteDueColonne.Columns.Add(new DataColumn("descrizione"));
|
|
dtClienteDueColonne.Columns.Add(new DataColumn("val"));
|
|
|
|
/* string contrattoDiConsulenza = "";
|
|
if ("Nessun Contratto".Equals(cliente.contrattoReport))
|
|
contrattoDiConsulenza = cliente.contrattoReport;
|
|
else
|
|
{
|
|
//Adriano 7/9/17 9.14 modificato per Clienti Professionali
|
|
//Per il momento serve solo per far stampare il report secondo le richieste per i Clienti Professionali, in seguito dovrebbe essere lo stesso contratto decodificato correttamente se censito nel DB
|
|
//if (profiloProfessionale)
|
|
// contrattoDiConsulenza = cliente.contrattoReport + " Professionale del " + cliente.dtSottoscrizione.ToString("dd/MM/yyyy");
|
|
|
|
//else
|
|
contrattoDiConsulenza = cliente.contrattoReport + " del " + cliente.dtSottoscrizione.ToString("dd/MM/yyyy");
|
|
}
|
|
//--Adriano
|
|
//originale
|
|
//contrattoDiConsulenza = cliente.contrattoReport + " del " + cliente.dtSottoscrizione.ToString("dd/MM/yyyy");
|
|
*/
|
|
if (!GetOption<Opzione1>().ReportAnonimo)
|
|
{
|
|
ds.Tables["cliente"].Rows.Add("Cliente", string.Format("{0} {1}", cliente.cognome, cliente.nome));
|
|
ds.Tables["cliente"].Rows.Add("Codice fiscale/Part. IVA", cliente.partitaIva != null ? cliente.partitaIva : cliente.codiceFiscale);
|
|
|
|
//ds.Tables["cliente"].Rows.Add("Contratto di consulenza", contrattoDiConsulenza);
|
|
//ds.Tables["cliente"].Rows.Add("Profilo finanziario", string.Format("{0}", cliente.descProfilo));
|
|
}
|
|
|
|
DataTable dtSospeso = null;
|
|
String sospeso = "";
|
|
|
|
// ************************************ Fix per clienti sempre sospesi 31/08/2021 - Andrea ***********************************************************************************//
|
|
// String query = "Select chiaveCliente from vRfaMinusPerPB where codFis = '" + (cliente.partitaIva != null ? cliente.partitaIva : cliente.codiceFiscale) + "'";
|
|
String query = "Select chiaveCliente from vRfaMinusPerPB where chiavePB = '" + (chiavePB.ToString()) + "' and codFis = '" + (cliente.partitaIva != null ? cliente.partitaIva : cliente.codiceFiscale) + "'";
|
|
// *******************************************************************************************************************************************************//
|
|
|
|
dtSospeso = DataAccess.ExecuteDataTableSqlStatement(DBProvider.SqlServerConsulenzaUnica, query, null);
|
|
if (dtSospeso.Rows.Count > 0 && !DBNull.Value.Equals(dtSospeso.Rows[0][0]))
|
|
{//è sospeso si comporta come base+
|
|
if (!cliente.contrattoReport.Contains("sospeso"))//controllo se già contiene l'indicazione
|
|
{
|
|
sospeso = " sospeso";
|
|
}
|
|
}
|
|
|
|
DataRow row = dtClienteDueColonne.NewRow();
|
|
dtClienteDueColonne.Rows.Add(row);
|
|
dtClienteDueColonne.Rows[0]["controvalore"] = "Contratto di consulenza";
|
|
dtClienteDueColonne.Rows[0]["valore"] = cliente.contrattoReport + sospeso;
|
|
dtClienteDueColonne.Rows[0]["descrizione"] = "Data sottoscrizione";
|
|
dtClienteDueColonne.Rows[0]["val"] = cliente.dtSottoscrizione.ToString("dd/MM/yyyy");
|
|
DataRow row2 = dtClienteDueColonne.NewRow();
|
|
dtClienteDueColonne.Rows.Add(row2);
|
|
dtClienteDueColonne.Rows[1]["controvalore"] = "Profilo finanziario";
|
|
dtClienteDueColonne.Rows[1]["valore"] = cliente.descProfilo;
|
|
dtClienteDueColonne.Rows[1]["descrizione"] = "Profilo esperienza e conoscenza";
|
|
dtClienteDueColonne.Rows[1]["val"] = cliente.descProfiloEC;
|
|
|
|
|
|
#endregion
|
|
|
|
#region Rischio del cliente e del Patrimonio Casa
|
|
|
|
ds.Tables["rischio"].Columns.Add(new DataColumn("Rischio", typeof(string)));
|
|
ds.Tables["rischio"].Columns.Add(new DataColumn("ProfiloFinanziario", typeof(string)));
|
|
|
|
ds.Tables["rischio"].Columns.Add(new DataColumn("PatrimonioCasa", typeof(string)));
|
|
|
|
//Adriano Per i clienti professionali il rischio mercato sarà 50 (profileVarMax)
|
|
//Per il momento serve solo per la stampa Report secondo le richieste. In seguito il dato dovrebbe arrivare direttamente corretto (se previsto nel DB)
|
|
//if (profiloProfessionaleAggressivo)
|
|
// ds.Tables["rischio"].Rows.Add("Rischio Mercato (VaR %)",
|
|
// questionarioCliente != null ? Helper.FormatDecimal(50.ToString(), 2) : "n.a.",
|
|
// rischioPatrimonioCasa.varDecodificato);
|
|
//else
|
|
ds.Tables["rischio"].Rows.Add("Rischio Mercato (VaR %)",
|
|
questionarioCliente != null ? Helper.FormatDecimal(questionarioCliente.profileVarMax.ToString(), 2) : "n.a.",
|
|
rischioPatrimonioCasa.varDecodificato);
|
|
//--Adriano
|
|
|
|
//originale
|
|
//ds.Tables["rischio"].Rows.Add("Rischio Mercato (VaR %)",
|
|
// questionarioCliente != null ? Helper.FormatDecimal(questionarioCliente.profileVarMax.ToString(), 2) : "n.a.",
|
|
// rischioPatrimonioCasa.varDecodificato);
|
|
|
|
ds.Tables["rischio"].Rows.Add("Rischio Credito",
|
|
questionarioCliente != null ? Helper.CapitalizeWords(questionarioCliente.profileClassRiskMax) : "n.a.",
|
|
(rischioPatrimonioCasa.rischioCreditoDecodificato.ToUpper().Contains("CLASSE")) ? Helper.CapitalizeWords(rischioPatrimonioCasa.rischioCreditoDecodificato) : rischioPatrimonioCasa.rischioCreditoDecodificato);
|
|
|
|
#endregion
|
|
|
|
#region Patrimonio complessivo
|
|
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("Descrizione", typeof(string)));
|
|
ds.Tables["patrimonio"].Columns.Add(new DataColumn("Valore", typeof(string)));
|
|
|
|
var testoPatrimonio = string.Format("Patrimonio complessivo (€){0}", GetNote1().Length > 0 ? "*" : string.Empty);
|
|
ds.Tables["patrimonio"].Rows.Add(testoPatrimonio, Helper.FormatCurrency(datiSeiUnico.CMP_TOTALEPOSITIVO.ToString()));
|
|
|
|
#endregion
|
|
|
|
#region Elenco patrimoni per grafico a barre
|
|
|
|
ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Patrimonio", typeof(string)));
|
|
ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Red", typeof(int)));
|
|
ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Green", typeof(int)));
|
|
ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Blue", typeof(int)));
|
|
ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Controvalore", typeof(decimal)));
|
|
ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("ProQuota", typeof(decimal)));
|
|
ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Percentuale", typeof(decimal)));
|
|
ds.Tables["elencoPatrimonio"].Columns.Add(new DataColumn("Ordinamento", typeof(int)));
|
|
if (dataPatrimonioComplessivo.elencoSlice != null)
|
|
{
|
|
foreach (var item in dataPatrimonioComplessivo.elencoSlice)
|
|
{
|
|
var mapDisplayInfo = displayInfo.Where(l => l.key == item.codice).ToArray();
|
|
string titolo = "";
|
|
if (item.descrizione.Contains("SanPaolo") || item.descrizione.Contains("Fideuram") || item.descrizione.Contains("Altri"))
|
|
{
|
|
bool CASA_NEG = (datiSeiUnico.CASA_CCN + datiSeiUnico.CASA_GPELIGO) != 0;
|
|
if (item.descrizione.Contains("SanPaolo") || item.descrizione.Contains("Fideuram"))
|
|
titolo = string.Format(item.descrizione + "{0}", CASA_NEG ? "*" : "");
|
|
else
|
|
if (item.descrizione.Contains("Altri"))
|
|
titolo = string.Format(item.descrizione + "{0}", (datiSeiUnico.TRZ_CCN != 0) ? "*" : "");
|
|
}
|
|
else
|
|
titolo = item.descrizione;
|
|
var colore = new ColorPDF(mapDisplayInfo[0].value.fill);
|
|
var ordinamento = mapDisplayInfo[0].value.order;
|
|
|
|
//ds.Tables["elencoPatrimonio"].Rows.Add(titolo, colore.Red, colore.Green, colore.Blue, item.ctv, item.peso * 100, ordinamento);
|
|
// Provvisorio 20181123
|
|
ds.Tables["elencoPatrimonio"].Rows.Add(titolo, colore.Red, colore.Green, colore.Blue, item.ctv, item.proQuota, item.peso * 100, ordinamento);
|
|
}
|
|
|
|
ds.Tables["elencoPatrimonio"].AsEnumerable().OrderBy(r => r.Field<int>("Ordinamento"));
|
|
}
|
|
#endregion
|
|
|
|
return ds;
|
|
}
|
|
|
|
|
|
public virtual string getTesto1()
|
|
{
|
|
string testo = "Sono riportati di seguito le principali informazioni anagrafiche e ";
|
|
testo += "il profilo finanziario del cliente: il livello di rischio del patrimonio $/Banca/$ in termini di ";
|
|
testo += "Rischio Mercato (VaR) e Rischio Credito è confrontato con i livelli massimi associati al suo profilo finanziario.";
|
|
return testo.Replace("$/Banca/$", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment));
|
|
}
|
|
|
|
public virtual string getTesto2()
|
|
{
|
|
string testo = "Il grafico rappresenta la ripartizione del suo patrimonio in finanziario ($/Banca/$ e altri Istituti), immobiliare, aziendale e altro.";
|
|
return testo.Replace("$/Banca/$", Helper.ReplaceVariables("$/Banca/$", EnvironmentFacade.ReportEnvironment));
|
|
|
|
}
|
|
|
|
public virtual string GetNote1()
|
|
{
|
|
|
|
string nota = "";
|
|
string token = "";
|
|
|
|
|
|
decimal CCN_CASA = datiSeiUnico.CASA_CCN;
|
|
decimal GPELIGOFONDI_CASA = datiSeiUnico.CASA_GPELIGOFONDI;
|
|
decimal GPELIGTITOLI_CASA = datiSeiUnico.CASA_GPELIGTITOLI;
|
|
decimal CCN_TERZI = datiSeiUnico.TRZ_CCN;
|
|
|
|
// 20181009 AC
|
|
decimal TUOFOGLIO_CASA = datiSeiUnico.CASA_TUOFOGLIO;
|
|
//--20181009 AC
|
|
|
|
// 20181009 AC
|
|
//if (CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || CCN_TERZI != 0)
|
|
if (CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || CCN_TERZI != 0 || TUOFOGLIO_CASA != 0)
|
|
//--20181009 AC
|
|
{
|
|
nota += token + "Il controvalore esclude il saldo negativo";
|
|
token = " ";
|
|
if (CCN_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("dei conti correnti ({0} €)", CCN_CASA);
|
|
token = ", ";
|
|
}
|
|
// 20181009 AC
|
|
if (TUOFOGLIO_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("della liquidità sottostante Il Mio Foglio ({0} €)", TUOFOGLIO_CASA);
|
|
token = ", ";
|
|
}
|
|
//--20181009 AC
|
|
if (GPELIGOFONDI_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("della liquidità sottostante la GP Eligo Fondi ({0} €)", GPELIGOFONDI_CASA);
|
|
token = ", ";
|
|
}
|
|
if (GPELIGTITOLI_CASA != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("della liquidità sottostante la GP Eligo Titoli ({0} €)", GPELIGTITOLI_CASA);
|
|
token = ", ";
|
|
}
|
|
token = " ";
|
|
if (CCN_CASA != 0 || GPELIGOFONDI_CASA != 0 || GPELIGTITOLI_CASA != 0 || TUOFOGLIO_CASA != 0)
|
|
{
|
|
nota += token + "del patrimonio $/Banca/$";
|
|
token = ", ";
|
|
}
|
|
if (CCN_TERZI != 0)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("dei conti correnti ({0} €) del patrimonio altri Istituti", CCN_TERZI);
|
|
token = ", ";
|
|
}
|
|
nota += ".";
|
|
token = " ";
|
|
}
|
|
|
|
nota = !nota.Equals("") ? "(*) " + nota : nota;
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
|
|
}
|
|
}
|
|
}
|