2351 lines
152 KiB
C#
2351 lines
152 KiB
C#
using System;
|
|
using Consulenza.ReportWriter.Business;
|
|
using Consulenza.ReportWriter.Business.OBJ_PDF;
|
|
using System.Data;
|
|
using Consulenza.ReportCommon;
|
|
using System.Linq;
|
|
using Consulenza.DataServices.fideuram.data.service;
|
|
using System;
|
|
using Consulenza.ReportWriter.Business;
|
|
using Consulenza.ReportWriter.Business.OBJ_PDF;
|
|
using System.Data;
|
|
using System.Collections.Generic;
|
|
using Consulenza.ReportCommon;
|
|
using Consulenza.ReportWriter.Business.CUSTOM_PDF.ConsulenzaUnica;
|
|
using System.Linq;
|
|
using Consulenza.ReportWriter.Business.Entity;
|
|
using Consulenza.DataServices.fideuram.data.service;
|
|
using Consulenza.ReportWriter.Business.CHART_PDF;
|
|
using Dundas.Charting.WebControl;
|
|
|
|
namespace Consulenza.ReportWriter.Manager.Section.Unica
|
|
{
|
|
/// <summary>
|
|
/// Scheda 12. Patrimonio Fideuram: dettaglio prodotti. IdSezione 55
|
|
/// </summary>
|
|
public class S12 : Entity.Section
|
|
{
|
|
|
|
|
|
|
|
public S12(EnvironmentFacade environmentFacade, int idSection)
|
|
: base(environmentFacade, idSection)
|
|
{
|
|
try
|
|
{
|
|
bool saltoPagina = false;
|
|
if (requiredProdottiCasa())
|
|
{
|
|
if (saltoPagina)
|
|
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
|
saltoPagina = true;
|
|
|
|
var intestazioneCasa = new ChapterHeadingPDF(
|
|
Helper.ReplaceVariables(getCapitolo1(), base.EnvironmentFacade.ReportEnvironment),
|
|
// Helper.ReplaceVariables(getTesto1(), base.EnvironmentFacade.ReportEnvironment),
|
|
EnvironmentFacade.RendererFacade.XLeftLimit,
|
|
EnvironmentFacade.RendererFacade.YUpperLimit,
|
|
EnvironmentFacade.ReportEnvironment.FontFamily);
|
|
AddElement(intestazioneCasa.ToElement());
|
|
|
|
productsTypeSelected = PRODUCT_TYPE_CASA;
|
|
Draw();
|
|
}
|
|
if(requiredProdottiCointestati())
|
|
{
|
|
productsTypeSelected = PRODUCT_TYPE_COINTESTATI;
|
|
if (saltoPagina)
|
|
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
|
saltoPagina = true;
|
|
|
|
var intestazioneCointestati = new ChapterHeadingPDF(
|
|
Helper.ReplaceVariables(getCapitolo2(), base.EnvironmentFacade.ReportEnvironment),
|
|
//Helper.ReplaceVariables(getTesto1(), base.EnvironmentFacade.ReportEnvironment),
|
|
EnvironmentFacade.RendererFacade.XLeftLimit,
|
|
EnvironmentFacade.RendererFacade.YUpperLimit,
|
|
EnvironmentFacade.ReportEnvironment.FontFamily);
|
|
AddElement(intestazioneCointestati.ToElement());
|
|
|
|
Draw();
|
|
}
|
|
if (requiredProdottiTCM())
|
|
{
|
|
productsTypeSelected = PRODUCT_TYPE_TCM;
|
|
if (saltoPagina)
|
|
AddElement(new PagePDF(PagePDF.PagePDFType.Generic));
|
|
saltoPagina = true;
|
|
|
|
var intestazionetcm = new ChapterHeadingPDF(
|
|
Helper.ReplaceVariables(getCapitolo3(), base.EnvironmentFacade.ReportEnvironment),
|
|
EnvironmentFacade.RendererFacade.XLeftLimit,
|
|
EnvironmentFacade.RendererFacade.YUpperLimit,
|
|
EnvironmentFacade.ReportEnvironment.FontFamily);
|
|
AddElement(intestazionetcm.ToElement());
|
|
|
|
DrawTCM();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SectionLogger.Write("S12", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment);
|
|
}
|
|
}
|
|
public bool gpOmniaPresent = false;//campo a catalogo codInterno=XY
|
|
public bool gpEligoFondPresent = false;//campo a catalogo codSottoprodotto = L191
|
|
public bool gpEligoTitPresent = false;//campo a catalogo codSottoprodotto = L192
|
|
public bool gpFoglioPresent = false;//campo a catalogo codInterno=fo
|
|
public bool gpPresent = false;
|
|
public bool fondiPresent = false;
|
|
public bool ulPresent = false;
|
|
public bool apPresent = false;
|
|
public bool titPresent = false;
|
|
public bool fondiEurizonPresent = false;//campo a catalogo CODICE_INTERNO = US o CODICE_INTERNO = WS
|
|
public bool mcGestioniSgrPresent = false;//campo a catalogo CODICE_INTERNO = MK
|
|
public bool fidProgettoPensionePresent = false;//campo a catalogo CODICE_INTERNO = 80
|
|
public bool evProgettoPensionePresent = false;//campo a catalogo CODICE_INTERNO = PP
|
|
public bool isCategorieProdotto = false;
|
|
public bool fondiAGaranziaPresent = false;//campo a catalogo CODICE_INTERNO = ??
|
|
public bool isAreeDiBisogno = false;
|
|
int fontsize = 6;
|
|
int headerFontSize = 6;
|
|
int widthData = 50;
|
|
int widthPerc = 50;
|
|
int widthImporti = 70;
|
|
int width60 = 60;
|
|
|
|
private String productsTypeSelected = "";
|
|
private const String PRODUCT_TYPE_CASA = "TYPE_CASA";
|
|
private const String PRODUCT_TYPE_COINTESTATI = "TYPE_COINTESTATI";
|
|
private const String PRODUCT_TYPE_TCM = "TYPE_TCM";
|
|
|
|
|
|
protected override sealed void Draw()
|
|
{
|
|
|
|
var dati = GetDataSet();
|
|
if (getTesto1().Length > 0)
|
|
{
|
|
AddElement(new SpacePDF(20));
|
|
AddElement(new FormattedTextAreaPDF(getTesto1(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(15));
|
|
}
|
|
var tabellaProdotti = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["prodotti"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
Footer = true,
|
|
AlternateRow = false,
|
|
ShowBorderLastLine = false,
|
|
HeaderHeight = 30,
|
|
HeaderMargin = 2
|
|
};
|
|
|
|
|
|
int widthTotaleAltre = calculateWidth() + 15;
|
|
int widthNomeProdotto = 520 - widthTotaleAltre;
|
|
int numeroCaratteri = widthNomeProdotto <= 100 ? 25 : widthNomeProdotto <= 140 ? 30 : widthNomeProdotto <= 160 ? 38 : 52;
|
|
// Modifica per Saving Map
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("SavingMap", 10, HorizontalAlignmentType.Destra, false, false, 6, ColumnType.Immagine, "SavingMap", string.Empty) { DeltaYContent = 6, ScaleColumnTypeImage = 0.50F,PaddingRight = 20 });
|
|
//tabellaProdotti.Columns.Add(new ColumnPDF("SavingMap", 15, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Immagine, "immagineValue", string.Empty) { DeltaYContent = 6, ScaleColumnTypeImage = 0.50F });
|
|
// Fine Modifica
|
|
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("Immagine", 15, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Objectpdf, string.Empty, string.Empty) { HeaderFontSize = headerFontSize, PaddingLeft = 2 });
|
|
if (getColonne().NomeProdotto)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("NomeProdotto", widthNomeProdotto-10, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "NomeProdotto", "Nome prodotto") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 2 });
|
|
if (getColonne().ContrattoDossier)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("ContrattoDossier", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "ContrattoDossier", "Contratto /<br>Dossier") { HeaderFontSize = headerFontSize });
|
|
if (getColonne().CodIsin)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("CodIsin", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "CodIsin", "Cod. ISIN") { HeaderFontSize = headerFontSize, PaddingLeft = 6, HeaderPaddingLeft = 3 });
|
|
if (getColonne().DistrCedoleDividendi)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DistrCedoleDividendi", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DistrCedoleDividendi", "Distr. cedole /<br>dividendi") { HeaderFontSize = headerFontSize, PaddingRight = 2 });
|
|
if (getColonne().RatingMorningstar)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RatingMorningstar", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RatingMorningstar", "Rating Morningstar Overall") { HeaderFontSize = headerFontSize, PaddingLeft = 6, HeaderPaddingLeft = 3 });
|
|
if (getColonne().NumqQuantValnom)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("NumqQuantValnom", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "NumqQuantValnom", "Num. Quote / Quant. / Val. nom.") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().QuotaPrezzoEuro)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("QuotaPrezzoEuro", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "QuotaPrezzoEuro", "Quota /<br>Prezzo Euro") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 15, HeaderPaddingRight = 10 });
|
|
if (getColonne().ControvaloreAttuale)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("ControvaloreAttuale", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "ControvaloreAttuale", "Controvalore attuale (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 15, HeaderPaddingRight = 15 });
|
|
if (getColonne().DataAgg)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DataAgg", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DataAgg", "Data agg.") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 10, PaddingRight = 2 });
|
|
if (getColonne().VersatoNettoSott)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("VersatoNettoSott", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "VersatoNettoSott", "Versato netto<br>da sott. (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().UtilePerditaSott)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("UtilePerditaSott", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "UtilePerditaSott", "Utile / Perdita<br>da sott. (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().RendAnnualSott)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RendAnnualSott", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RendAnnualSott", "Rend. da<br>sott. (%)*") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 6 });
|
|
if (getColonne().DataSott)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DataSott", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DataSott", "Data sott.") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 10, PaddingRight = 2 });
|
|
if (getColonne().VersatoNettoAssoc)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("VersatoNettoAssoc", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "VersatoNettoAssoc", "Versato netto<br>da assoc. (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().UtilPerditaAssoc)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("UtilPerditaAssoc", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "UtilPerditaAssoc", "Utile / Perdita<br>da assoc. (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().RendCumAssoc)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RendCumAssoc", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RendCumAssoc", "Rend. cum.<br>da assoc. (%)*") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 3 });
|
|
if (getColonne().DataAssoc)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DataAssoc", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DataAssoc", "Data assoc.") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 10, PaddingRight = 2 });
|
|
if (getColonne().RendInizioTrimestre)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RendInizioTrimestre", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RendInizioTrimestre", "Rend. inizio<br>trimestre (%)*") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 3 });
|
|
if (getColonne().RendInizioAnno)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RendInizioAnno", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RendInizioAnno", "Rend. inizio<br>anno (%)*") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10 });
|
|
if (getColonne().VaR)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("VaR", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "VaR", "VaR (%)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 15 });
|
|
if (getColonne().RischioCredito)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RischioCredito", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RischioCredito", "Rischio<br>Credito") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10 });
|
|
if (getColonne().Complessità)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("Complessità", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "Complessità", "Complessità") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingRight = 2, HeaderPaddingLeft = 6 });
|
|
if (getColonne().ValoriDiCarico)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("ValoriDiCarico", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "ValoriDiCarico", "Prezzo medio<br>di carico (€)" + getAsterischiForValoriDiCarico()) { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().UtilePerditaCaricoEuro)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("UtilePerditaCaricoEuro", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "UtilePerditaCaricoEuro", "Utile / Perdita<br>di Carico (€)" + getAsterischiForUtilePerditaCaricoEuro()) { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().UtilePerditaCaricoPerc)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("UtilePerditaCaricoPerc", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "UtilePerditaCaricoPerc", "Utile / Perdita<br>di Carico (%)" + getAsterischiForUtilePerditaCaricoPerc()) { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 5, HeaderPaddingRight = 2 });
|
|
|
|
Boolean isSavingMap = false;
|
|
for (int h = 0; h < dati.Tables["prodotti"].Rows.Count; h++)
|
|
{
|
|
DataRow prodotto = dati.Tables["prodotti"].Rows[h];
|
|
if (!prodotto["SavingMap"].Equals(""))
|
|
{
|
|
isSavingMap = true;
|
|
}
|
|
if (!prodotto["CodArea"].Equals(""))
|
|
{
|
|
string codArea = prodotto["CodArea"].ToString();
|
|
tabellaProdotti.Cells[1, h].ColSpan = 2;
|
|
var listaOggetti = new List<ObjectPDF> {
|
|
new RectanglePDF(8,8, ColorPDF.GetBy_AreaBisogno(codArea)){DeltaY = 4.8F},
|
|
new FormattedTextAreaPDF
|
|
{
|
|
Text = codArea.Substring(0,1),
|
|
FontBold = true,
|
|
FontColor = ColorPDF.Bianco,
|
|
DeltaX = codArea.Substring(0,1).Equals("I")?2.3F:2.0F,
|
|
FontSize= 6,
|
|
DeltaY = 2.3F
|
|
},
|
|
new FormattedTextAreaPDF
|
|
{
|
|
Text = prodotto["Descrizione"].ToString(),
|
|
FontBold = Convert.ToBoolean(prodotto["FontBold"]),
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 14F,
|
|
FontSize= 6,
|
|
DeltaY = 2.2F
|
|
}
|
|
};
|
|
if ((prodotto["Descrizione"].ToString().Equals("GP ET - Liquidità") || prodotto["Descrizione"].ToString().Equals("GP EF- Liquidità")) && Convert.ToDecimal(prodotto["ControvaloreAttuale"]) < 0)
|
|
{
|
|
listaOggetti = new List<ObjectPDF>
|
|
{
|
|
new RectanglePDF(8, 8, ColorPDF.Bianco){DeltaY = 4.8F},
|
|
new FormattedTextAreaPDF
|
|
{
|
|
Text = "-",
|
|
FontBold = true,
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 2F,
|
|
FontSize = 6,
|
|
DeltaY = 2.3F
|
|
},
|
|
new FormattedTextAreaPDF
|
|
{
|
|
Text = prodotto["Descrizione"].ToString(),
|
|
FontBold = false,
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 14F,
|
|
FontSize=6,
|
|
DeltaY = 2.2F
|
|
}
|
|
};
|
|
}
|
|
tabellaProdotti.Cells[1, h].ValueObjectList.AddRange(listaOggetti);
|
|
tabellaProdotti.Cells[1, h].YContentOffset = 10;
|
|
|
|
}
|
|
else if (!prodotto["Descrizione"].Equals(""))
|
|
{
|
|
int lenght = prodotto["Descrizione"].ToString().Length < numeroCaratteri ? prodotto["Descrizione"].ToString().Length : numeroCaratteri;
|
|
int lastIndexOfSpace = prodotto["Descrizione"].ToString().Substring(0, lenght).LastIndexOf(' ');
|
|
string nomeProdotto = prodotto["Descrizione"].ToString().Length <= numeroCaratteri ? prodotto["Descrizione"].ToString() : prodotto["Descrizione"].ToString().Substring(0, lastIndexOfSpace) + "<BR>" + prodotto["Descrizione"].ToString().Substring(lastIndexOfSpace + 1);
|
|
tabellaProdotti.Cells[1, h].ColSpan = 2;
|
|
int lunghezza = widthNomeProdotto;
|
|
float iDeltaY = prodotto["Descrizione"].ToString().Length <= numeroCaratteri ? 2.5F : 0.3F;
|
|
tabellaProdotti.Cells[1, h].ValueObject = new FormattedTextAreaPDF
|
|
{
|
|
Text = nomeProdotto,
|
|
FontBold = Convert.ToBoolean(prodotto["FontBold"]),
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 14.0F,
|
|
FontSize = 6,
|
|
DeltaY = iDeltaY,
|
|
Width = widthNomeProdotto
|
|
};
|
|
}
|
|
else if (!prodotto["NomeProdotto"].Equals(""))
|
|
{
|
|
int lenght = prodotto["NomeProdotto"].ToString().Length < numeroCaratteri ? prodotto["NomeProdotto"].ToString().Length : numeroCaratteri;
|
|
int lastIndexOfSpace = prodotto["NomeProdotto"].ToString().Substring(0, lenght).LastIndexOf(' ');
|
|
string nomeProdotto = prodotto["NomeProdotto"].ToString().Length <= numeroCaratteri ? prodotto["NomeProdotto"].ToString() : prodotto["NomeProdotto"].ToString().Substring(0, lastIndexOfSpace) + "<BR>" + prodotto["NomeProdotto"].ToString().Substring(lastIndexOfSpace);
|
|
tabellaProdotti.Cells[1, h].ColSpan = 2;
|
|
int lunghezza = widthNomeProdotto;
|
|
float iDeltaY = prodotto["NomeProdotto"].ToString().Length <= numeroCaratteri ? 2.5F : 0.3F;
|
|
tabellaProdotti.Cells[1, h].ValueObject = new FormattedTextAreaPDF
|
|
{
|
|
Text = nomeProdotto,
|
|
FontBold = false,
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 4.0F,
|
|
FontSize = 6,
|
|
DeltaY = iDeltaY,
|
|
Width = widthNomeProdotto
|
|
};
|
|
|
|
}
|
|
|
|
for (int c = 0; c < tabellaProdotti.Columns.Count; c++)
|
|
{
|
|
if (Convert.ToBoolean(prodotto["BackGroundColor"]))
|
|
tabellaProdotti.Cells[c, h].BackgroundColor = ColorPDF.ConsulenzaUnica_Grigio_SfondoColonnaHeaderFooterTabella;
|
|
|
|
if (Convert.ToBoolean(prodotto["FontBold"]))
|
|
tabellaProdotti.Cells[c, h].FontBold = true;
|
|
|
|
if (tabellaProdotti.Columns[c].Id.Equals("Immagine"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
//if (tabellaProdotti.Columns[c].Id.Equals("Area"))
|
|
// tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("ContrattoDossier"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("NomeProdotto"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("CodIsin"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("DistrCedoleDividendi"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RatingMorningstar"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("NumqQuantValnom"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("QuotaPrezzoEuro"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("ControvaloreAttuale"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("DataAgg"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("VersatoNettoSott"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("UtilePerditaSott"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RendAnnualSott"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("DataSott"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("VersatoNettoAssoc"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("UtilPerditaAssoc"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RendCumAssoc"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("DataAssoc"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RendInizioTrimestre"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RendInizioAnno"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("VaR"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RischioCredito"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("Complessità"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("ValoriDiCarico"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("UtilePerditaCaricoEuro"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("UtilePerditaCaricoPerc"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
|
|
}
|
|
}
|
|
if (getNote3().Length > 0)
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNote3(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella) { FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
if (getNote1().Length > 0)
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNote1(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6 });
|
|
|
|
if (getNote2().Length > 0)
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNote2(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6 });
|
|
|
|
if (getNote4().Length > 0)
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNote4(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
if (getNote5().Length > 0)
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNote5(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
if (getNote6().Length > 0)
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNote6(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
|
|
|
|
if (isSavingMap)
|
|
{
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
"Servizio Saving Map attivo.",
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella,
|
|
new ImagePDF(EnvironmentFacade.RendererFacade.XLeftLimit, 0.60F, "SavingMap.png"))
|
|
{ FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Left });
|
|
}
|
|
AddElement(tabellaProdotti);
|
|
}
|
|
|
|
protected void DrawTCM()
|
|
{
|
|
|
|
var dati = GetDataSetTCM();
|
|
if (getTesto1().Length > 0)
|
|
{
|
|
AddElement(new SpacePDF(20));
|
|
AddElement(new FormattedTextAreaPDF(getTesto1(), EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(15));
|
|
}
|
|
|
|
for (int h = 0; h < dati.Tables["prodottiTCM"].Rows.Count; h++)
|
|
{
|
|
var tableName = "prodottiTCM" + h;
|
|
var ds = new DataSet();
|
|
ds.Tables.Add(tableName);
|
|
DataTable dataTable = ds.Tables[tableName];
|
|
dataTable.Columns.Add("Prodotto", typeof(string));
|
|
dataTable.Columns.Add("NumPolizza", typeof(string));
|
|
dataTable.Columns.Add("DataDecorrenza", typeof(string));
|
|
dataTable.Columns.Add("DataScadenza", typeof(string));
|
|
dataTable.Columns.Add("PremioAnnuo", typeof(string));
|
|
dataTable.Columns.Add("Periodicita", typeof(string));
|
|
dataTable.Columns.Add("TotaleVersato", typeof(string));
|
|
dataTable.Columns.Add("Contratto", typeof(string));
|
|
|
|
DataRow prodotto = dati.Tables["prodottiTCM"].Rows[h];
|
|
dataTable.ImportRow(prodotto);
|
|
|
|
var tabellaProdotti = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dataTable)
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
Footer = false,
|
|
AlternateRow = false,
|
|
ShowBorderLastLine = false,
|
|
HeaderHeight = 30,
|
|
HeaderMargin = 2
|
|
};
|
|
|
|
|
|
|
|
int widthTotaleAltre = 370;
|
|
int widthNomeProdotto = 520 - widthTotaleAltre;
|
|
int numeroCaratteri = widthNomeProdotto <= 100 ? 25 : widthNomeProdotto <= 140 ? 30 : widthNomeProdotto <= 160 ? 38 : 52;
|
|
//RIGA AGGREGATA
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("Contratto", widthNomeProdotto, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "Prodotto", "Contratto "+prodotto["Contratto"]) { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 2 });
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("NumPolizza", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "NumPolizza", "Numero di polizza") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 2 });
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DataDecorrenza", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DataDecorrenza", "Data decorrenza") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 2 });
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DataScadenza", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DataScadenza", "Data scadenza") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 2 });
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("PremioAnnuo", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "PremioAnnuo", "Premio annuo (€)") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 2 });
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("Periodicita", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "Periodicita", "Periodicità") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 2, PaddingLeft = 3 });
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("TotaleVersato", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "TotaleVersato", "Totale versato (€)") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 2 });
|
|
|
|
for (int c = 0; c < tabellaProdotti.Columns.Count; c++)
|
|
{
|
|
|
|
if (tabellaProdotti.Columns[c].Id.Equals("PremioAnnuo"))
|
|
tabellaProdotti.Cells[c, 0].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("TotaleVersato"))
|
|
tabellaProdotti.Cells[c, 0].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
|
|
}
|
|
|
|
|
|
AddElement(tabellaProdotti);
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
// var tabellaProdotti = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, dati.Tables["prodottiTCM"])
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
Footer = true,
|
|
AlternateRow = false,
|
|
ShowBorderLastLine = false,
|
|
HeaderHeight = 30,
|
|
HeaderMargin = 2
|
|
};
|
|
|
|
prodotti.Columns.Add("ContrattoProdotto", typeof(string));
|
|
prodotti.Columns.Add("NumPolizza", typeof(string)); 50
|
|
prodotti.Columns.Add("DataSott", typeof(string)); 50
|
|
prodotti.Columns.Add("DataScadenza", typeof(string));50
|
|
prodotti.Columns.Add("PremioAnnuo", typeof(string));70
|
|
prodotti.Columns.Add("TotaleVersato", typeof(string));70
|
|
prodotti.Columns.Add("Periodicita", typeof(string));50
|
|
prodotti.Columns.Add("FontBold", typeof(bool));
|
|
prodotti.Columns.Add("BackGroundColor", typeof(bool));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (getColonne().NomeProdotto)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("NomeProdotto", widthNomeProdotto, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "NomeProdotto", "Nome prodotto") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 2 });
|
|
if (getColonne().ContrattoDossier)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("ContrattoDossier", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "ContrattoDossier", "Contratto /<br>Dossier") { HeaderFontSize = headerFontSize });
|
|
if (getColonne().CodIsin)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("CodIsin", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "CodIsin", "Cod. ISIN") { HeaderFontSize = headerFontSize, PaddingLeft = 6, HeaderPaddingLeft = 3 });
|
|
if (getColonne().DistrCedoleDividendi)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DistrCedoleDividendi", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DistrCedoleDividendi", "Distr. cedole /<br>dividendi") { HeaderFontSize = headerFontSize, PaddingRight = 2 });
|
|
if (getColonne().RatingMorningstar)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RatingMorningstar", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RatingMorningstar", "Rating Morningstar Overall") { HeaderFontSize = headerFontSize, PaddingLeft = 6, HeaderPaddingLeft = 3 });
|
|
if (getColonne().NumqQuantValnom)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("NumqQuantValnom", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "NumqQuantValnom", "Num. Quote / Quant. / Val. nom.") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().QuotaPrezzoEuro)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("QuotaPrezzoEuro", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "QuotaPrezzoEuro", "Quota /<br>Prezzo Euro") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 15, HeaderPaddingRight = 10 });
|
|
if (getColonne().ControvaloreAttuale)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("ControvaloreAttuale", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "ControvaloreAttuale", "Controvalore attuale (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 15, HeaderPaddingRight = 15 });
|
|
if (getColonne().DataAgg)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DataAgg", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DataAgg", "Data agg.") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 10, PaddingRight = 2 });
|
|
if (getColonne().VersatoNettoSott)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("VersatoNettoSott", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "VersatoNettoSott", "Versato netto<br>da sott. (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().UtilePerditaSott)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("UtilePerditaSott", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "UtilePerditaSott", "Utile / Perdita<br>da sott. (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().RendAnnualSott)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RendAnnualSott", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RendAnnualSott", "Rend. da<br>sott. (%)*") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 6 });
|
|
if (getColonne().DataSott)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DataSott", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DataSott", "Data sott.") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 10, PaddingRight = 2 });
|
|
if (getColonne().VersatoNettoAssoc)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("VersatoNettoAssoc", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "VersatoNettoAssoc", "Versato netto<br>da assoc. (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().UtilPerditaAssoc)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("UtilPerditaAssoc", widthImporti, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "UtilPerditaAssoc", "Utile / Perdita<br>da assoc. (€)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10, HeaderPaddingRight = 5 });
|
|
if (getColonne().RendCumAssoc)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RendCumAssoc", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RendCumAssoc", "Rend. cum.<br>da assoc. (%)*") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 3 });
|
|
if (getColonne().DataAssoc)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("DataAssoc", widthData, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "DataAssoc", "Data assoc.") { HeaderFontSize = headerFontSize, HeaderPaddingLeft = 10, PaddingRight = 2 });
|
|
if (getColonne().RendInizioTrimestre)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RendInizioTrimestre", width60, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RendInizioTrimestre", "Rend. inizio<br>trimestre (%)*") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 3 });
|
|
if (getColonne().RendInizioAnno)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RendInizioAnno", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RendInizioAnno", "Rend. inizio<br>anno (%)*") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10 });
|
|
if (getColonne().VaR)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("VaR", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "VaR", "VaR (%)") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 15 });
|
|
if (getColonne().RischioCredito)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("RischioCredito", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "RischioCredito", "Rischio<br>Credito") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingLeft = 10 });
|
|
if (getColonne().Complessità)
|
|
tabellaProdotti.Columns.Add(new ColumnPDF("Complessità", widthPerc, HorizontalAlignmentType.Sinistra, false, false, fontsize, ColumnType.Testo, "Complessità", "Complessità") { HeaderFontSize = headerFontSize, PaddingRight = 2, HeaderPaddingRight = 2, HeaderPaddingLeft = 6 });
|
|
|
|
for (int h = 0; h < dati.Tables["prodotti"].Rows.Count; h++)
|
|
{
|
|
DataRow prodotto = dati.Tables["prodotti"].Rows[h];
|
|
if (!prodotto["CodArea"].Equals(""))
|
|
{
|
|
string codArea = prodotto["CodArea"].ToString();
|
|
tabellaProdotti.Cells[0, h].ColSpan = 2;
|
|
var listaOggetti = new List<ObjectPDF> {
|
|
new RectanglePDF(8,8, ColorPDF.GetBy_AreaBisogno(codArea)){DeltaY = 4.8F},
|
|
new FormattedTextAreaPDF
|
|
{
|
|
Text = codArea.Substring(0,1),
|
|
FontBold = true,
|
|
FontColor = ColorPDF.Bianco,
|
|
DeltaX = codArea.Substring(0,1).Equals("I")?2.3F:2.0F,
|
|
FontSize= 6,
|
|
DeltaY = 2.3F
|
|
},
|
|
new FormattedTextAreaPDF
|
|
{
|
|
Text = prodotto["Descrizione"].ToString(),
|
|
FontBold = Convert.ToBoolean(prodotto["FontBold"]),
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 14F,
|
|
FontSize= 6,
|
|
DeltaY = 2.2F
|
|
}
|
|
};
|
|
if ((prodotto["Descrizione"].ToString().Equals("GP ET - Liquidità") || prodotto["Descrizione"].ToString().Equals("GP EF- Liquidità")) && Convert.ToDecimal(prodotto["ControvaloreAttuale"]) < 0)
|
|
{
|
|
listaOggetti = new List<ObjectPDF>
|
|
{
|
|
new RectanglePDF(8, 8, ColorPDF.Bianco){DeltaY = 4.8F},
|
|
new FormattedTextAreaPDF
|
|
{
|
|
Text = "-",
|
|
FontBold = true,
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 2F,
|
|
FontSize = 6,
|
|
DeltaY = 2.3F
|
|
},
|
|
new FormattedTextAreaPDF
|
|
{
|
|
Text = prodotto["Descrizione"].ToString(),
|
|
FontBold = false,
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 14F,
|
|
FontSize=6,
|
|
DeltaY = 2.2F
|
|
}
|
|
};
|
|
}
|
|
tabellaProdotti.Cells[0, h].ValueObjectList.AddRange(listaOggetti);
|
|
tabellaProdotti.Cells[0, h].YContentOffset = 10;
|
|
|
|
}
|
|
else if (!prodotto["Descrizione"].Equals(""))
|
|
{
|
|
int lenght = prodotto["Descrizione"].ToString().Length < numeroCaratteri ? prodotto["Descrizione"].ToString().Length : numeroCaratteri;
|
|
int lastIndexOfSpace = prodotto["Descrizione"].ToString().Substring(0, lenght).LastIndexOf(' ');
|
|
string nomeProdotto = prodotto["Descrizione"].ToString().Length <= numeroCaratteri ? prodotto["Descrizione"].ToString() : prodotto["Descrizione"].ToString().Substring(0, lastIndexOfSpace) + "<BR>" + prodotto["Descrizione"].ToString().Substring(lastIndexOfSpace + 1);
|
|
tabellaProdotti.Cells[0, h].ColSpan = 2;
|
|
int lunghezza = widthNomeProdotto;
|
|
float iDeltaY = prodotto["Descrizione"].ToString().Length <= numeroCaratteri ? 2.5F : 0.3F;
|
|
tabellaProdotti.Cells[0, h].ValueObject = new FormattedTextAreaPDF
|
|
{
|
|
Text = nomeProdotto,
|
|
FontBold = Convert.ToBoolean(prodotto["FontBold"]),
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 14.0F,
|
|
FontSize = 6,
|
|
DeltaY = iDeltaY,
|
|
Width = widthNomeProdotto
|
|
};
|
|
}
|
|
else if (!prodotto["NomeProdotto"].Equals(""))
|
|
{
|
|
int lenght = prodotto["NomeProdotto"].ToString().Length < numeroCaratteri ? prodotto["NomeProdotto"].ToString().Length : numeroCaratteri;
|
|
int lastIndexOfSpace = prodotto["NomeProdotto"].ToString().Substring(0, lenght).LastIndexOf(' ');
|
|
string nomeProdotto = prodotto["NomeProdotto"].ToString().Length <= numeroCaratteri ? prodotto["NomeProdotto"].ToString() : prodotto["NomeProdotto"].ToString().Substring(0, lastIndexOfSpace) + "<BR>" + prodotto["NomeProdotto"].ToString().Substring(lastIndexOfSpace);
|
|
tabellaProdotti.Cells[0, h].ColSpan = 2;
|
|
int lunghezza = widthNomeProdotto;
|
|
float iDeltaY = prodotto["NomeProdotto"].ToString().Length <= numeroCaratteri ? 2.5F : 0.3F;
|
|
tabellaProdotti.Cells[0, h].ValueObject = new FormattedTextAreaPDF
|
|
{
|
|
Text = nomeProdotto,
|
|
FontBold = false,
|
|
FontColor = ColorPDF.Nero,
|
|
DeltaX = 14.0F,
|
|
FontSize = 6,
|
|
DeltaY = iDeltaY,
|
|
Width = widthNomeProdotto
|
|
};
|
|
|
|
|
|
}
|
|
|
|
for (int c = 0; c < tabellaProdotti.Columns.Count; c++)
|
|
{
|
|
if (Convert.ToBoolean(prodotto["BackGroundColor"]))
|
|
tabellaProdotti.Cells[c, h].BackgroundColor = ColorPDF.ConsulenzaUnica_Grigio_SfondoColonnaHeaderFooterTabella;
|
|
|
|
if (Convert.ToBoolean(prodotto["FontBold"]))
|
|
tabellaProdotti.Cells[c, h].FontBold = true;
|
|
|
|
if (tabellaProdotti.Columns[c].Id.Equals("Immagine"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
//if (tabellaProdotti.Columns[c].Id.Equals("Area"))
|
|
// tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("ContrattoDossier"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("NomeProdotto"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("CodIsin"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("DistrCedoleDividendi"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RatingMorningstar"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Sinistra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("NumqQuantValnom"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("QuotaPrezzoEuro"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("ControvaloreAttuale"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("DataAgg"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("VersatoNettoSott"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("UtilePerditaSott"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RendAnnualSott"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("DataSott"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("VersatoNettoAssoc"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("UtilPerditaAssoc"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RendCumAssoc"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("DataAssoc"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RendInizioTrimestre"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RendInizioAnno"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("VaR"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("RischioCredito"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
if (tabellaProdotti.Columns[c].Id.Equals("Complessità"))
|
|
tabellaProdotti.Cells[c, h].HorizontalAlignment = Business.OBJ_PDF.HorizontalAlignmentType.Destra;
|
|
|
|
}
|
|
}
|
|
if (getNote3().Length > 0)
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNote3(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
|
|
if (getNote1().Length > 0)
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNote1(),
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6 });
|
|
|
|
if (getNote2().Length > 0)
|
|
tabellaProdotti.Notes.Add(
|
|
new TableNotePDF(TableNotePDF.TableNotePositionType.PièDiTabella,
|
|
getNote2(),
|
|
new[] { "" },
|
|
new[] { "" },
|
|
string.Empty,
|
|
TableNotePDF.TableNoteAsteriskPositionType.PieDiTabella)
|
|
{ FontSize = 6 });
|
|
*/
|
|
|
|
}
|
|
|
|
private int calculateWidth()
|
|
{
|
|
int tot = 0;
|
|
//if (getColonne().Area)
|
|
// tot += widthImporti;
|
|
if (getColonne().ContrattoDossier)
|
|
tot += widthData;
|
|
if (getColonne().CodIsin)
|
|
tot += width60;
|
|
if (getColonne().DistrCedoleDividendi)
|
|
tot += width60;
|
|
if (getColonne().RatingMorningstar)
|
|
tot += widthData;
|
|
if (getColonne().NumqQuantValnom)
|
|
tot += widthImporti;
|
|
if (getColonne().QuotaPrezzoEuro)
|
|
tot += widthImporti;
|
|
if (getColonne().ControvaloreAttuale)
|
|
tot += widthImporti;
|
|
if (getColonne().DataAgg)
|
|
tot += widthData;
|
|
if (getColonne().VersatoNettoSott)
|
|
tot += widthImporti;
|
|
if (getColonne().UtilePerditaSott)
|
|
tot += widthImporti;
|
|
if (getColonne().RendAnnualSott)
|
|
tot += widthPerc;
|
|
if (getColonne().DataSott)
|
|
tot += widthData;
|
|
if (getColonne().VersatoNettoAssoc)
|
|
tot += widthImporti;
|
|
if (getColonne().UtilPerditaAssoc)
|
|
tot += widthImporti;
|
|
if (getColonne().RendCumAssoc)
|
|
tot += width60;
|
|
if (getColonne().DataAssoc)
|
|
tot += widthData;
|
|
if (getColonne().RendInizioTrimestre)
|
|
tot += width60;
|
|
if (getColonne().RendInizioAnno)
|
|
tot += widthPerc;
|
|
if (getColonne().VaR)
|
|
tot += widthPerc;
|
|
if (getColonne().RischioCredito)
|
|
tot += widthPerc;
|
|
if (getColonne().Complessità)
|
|
tot += widthPerc;
|
|
if (getColonne().ValoriDiCarico)
|
|
tot += widthImporti;
|
|
if (getColonne().UtilePerditaCaricoEuro)
|
|
tot += widthImporti;
|
|
if (getColonne().UtilePerditaCaricoPerc)
|
|
tot += widthImporti;
|
|
return tot;
|
|
|
|
}
|
|
|
|
protected sealed override DataTable GetDataTable()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
|
|
protected sealed override DataSet GetDataSet()
|
|
{
|
|
var ds = new DataSet();
|
|
ds.Tables.Add("prodotti");
|
|
|
|
ds.Tables["prodotti"].Columns.Add("CodArea", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("Descrizione", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("FontBold", typeof(bool));
|
|
ds.Tables["prodotti"].Columns.Add("BackGroundColor", typeof(bool));
|
|
ds.Tables["prodotti"].Columns.Add("Area", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("ContrattoDossier", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("NomeProdotto", typeof(string));
|
|
// Modifica per Saving Map
|
|
ds.Tables["prodotti"].Columns.Add("SavingMap", typeof(string));
|
|
// Fine Modifica
|
|
|
|
ds.Tables["prodotti"].Columns.Add("CodIsin", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("DistrCedoleDividendi", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("FreqCedoleDividendi", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("RatingMorningstar", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("NumqQuantValnom", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("QuotaPrezzoEuro", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("ControvaloreAttuale", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("DataAgg", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("VersatoNettoSott", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("UtilePerditaSott", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("RendAnnualSott", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("DataSott", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("VersatoNettoAssoc", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("UtilPerditaAssoc", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("RendCumAssoc", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("DataAssoc", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("RendInizioTrimestre", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("RendInizioAnno", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("VaR", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("RischioCredito", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("Complessità", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("ValoriDiCarico", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("UtilePerditaCaricoEuro", typeof(string));
|
|
ds.Tables["prodotti"].Columns.Add("UtilePerditaCaricoPerc", typeof(string));
|
|
|
|
rsDettaglioProdotti dettaglioProdotti1 = GetDettaglioProdotti();
|
|
var dettaglioProdotti = dettaglioProdotti1.dettaglioProdotti.ToList();
|
|
|
|
string[] notChAgg = { "PAT", "RA" };
|
|
foreach (rsAggregatoPosizioni rsA in dettaglioProdotti1.elencoAggregati.elencoCategoria)
|
|
{
|
|
if (rsA.descrizione.Equals("Gestioni Patrimoniali"))
|
|
gpPresent = true;
|
|
else if (rsA.descrizione.Equals("Fondi"))
|
|
fondiPresent = true;
|
|
else if (rsA.descrizione.Equals("Unit Linked"))
|
|
ulPresent = true;
|
|
else if (rsA.descrizione.Equals("Assicurativi Previdenziali"))
|
|
apPresent = true;
|
|
else if (rsA.descrizione.Equals("Titoli"))
|
|
titPresent = true;
|
|
}
|
|
switch (raggruppaProdotti())
|
|
{
|
|
case RaggruppaProdotti.AreaBisogno:
|
|
rsAggregatoPosizioni[] elencoAreeProgetti = dettaglioProdotti1.elencoAggregati.elencoAreeProgetti;
|
|
var areeDisplayInfos = datiSeiUnico.displayInfos().areeDisplayInfos;
|
|
List<rsAggregatoPosizioni> elencoAreeProgettiOrdinati = new List<DataServices.fideuram.data.service.rsAggregatoPosizioni>();
|
|
rsAggregatoPosizioni areeProgettoPreSecondaria = null;
|
|
rsAggregatoPosizioni areeProgettoPreEssenziale = null;
|
|
rsAggregatoPosizioni altro = null;
|
|
foreach (rsAggregatoPosizioni areeProgetti in from o in elencoAreeProgetti
|
|
join a in areeDisplayInfos on o.chiaveAggregazione.ToUpper() equals a.key.ToUpper()
|
|
where o.posizioniAggregate != null && !notChAgg.Contains(o.chiaveAggregazione)
|
|
orderby a.value.order ascending, o.ctvAttuale descending
|
|
select o)
|
|
{
|
|
if (areeProgetti.descrizione.ToLower().Equals("previdenza secondaria"))
|
|
{
|
|
altro = null;
|
|
areeProgettoPreSecondaria = areeProgetti;
|
|
}
|
|
else if (areeProgetti.descrizione.ToLower().Equals("previdenza essenziale"))
|
|
{
|
|
altro = null;
|
|
areeProgettoPreEssenziale = areeProgetti;
|
|
}
|
|
else
|
|
altro = areeProgetti;
|
|
if (altro == null && areeProgettoPreSecondaria != null && areeProgettoPreEssenziale != null)
|
|
{
|
|
elencoAreeProgettiOrdinati.Add(areeProgettoPreEssenziale);
|
|
elencoAreeProgettiOrdinati.Add(areeProgettoPreSecondaria);
|
|
areeProgettoPreSecondaria = null;
|
|
areeProgettoPreEssenziale = null;
|
|
}
|
|
else if (altro != null)
|
|
{
|
|
if (areeProgettoPreSecondaria != null)
|
|
{
|
|
elencoAreeProgettiOrdinati.Add(areeProgettoPreSecondaria);
|
|
areeProgettoPreSecondaria = null;
|
|
}
|
|
if (areeProgettoPreEssenziale != null)
|
|
{
|
|
elencoAreeProgettiOrdinati.Add(areeProgettoPreEssenziale);
|
|
areeProgettoPreEssenziale = null;
|
|
}
|
|
elencoAreeProgettiOrdinati.Add(areeProgetti);
|
|
}
|
|
}
|
|
if (areeProgettoPreSecondaria != null)
|
|
{
|
|
elencoAreeProgettiOrdinati.Add(areeProgettoPreSecondaria);
|
|
areeProgettoPreSecondaria = null;
|
|
}
|
|
if (areeProgettoPreEssenziale != null)
|
|
{
|
|
elencoAreeProgettiOrdinati.Add(areeProgettoPreEssenziale);
|
|
areeProgettoPreEssenziale = null;
|
|
}
|
|
foreach (rsAggregatoPosizioni areeProgetti in elencoAreeProgettiOrdinati)
|
|
{
|
|
string codArea = areeProgetti.chiaveAggregazione;
|
|
if (areeProgetti.chiaveProgettoLinea == null)
|
|
{
|
|
ElencoProdotti(ds.Tables["prodotti"], areeProgetti, codArea, areeProgetti.descrizione);
|
|
if (codArea.Equals("Inv") || codArea.Equals("Pre"))
|
|
continue;
|
|
}
|
|
if (codArea.Equals("Inv") || codArea.Equals("Pre"))
|
|
ElencoProdotti(ds.Tables["prodotti"], areeProgetti, "", areeProgetti.descrizione);
|
|
foreach (rsPosizione dettaglioProdotto in from a in areeProgetti.posizioniAggregate
|
|
join d in dettaglioProdotti on a.chiaveAggregazione
|
|
equals d.chiavePosizionePortafoglio
|
|
orderby d.ctv descending
|
|
select d)
|
|
{
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("FO"))
|
|
gpFoglioPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("XY"))
|
|
gpOmniaPresent = true;
|
|
if (dettaglioProdotto.prodotto.codSottoprodotto.Equals("L191"))
|
|
gpEligoFondPresent = true;
|
|
if (dettaglioProdotto.prodotto.codSottoprodotto.Equals("L192"))
|
|
gpEligoTitPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("US") || dettaglioProdotto.prodotto.codInterno.Equals("WS"))
|
|
fondiEurizonPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("MK"))
|
|
mcGestioniSgrPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("80"))
|
|
fidProgettoPensionePresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("PP"))
|
|
evProgettoPensionePresent = true;
|
|
if (dettaglioProdotto.custodiaGaranzia != null && dettaglioProdotto.custodiaGaranzia.Equals("2"))
|
|
fondiAGaranziaPresent = true;
|
|
|
|
|
|
ElencoProdotti(ds.Tables["prodotti"], dettaglioProdotto, "", "");
|
|
}
|
|
}
|
|
TotaleRisorseAllocate(ds.Tables["prodotti"], elencoAreeProgetti);
|
|
isAreeDiBisogno = true;
|
|
break;
|
|
case RaggruppaProdotti.Categoria:
|
|
var elencoCategoria = dettaglioProdotti1.elencoAggregati.elencoCategoria;
|
|
rsAggregatoPosizioni[] elencoAP = dettaglioProdotti1.elencoAggregati.elencoCategoria;
|
|
rsAggregatoPosizioni[] elencoAPAree = dettaglioProdotti1.elencoAggregati.elencoAreeProgetti;
|
|
|
|
var catDisplayInfos = datiSeiUnico.displayInfos().categoriaDisplayInfos;
|
|
foreach (rsAggregatoPosizioni Categoria in from o in elencoCategoria
|
|
join a in catDisplayInfos on o.chiaveAggregazione.ToUpper() equals a.key.ToUpper()
|
|
where o.posizioniAggregate != null && !notChAgg.Contains(o.chiaveAggregazione)
|
|
orderby a.value.order ascending
|
|
select o)
|
|
{
|
|
if (Categoria.chiaveAggregazione == "CONTICORRENTI" && Categoria.ctvAttuale < 0 && datiSeiUnico.CASA_CC == 0)//i cc negativi sono considerati dopo
|
|
continue;
|
|
if (Categoria.chiaveAggregazione == "CONTICORRENTI" && Categoria.ctvAttuale < 0)
|
|
ElencoProdotti(ds.Tables["prodotti"], Categoria, "", Categoria.descrizione)["ControvaloreAttuale"] = Helper.FormatCurrency((datiSeiUnico.CASA_CC).ToString());
|
|
else
|
|
ElencoProdotti(ds.Tables["prodotti"], Categoria, "", Categoria.descrizione);
|
|
foreach (rsPosizione dettaglioProdotto in from a in Categoria.posizioniAggregate
|
|
join d in dettaglioProdotti on a.chiaveAggregazione equals d.chiavePosizionePortafoglio
|
|
orderby d.ctv descending
|
|
select d)
|
|
{
|
|
if (dettaglioProdotto.area == "Cc" && dettaglioProdotto.ctv < 0)//i cc negativi sono considerati dopo
|
|
continue;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("FO"))
|
|
gpFoglioPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("XY"))
|
|
gpOmniaPresent = true;
|
|
if (dettaglioProdotto.prodotto.codSottoprodotto.Equals("L191"))
|
|
gpEligoFondPresent = true;
|
|
if (dettaglioProdotto.prodotto.codSottoprodotto.Equals("L192"))
|
|
gpEligoTitPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("US") || dettaglioProdotto.prodotto.codInterno.Equals("WS"))
|
|
fondiEurizonPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("MK"))
|
|
mcGestioniSgrPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("80"))
|
|
fidProgettoPensionePresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("PP"))
|
|
evProgettoPensionePresent = true;
|
|
if (dettaglioProdotto.custodiaGaranzia != null && dettaglioProdotto.custodiaGaranzia.Equals("2"))
|
|
fondiAGaranziaPresent = true;
|
|
|
|
ElencoProdotti(ds.Tables["prodotti"], dettaglioProdotto, getColonne().Area ? dettaglioProdotto.area : "", getColonne().Area ? dettaglioProdotto.prodotto.nomeProdotto : "");
|
|
}
|
|
}
|
|
TotaleRisorseFinanziarieCategorie(ds.Tables["prodotti"], elencoAP, elencoAPAree);
|
|
isCategorieProdotto = true;
|
|
break;
|
|
case RaggruppaProdotti.Contratto:
|
|
var elencoContrattiLinea = dettaglioProdotti1.elencoAggregati.elencoContrattiLinea;
|
|
var listaContrattiLinee = (from o in elencoContrattiLinea
|
|
where o.posizioniAggregate != null && !notChAgg.Contains(o.chiaveAggregazione)
|
|
select o).ToList();
|
|
var listaContratti = (from o in listaContrattiLinee where o.chiaveProgettoLinea == null orderby o.ctvAttuale descending select o).ToList();
|
|
var listaLinee = (from o in listaContrattiLinee where o.chiaveProgettoLinea != null orderby o.ctvAttuale descending select o).ToList();
|
|
|
|
rsAggregatoPosizioni[] elencoAPr = dettaglioProdotti1.elencoAggregati.elencoContrattiLinea;
|
|
rsAggregatoPosizioni[] elencoAPrAree = dettaglioProdotti1.elencoAggregati.elencoAreeProgetti;
|
|
|
|
foreach (rsAggregatoPosizioni Contratto in listaContratti)
|
|
{
|
|
bool rowContratto = false;
|
|
var listaPosizioni = new List<rsPosizione>();
|
|
if (PRODUCT_TYPE_CASA.Equals(productsTypeSelected)) {
|
|
listaPosizioni = (from a in Contratto.posizioniAggregate
|
|
join d in dettaglioProdotti on a.chiaveAggregazione equals d.chiavePosizionePortafoglio
|
|
where !(a.flagLinea) && !d.area.ToLower().Equals("cc") && d.ctv >= 0
|
|
orderby d.ctv descending
|
|
select d).ToList();
|
|
}
|
|
else
|
|
{
|
|
listaPosizioni = (from a in Contratto.posizioniAggregate
|
|
join d in dettaglioProdotti on a.chiaveAggregazione equals d.chiavePosizionePortafoglio
|
|
where !(a.flagLinea)
|
|
orderby d.ctv descending
|
|
select d).ToList();
|
|
}
|
|
|
|
|
|
foreach (rsPosizione dettaglioProdotto in listaPosizioni)
|
|
{
|
|
if (!rowContratto)
|
|
{
|
|
ElencoProdotti(ds.Tables["prodotti"], Contratto, "", Contratto.descrizione);
|
|
rowContratto = true;
|
|
}
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("FO"))
|
|
gpFoglioPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("XY"))
|
|
gpOmniaPresent = true;
|
|
if (dettaglioProdotto.prodotto.codSottoprodotto.Equals("L191"))
|
|
gpEligoFondPresent = true;
|
|
if (dettaglioProdotto.prodotto.codSottoprodotto.Equals("L192"))
|
|
gpEligoTitPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("US") || dettaglioProdotto.prodotto.codInterno.Equals("WS"))
|
|
fondiEurizonPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("MK"))
|
|
mcGestioniSgrPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("80"))
|
|
fidProgettoPensionePresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("PP"))
|
|
evProgettoPensionePresent = true;
|
|
if (dettaglioProdotto.custodiaGaranzia != null && dettaglioProdotto.custodiaGaranzia.Equals("2"))
|
|
fondiAGaranziaPresent = true;
|
|
|
|
ElencoProdotti(ds.Tables["prodotti"], dettaglioProdotto, getColonne().Area ? dettaglioProdotto.area : "", getColonne().Area ? dettaglioProdotto.prodotto.nomeProdotto : "");
|
|
}
|
|
|
|
foreach (rsAggregatoPosizioni Linea in listaLinee)
|
|
{
|
|
if (Linea.chiaveAggregazione.Equals(Contratto.chiaveAggregazione))
|
|
{
|
|
if (!rowContratto)
|
|
{
|
|
ElencoProdotti(ds.Tables["prodotti"], Contratto, "", Contratto.descrizione);
|
|
rowContratto = true;
|
|
}
|
|
ElencoProdotti(ds.Tables["prodotti"], Linea, "", Linea.descrizione);
|
|
|
|
foreach (rsPosizione dettaglioProdotto in from a in Linea.posizioniAggregate
|
|
join d in dettaglioProdotti on a.chiaveAggregazione equals d.chiavePosizionePortafoglio
|
|
where (a.flagLinea)
|
|
orderby d.ctv descending
|
|
select d)
|
|
{
|
|
if (dettaglioProdotto.area == "Cc" && dettaglioProdotto.ctv < 0)//i cc negativi sono considerati dopo
|
|
continue;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("FO"))
|
|
gpFoglioPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("XY"))
|
|
gpOmniaPresent = true;
|
|
if (dettaglioProdotto.prodotto.codSottoprodotto.Equals("L191"))
|
|
gpEligoFondPresent = true;
|
|
if (dettaglioProdotto.prodotto.codSottoprodotto.Equals("L192"))
|
|
gpEligoTitPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("US") || dettaglioProdotto.prodotto.codInterno.Equals("WS"))
|
|
fondiEurizonPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("MK"))
|
|
mcGestioniSgrPresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("80"))
|
|
fidProgettoPensionePresent = true;
|
|
if (dettaglioProdotto.prodotto.codInterno.Equals("PP"))
|
|
evProgettoPensionePresent = true;
|
|
if (dettaglioProdotto.custodiaGaranzia != null && dettaglioProdotto.custodiaGaranzia.Equals("2"))
|
|
fondiAGaranziaPresent = true;
|
|
|
|
ElencoProdotti(ds.Tables["prodotti"], dettaglioProdotto, getColonne().Area ? dettaglioProdotto.area : "", getColonne().Area ? dettaglioProdotto.prodotto.nomeProdotto : "");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (PRODUCT_TYPE_CASA.Equals(productsTypeSelected))
|
|
{
|
|
TotaleRisorseFinanziarieContratti(ds.Tables["prodotti"], elencoAPr, elencoAPrAree);
|
|
} else
|
|
{
|
|
TotalePosizioniCointestate(ds.Tables["prodotti"], elencoAPr);
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
}
|
|
return ds;
|
|
|
|
}
|
|
|
|
protected DataSet GetDataSetTCM()
|
|
{
|
|
var ds = new DataSet();
|
|
ds.Tables.Add("prodottiTCM");
|
|
var prodotti = ds.Tables["prodottiTCM"];
|
|
prodotti.Columns.Add("Prodotto", typeof(string));
|
|
prodotti.Columns.Add("NumPolizza", typeof(string));
|
|
prodotti.Columns.Add("DataDecorrenza", typeof(string));
|
|
prodotti.Columns.Add("DataScadenza", typeof(string));
|
|
prodotti.Columns.Add("PremioAnnuo", typeof(string));
|
|
prodotti.Columns.Add("Periodicita", typeof(string));
|
|
prodotti.Columns.Add("TotaleVersato", typeof(string));
|
|
prodotti.Columns.Add("Contratto", typeof(string));
|
|
|
|
|
|
var dettaglioProdotti = datiSeiUnico.patrimonioUnit().patrimonioCasa.dettaglioProdottiTCM.ToList();
|
|
var visualizzazione = visualizzazioneScelta();
|
|
foreach (rsAssicurativoDanniTCM rsTCM in dettaglioProdotti)
|
|
{
|
|
if((visualizzazione.Equals(VisualizzazioneProdotti.PosizioniAttive) || visualizzazione.Equals(VisualizzazioneProdotti.PosizioniLiquidate)) && rsTCM.statoContratto.Equals("L"))
|
|
{
|
|
break;
|
|
}
|
|
DataRow dr1 = prodotti.NewRow();
|
|
dr1["Contratto"] = rsTCM.codiceContratto;
|
|
dr1["Prodotto"] = rsTCM.nome;
|
|
dr1["NumPolizza"] = rsTCM.numeroPolizza;
|
|
dr1["DataDecorrenza"] = rsTCM.dataDecorrenzaSpecified ? Convert.ToDateTime(rsTCM.dataDecorrenza).ToShortDateString() : "-";
|
|
dr1["DataScadenza"] = rsTCM.dataScadenzaSpecified ? Convert.ToDateTime(rsTCM.dataScadenza).ToShortDateString() : "-";
|
|
dr1["PremioAnnuo"] = Helper.FormatCurrency(rsTCM.premioAnnuo.ToString());
|
|
dr1["Periodicita"] = rsTCM.periodicita != string.Empty && rsTCM.periodicita!=null ? rsTCM.periodicita : "-";
|
|
dr1["TotaleVersato"] = Helper.FormatCurrency(rsTCM.totaleVersato.ToString());
|
|
|
|
|
|
prodotti.Rows.Add(dr1);
|
|
}
|
|
|
|
|
|
return ds;
|
|
|
|
}
|
|
|
|
private rsDettaglioProdotti GetDettaglioProdotti()
|
|
{
|
|
switch (productsTypeSelected)
|
|
{
|
|
case PRODUCT_TYPE_CASA:
|
|
return datiSeiUnico.patrimonioUnit().patrimonioCasa.dettaglioProdotti;
|
|
case PRODUCT_TYPE_COINTESTATI:
|
|
return datiSeiUnico.patrimonioUnit().patrimonioCasa.dettaglioProdottiCointestati;
|
|
default:
|
|
return datiSeiUnico.patrimonioUnit().patrimonioCasa.dettaglioProdotti;
|
|
}
|
|
}
|
|
|
|
private DataRow ElencoProdotti(DataTable prodotti, rsAggregatoPosizioni areaProgetti, string codArea, string descrizione, bool fontBold = true, bool backGroundColor = true)
|
|
{
|
|
|
|
DataRow dr = prodotti.NewRow();
|
|
dr["CodArea"] = codArea;
|
|
dr["Descrizione"] = descrizione;
|
|
dr["FontBold"] = fontBold;
|
|
dr["BackGroundColor"] = backGroundColor;
|
|
dr["RendInizioTrimestre"] = "n.c.";
|
|
dr["RendInizioAnno"] = "n.c.";
|
|
dr["RendAnnualSott"] = "n.c.";
|
|
dr["RendCumAssoc"] = "n.c.";
|
|
dr["VersatoNettoSott"] = "n.c.";
|
|
dr["UtilePerditaSott"] = "n.c.";
|
|
if (areaProgetti != null)
|
|
{
|
|
dr["Area"] = areaProgetti.chiaveAggregazione;
|
|
dr["ContrattoDossier"] = "";
|
|
dr["NomeProdotto"] = "";
|
|
dr["CodIsin"] = "";
|
|
dr["DistrCedoleDividendi"] = "";
|
|
dr["RatingMorningstar"] = "";
|
|
dr["NumqQuantValnom"] = "-";// areaProgetti.quantitaNominale;
|
|
dr["QuotaPrezzoEuro"] = "-";//areaProgetti.prezzoEuro;
|
|
dr["ControvaloreAttuale"] = Helper.FormatCurrency(areaProgetti.ctvAttuale.ToString());
|
|
dr["DataAgg"] = "";
|
|
dr["VersatoNettoSott"] = areaProgetti.versatoNettoSottoscrizioneSpecified ? Helper.FormatCurrency(areaProgetti.versatoNettoSottoscrizione.ToString()) : "n.c.";
|
|
dr["UtilePerditaSott"] = areaProgetti.utilePerditaSottoscrizioneSpecified ? Helper.FormatCurrency(areaProgetti.utilePerditaSottoscrizione.ToString()) : "n.c.";
|
|
dr["DataSott"] = "";
|
|
dr["VersatoNettoAssoc"] = areaProgetti.versatoNettoAssociazioneSpecified ? Helper.FormatCurrency(areaProgetti.versatoNettoAssociazione.ToString()) : "n.c.";
|
|
dr["UtilPerditaAssoc"] = areaProgetti.utilePerditaAssociazioneSpecified ? Helper.FormatCurrency(areaProgetti.utilePerditaAssociazione.ToString()) : "n.c.";
|
|
dr["RendCumAssoc"] = areaProgetti.rendimentoAssociazioneSpecified ? Helper.FormatDecimal(areaProgetti.rendimentoAssociazione.ToString(), 2) : "n.c.";
|
|
dr["DataAssoc"] = "";
|
|
dr["RendInizioTrimestre"] = areaProgetti.rendimentoInizioTrimestreSpecified ? areaProgetti.rendimentoInizioTrimestre.ToString() : "n.c.";
|
|
dr["RendInizioAnno"] = areaProgetti.rendimentoInizioAnnoSpecified ? areaProgetti.rendimentoInizioAnno.ToString() : "n.c.";
|
|
dr["RendAnnualSott"] = areaProgetti.rendimentoDaSottoscrizioneSpecified ? !Helper.FormatDecimal(areaProgetti.rendimentoDaSottoscrizione.ToString(), 2).Equals("0,00") ? Helper.FormatDecimal(areaProgetti.rendimentoDaSottoscrizione.ToString(), 2) : "n.c." : "n.c.";
|
|
dr["VaR"] = areaProgetti.prometeiaInfos.varDecodificato;
|
|
dr["RischioCredito"] = "-";
|
|
dr["Complessità"] = "-";
|
|
dr["ValoriDiCarico"] = "-";
|
|
dr["UtilePerditaCaricoEuro"] = "-";
|
|
dr["UtilePerditaCaricoPerc"] = "-";
|
|
}
|
|
prodotti.Rows.Add(dr);
|
|
|
|
|
|
return dr;
|
|
}
|
|
|
|
private DataRow ElencoProdotti(DataTable prodotti, rsPosizione dettaglioProdotto, string codArea, string descrizione, bool fontBold = false, bool backGroundColor = false)
|
|
{
|
|
if (dettaglioProdotto.area.Equals("Self") && (dettaglioProdotto.prodotto.codSottoprodotto.Equals("L191") || dettaglioProdotto.prodotto.codSottoprodotto.Equals("L192")))
|
|
return ElencoEligoNegativi(prodotti, dettaglioProdotto, codArea, descrizione);
|
|
|
|
//AC
|
|
if (dettaglioProdotto.area.Equals("Self") && (dettaglioProdotto.prodotto.codSottoprodotto.Equals("V301")))
|
|
return ElencoFogliNegativi(prodotti, dettaglioProdotto, codArea, descrizione);
|
|
//--AC
|
|
|
|
var rendAnnualSott = dettaglioProdotto.rendimentoDaSottoscrizioneSpecified && !Helper.FormatDecimal(dettaglioProdotto.rendimentoDaSottoscrizione.ToString(), 2).Equals("0,00") ? dettaglioProdotto.rendimentoDaSottoscrizione.ToString().Replace(".", ",") : "n.c.";
|
|
DataRow dr = prodotti.NewRow();
|
|
dr["CodArea"] = codArea;
|
|
dr["Descrizione"] = descrizione;
|
|
dr["FontBold"] = fontBold;
|
|
dr["BackGroundColor"] = backGroundColor;
|
|
if (dettaglioProdotto != null)
|
|
{
|
|
dr["Area"] = dettaglioProdotto.area;
|
|
dr["ContrattoDossier"] = dettaglioProdotto.codContratto;
|
|
dr["NomeProdotto"] = dettaglioProdotto.prodotto.nomeProdotto;
|
|
|
|
// Modifica per Saving Map
|
|
if (dettaglioProdotto.prodotto.savingMap)
|
|
//if (dettaglioProdotto.prodotto.nomeProdotto.Substring(0, 2).ToUpper() =="FV")
|
|
dr["SavingMap"] = "SavingMap.png";
|
|
else
|
|
dr["SavingMap"] = "";
|
|
// Fine Modifica
|
|
|
|
dr["CodIsin"] = dettaglioProdotto.prodotto.codIsinFE;
|
|
dr["DistrCedoleDividendi"] = dettaglioProdotto.prodotto.distrCedoleDividendi.Contains("Frequenza") ? dettaglioProdotto.prodotto.distrCedoleDividendi.Replace("Frequenza", "<br>Freq.") : dettaglioProdotto.prodotto.distrCedoleDividendi;
|
|
dr["RatingMorningstar"] = dettaglioProdotto.prodotto.ratingMorningstar > 0 ? getStar(dettaglioProdotto.prodotto.ratingMorningstar) : "-";
|
|
dr["NumqQuantValnom"] = dettaglioProdotto.quantitaNominaleSpecified ? Helper.FormatCurrency(dettaglioProdotto.quantitaNominale.ToString()) : "-";
|
|
dr["QuotaPrezzoEuro"] = dettaglioProdotto.prodotto.prezzoEuroSpecified ? Helper.FormatCurrency(dettaglioProdotto.prodotto.prezzoEuro.ToString()) : "-";
|
|
dr["ControvaloreAttuale"] = Helper.FormatCurrency(dettaglioProdotto.ctv.ToString());
|
|
dr["DataAgg"] = dettaglioProdotto.dtRiferimentoSpecified ? Convert.ToDateTime(dettaglioProdotto.dtRiferimento).ToShortDateString() : "-";
|
|
dr["VersatoNettoSott"] = dettaglioProdotto.versamentoNettoSpecified ? Helper.FormatCurrency(dettaglioProdotto.versamentoNetto.ToString()) : "n.c.";
|
|
dr["UtilePerditaSott"] = dettaglioProdotto.utilePerditaSpecified ? Helper.FormatCurrency(dettaglioProdotto.utilePerdita.ToString()) : "n.c.";
|
|
dr["RendAnnualSott"] = rendAnnualSott != "n.c." ? Helper.FormatCurrency(rendAnnualSott.ToString()) : rendAnnualSott;
|
|
dr["DataSott"] = dettaglioProdotto.dtInizioRendimentoSpecified ? Convert.ToDateTime(dettaglioProdotto.dtInizioRendimento).ToShortDateString() : dettaglioProdotto.dtSottoscrizioneSpecified ? Convert.ToDateTime(dettaglioProdotto.dtSottoscrizione).ToShortDateString() : "-";
|
|
dr["VersatoNettoAssoc"] = dettaglioProdotto.versatoNettoAssociazioneSpecified && !dettaglioProdotto.prodotto.tipoProdotto.Equals("CC") ? Helper.FormatCurrency(dettaglioProdotto.versatoNettoAssociazione.ToString()) : "n.c.";
|
|
dr["UtilPerditaAssoc"] = dettaglioProdotto.utilePerditaAssociazioneSpecified && !dettaglioProdotto.prodotto.tipoProdotto.Equals("CC") ? Helper.FormatCurrency(dettaglioProdotto.utilePerditaAssociazione.ToString()) : "n.c.";
|
|
dr["RendCumAssoc"] = dettaglioProdotto.rendimentoAssociazioneSpecified && !dettaglioProdotto.prodotto.tipoProdotto.Equals("CC") ? Helper.FormatDecimal(dettaglioProdotto.rendimentoAssociazione.ToString(), 2) : "n.c.";
|
|
dr["DataAssoc"] = dettaglioProdotto.dataAssociazioneMonitoraggioSpecified ? Convert.ToDateTime(dettaglioProdotto.dataAssociazioneMonitoraggio).ToShortDateString() : "-";
|
|
dr["RendInizioTrimestre"] = dettaglioProdotto.rendimentoInizioTrimestreSpecified ? dettaglioProdotto.rendimentoInizioTrimestre.ToString() : "n.c.";
|
|
dr["RendInizioAnno"] = dettaglioProdotto.rendimentoInizioAnnoSpecified ? dettaglioProdotto.rendimentoInizioAnno.ToString() : "n.c.";
|
|
dr["VaR"] = dettaglioProdotto.prodotto.varDecodificato;
|
|
dr["RischioCredito"] = dettaglioProdotto.prodotto.rischioCreditoDecodificato;
|
|
dr["Complessità"] = dettaglioProdotto.prodotto.complessitaDec;
|
|
dr["ValoriDiCarico"] = dettaglioProdotto.costoMedioPonderatoFiscaleSpecified ? Helper.FormatCurrency(dettaglioProdotto.costoMedioPonderatoFiscale.ToString()) : "-";
|
|
dr["UtilePerditaCaricoEuro"] = dettaglioProdotto.utilePerditaDiCaricoSpecified ? Helper.FormatCurrency(dettaglioProdotto.utilePerditaDiCarico.ToString()) : "-";
|
|
dr["UtilePerditaCaricoPerc"] = dettaglioProdotto.utilePerditaDiCaricoPercentualeSpecified ? Helper.FormatCurrency(dettaglioProdotto.utilePerditaDiCaricoPercentuale.ToString()) : "-";
|
|
}
|
|
prodotti.Rows.Add(dr);
|
|
return dr;
|
|
}
|
|
|
|
private string getAsterischiForValoriDiCarico()
|
|
{
|
|
int nota1 = getNote1().Length > 0 ? 1 : 0;
|
|
int nota2 = getNote2().Length > 0 ? 1 : 0;
|
|
int nota3 = getNote3().Length > 0 ? 1 : 0;
|
|
int nota4 = 1 + nota1 + nota2 + nota3 ;
|
|
return getStar(nota4);
|
|
}
|
|
|
|
private string getAsterischiForUtilePerditaCaricoEuro()
|
|
{
|
|
int nota1 = getNote1().Length > 0 ? 1 : 0;
|
|
int nota2 = getNote2().Length > 0 ? 1 : 0;
|
|
int nota3 = getNote3().Length > 0 ? 1 : 0;
|
|
int nota4 = getNote4().Length > 0 ? 1 : 0;
|
|
int nota5 = 1 + nota1 + nota2 + nota3 + nota4;
|
|
return getStar(nota5);
|
|
}
|
|
|
|
private string getAsterischiForUtilePerditaCaricoPerc()
|
|
{
|
|
int nota1 = getNote1().Length > 0 ? 1 : 0;
|
|
int nota2 = getNote2().Length > 0 ? 1 : 0;
|
|
int nota3 = getNote3().Length > 0 ? 1 : 0;
|
|
int nota4 = getNote4().Length > 0 ? 1 : 0;
|
|
int nota5 = getNote5().Length > 0 ? 1 : 0;
|
|
int nota6 = 1 + nota1 + nota2 + nota3 + nota4 + nota5;
|
|
return getStar(nota6);
|
|
}
|
|
|
|
|
|
private string getStar(int ratingMorningstar)
|
|
{
|
|
string stars = "";
|
|
for (int i = 0; i < ratingMorningstar; i++)
|
|
stars += "*";
|
|
return stars;
|
|
}
|
|
|
|
//AC
|
|
private void TotaleRisorseAllocate(DataTable prodotti, rsAggregatoPosizioni[] aggregatoPosizioni, bool fontBold = false, bool backGroundColor = false)
|
|
{
|
|
var dettaglioProdotti = GetDettaglioProdotti().dettaglioProdotti.ToList();
|
|
// var pianificazioneVerticale = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale;
|
|
|
|
decimal OC_CASA = datiSeiUnico.CASA_OC;
|
|
decimal CCN_CASA = datiSeiUnico.CASA_CCN;
|
|
decimal CASA_GPELIGO = datiSeiUnico.CASA_GPELIGO;
|
|
decimal CASA_FOGLIO = datiSeiUnico.CASA_TUOFOGLIO;
|
|
|
|
|
|
rsAggregatoPosizioni RA = (from o in aggregatoPosizioni
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("RA")
|
|
select o).LastOrDefault();
|
|
rsAggregatoPosizioni PAT = (from o in aggregatoPosizioni
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("PAT")
|
|
select o).FirstOrDefault();
|
|
string asteriscoVar = getNote3().Length > 0 && getNote1().Length > 0 ? "**" : getNote1().Length > 0 ? "*" : "";
|
|
if (CCN_CASA != 0 || OC_CASA != 0 || CASA_GPELIGO != 0 || CASA_FOGLIO != 0)
|
|
{
|
|
DataRow row = ElencoProdotti(prodotti, RA, "", "Totale risorse allocate");
|
|
row["ControvaloreAttuale"] = Helper.FormatCurrency(datiSeiUnico.CASA_SUBTOTALE.ToString());
|
|
string rischioFormattato = RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? RA.prometeiaInfos.rischioCreditoDecodificato.ToLower() : RA.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, RA.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + RA.prometeiaInfos.rischioCreditoDecodificato.Substring(RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
row["RischioCredito"] = rischioFormattato + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
|
|
row["VaR"] = row["VaR"] + asteriscoVar;
|
|
row["RendAnnualSott"] = RA.rendimentoDaSottoscrizioneSpecified ? RA.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
row["VersatoNettoAssoc"] = "n.c.";
|
|
row["UtilPerditaAssoc"] = "n.c.";
|
|
row["RendCumAssoc"] = "n.c.";
|
|
if (OC_CASA != 0)
|
|
{
|
|
rsAggregatoPosizioni pv = null;
|
|
ElencoProdottiOC(prodotti, "", "Operazioni in corso")["ControvaloreAttuale"] = Helper.FormatCurrency(OC_CASA.ToString());
|
|
}
|
|
foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Cc" && o.ctv < 0 orderby o.ctv select o)
|
|
{
|
|
ElencoCcNegativi(prodotti, dettaglioProdotto, "", "");
|
|
}
|
|
foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Self" && o.prodotto.codSottoprodotto.Equals("L191") orderby o.ctv select o)
|
|
{
|
|
ElencoEligoNegativi(prodotti, dettaglioProdotto, "", "");
|
|
}
|
|
foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Self" && o.prodotto.codSottoprodotto.Equals("L192") orderby o.ctv select o)
|
|
{
|
|
ElencoEligoNegativi(prodotti, dettaglioProdotto, "", "");
|
|
}
|
|
|
|
//AC
|
|
foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Self" && o.prodotto.codSottoprodotto.Equals("V301") orderby o.ctv select o)
|
|
{
|
|
ElencoFogliNegativi(prodotti, dettaglioProdotto, "", "");
|
|
}
|
|
//--AC
|
|
|
|
}
|
|
string rischioFormattatoPAT = PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower() : PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, PAT.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
|
|
DataRow row2 = ElencoProdotti(prodotti, PAT, "", datiSeiUnico.FormatBanca(labelPatrimonioTotale(productsTypeSelected)));
|
|
row2["ControvaloreAttuale"] = Helper.FormatCurrency(datiSeiUnico.CASA_TOTALE.ToString());
|
|
row2["RendAnnualSott"] = PAT.rendimentoDaSottoscrizioneSpecified ? PAT.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
row2["Complessità"] = PAT.complessitaDec;
|
|
row2["VersatoNettoAssoc"] = "n.c.";
|
|
row2["UtilPerditaAssoc"] = "n.c.";
|
|
row2["RendCumAssoc"] = "n.c.";
|
|
row2["RischioCredito"] = rischioFormattatoPAT + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
row2["VaR"] = row2["VaR"] + asteriscoVar;
|
|
}
|
|
|
|
private static string labelPatrimonioTotale(String typeSelected)
|
|
{
|
|
switch (typeSelected)
|
|
{
|
|
case PRODUCT_TYPE_CASA:
|
|
return "Patrimonio $/Banca/$";
|
|
case PRODUCT_TYPE_COINTESTATI:
|
|
return "Posizioni cointestate";
|
|
default:
|
|
return "Patrimonio $/Banca/$";
|
|
}
|
|
|
|
}
|
|
|
|
private void TotalePosizioniCointestate(DataTable prodotti, rsAggregatoPosizioni[] aggregatoPosizioni)
|
|
{
|
|
rsAggregatoPosizioni PAT = (from o in aggregatoPosizioni
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("PAT")
|
|
select o).FirstOrDefault();
|
|
string asteriscoVar = getNote3().Length > 0 && getNote1().Length > 0 ? "**" : getNote1().Length > 0 ? "*" : "";
|
|
string rischioFormattatoPAT = PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower() : PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, PAT.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
|
|
DataRow row2 = ElencoProdotti(prodotti, PAT, "", datiSeiUnico.FormatBanca(labelPatrimonioTotale(productsTypeSelected)));
|
|
row2["ControvaloreAttuale"] = Helper.FormatCurrency(PAT.ctvAttuale.ToString());
|
|
row2["Complessità"] = PAT.complessitaDec;
|
|
row2["RischioCredito"] = rischioFormattatoPAT + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
row2["VaR"] = row2["VaR"] + asteriscoVar;
|
|
row2["VersatoNettoSott"] = "";
|
|
row2["UtilePerditaSott"] = "";
|
|
row2["RendAnnualSott"] = "";
|
|
row2["CodIsin"] = "";
|
|
row2["RatingMorningstar"] = "";
|
|
row2["NumqQuantValnom"] = "";
|
|
row2["QuotaPrezzoEuro"] = "";
|
|
row2["VersatoNettoAssoc"] = "";
|
|
row2["UtilPerditaAssoc"] = "";
|
|
row2["RendCumAssoc"] = "";
|
|
row2["DataAssoc"] = "";
|
|
row2["RendInizioTrimestre"] = "";
|
|
row2["RendInizioAnno"] = "";
|
|
}
|
|
|
|
//private void TotaleRisorseAllocate(DataTable prodotti, rsAggregatoPosizioni[] aggregatoPosizioni, bool fontBold = false, bool backGroundColor = false)
|
|
//{
|
|
// var dettaglioProdotti = datiSeiUnico.patrimonioUnit().patrimonioCasa.dettaglioProdotti.dettaglioProdotti.ToList();
|
|
// var pianificazioneVerticale = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale;
|
|
|
|
// decimal OC_CASA = datiSeiUnico.CASA_OC;
|
|
// decimal CCN_CASA = datiSeiUnico.CASA_CCN;
|
|
// decimal CASA_GPELIGO = datiSeiUnico.CASA_GPELIGO;
|
|
|
|
|
|
// rsAggregatoPosizioni RA = (from o in aggregatoPosizioni
|
|
// where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("RA")
|
|
// select o).LastOrDefault();
|
|
// rsAggregatoPosizioni PAT = (from o in aggregatoPosizioni
|
|
// where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("PAT")
|
|
// select o).FirstOrDefault();
|
|
// string asteriscoVar = getNote3().Length > 0 && getNote1().Length > 0 ? "**" : getNote1().Length > 0 ? "*" : "";
|
|
// if (CCN_CASA != 0 || OC_CASA != 0 || CASA_GPELIGO != 0)
|
|
// {
|
|
// DataRow row = ElencoProdotti(prodotti, RA, "", "Totale risorse allocate");
|
|
// row["ControvaloreAttuale"] = Helper.FormatCurrency(datiSeiUnico.CASA_SUBTOTALE.ToString());
|
|
// string rischioFormattato = RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? RA.prometeiaInfos.rischioCreditoDecodificato.ToLower() : RA.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, RA.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + RA.prometeiaInfos.rischioCreditoDecodificato.Substring(RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
// row["RischioCredito"] = rischioFormattato + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
|
|
// row["VaR"] = row["VaR"] + asteriscoVar;
|
|
// row["RendAnnualSott"] = RA.rendimentoDaSottoscrizioneSpecified ? RA.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
// row["VersatoNettoAssoc"] = "n.c.";
|
|
// row["UtilPerditaAssoc"] = "n.c.";
|
|
// row["RendCumAssoc"] = "n.c.";
|
|
// if (OC_CASA != 0)
|
|
// {
|
|
// rsAggregatoPosizioni pv = null;
|
|
// ElencoProdottiOC(prodotti, "", "Operazioni in corso")["ControvaloreAttuale"] = Helper.FormatCurrency(OC_CASA.ToString());
|
|
// }
|
|
// foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Cc" && o.ctv < 0 orderby o.ctv select o)
|
|
// {
|
|
// ElencoCcNegativi(prodotti, dettaglioProdotto, "", "");
|
|
// }
|
|
// foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Self" && o.prodotto.codSottoprodotto.Equals("L191") orderby o.ctv select o)
|
|
// {
|
|
// ElencoEligoNegativi(prodotti, dettaglioProdotto, "", "");
|
|
// }
|
|
// foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Self" && o.prodotto.codSottoprodotto.Equals("L192") orderby o.ctv select o)
|
|
// {
|
|
// ElencoEligoNegativi(prodotti, dettaglioProdotto, "", "");
|
|
// }
|
|
|
|
// //AC
|
|
// foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Self" && o.prodotto.codSottoprodotto.Equals("V301") orderby o.ctv select o)
|
|
// {
|
|
// ElencoFogliNegativi(prodotti, dettaglioProdotto, "", "");
|
|
// }
|
|
// //--AC
|
|
|
|
// }
|
|
// string rischioFormattatoPAT = PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower() : PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, PAT.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
// DataRow row2 = ElencoProdotti(prodotti, PAT, "", datiSeiUnico.FormatBanca("Patrimonio $/Banca/$"));
|
|
// row2["ControvaloreAttuale"] = Helper.FormatCurrency(datiSeiUnico.CASA_TOTALE.ToString());
|
|
// row2["RendAnnualSott"] = PAT.rendimentoDaSottoscrizioneSpecified ? PAT.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
// row2["Complessità"] = PAT.complessitaDec;
|
|
// row2["VersatoNettoAssoc"] = "n.c.";
|
|
// row2["UtilPerditaAssoc"] = "n.c.";
|
|
// row2["RendCumAssoc"] = "n.c.";
|
|
// row2["RischioCredito"] = rischioFormattatoPAT + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
// row2["VaR"] = row2["VaR"] + asteriscoVar;
|
|
//}
|
|
|
|
//AC
|
|
private void TotaleRisorseFinanziarie(DataTable prodotti, rsAggregatoPosizioni[] aggregatoPosizioni, bool fontBold = false, bool backGroundColor = false)
|
|
{
|
|
var dettaglioProdotti = GetDettaglioProdotti().dettaglioProdotti.ToList();
|
|
//var pianificazioneVerticale = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale;
|
|
|
|
decimal OC_CASA = datiSeiUnico.CASA_OC;
|
|
decimal CCN_CASA = datiSeiUnico.CASA_CCN;
|
|
|
|
|
|
rsAggregatoPosizioni RA = (from o in aggregatoPosizioni
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("RA")
|
|
select o).LastOrDefault();
|
|
rsAggregatoPosizioni PAT = (from o in aggregatoPosizioni
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("PAT")
|
|
select o).FirstOrDefault();
|
|
string asteriscoVar = getNote3().Length > 0 && getNote1().Length > 0 ? "**" : getNote1().Length > 0 ? "*" : "";
|
|
|
|
if (CCN_CASA != 0 || OC_CASA != 0)
|
|
{
|
|
DataRow row = ElencoProdotti(prodotti, RA, "", "Totale risorse finanziarie");
|
|
string rischioFormattato = RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? RA.prometeiaInfos.rischioCreditoDecodificato.ToLower() : RA.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, RA.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + RA.prometeiaInfos.rischioCreditoDecodificato.Substring(RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
row["RischioCredito"] = rischioFormattato + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
row["ControvaloreAttuale"] = Helper.FormatCurrency((datiSeiUnico.CASA_SUBTOTALE + datiSeiUnico.CASA_GPELIGO + datiSeiUnico.CASA_TUOFOGLIO).ToString());
|
|
row["RendAnnualSott"] = RA.rendimentoDaSottoscrizioneSpecified ? RA.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
row["VersatoNettoAssoc"] = "n.c.";
|
|
row["UtilPerditaAssoc"] = "n.c.";
|
|
row["RendCumAssoc"] = "n.c.";
|
|
row["VaR"] = row["VaR"] + asteriscoVar;
|
|
if (OC_CASA != 0)
|
|
{
|
|
rsAggregatoPosizioni pv = null;
|
|
ElencoProdottiOC(prodotti, "", "Operazioni in corso")["ControvaloreAttuale"] = Helper.FormatCurrency(OC_CASA.ToString());
|
|
}
|
|
foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Cc" && o.ctv < 0 orderby o.ctv select o)
|
|
{
|
|
ElencoCcNegativi(prodotti, dettaglioProdotto, "", "");
|
|
}
|
|
|
|
}
|
|
string rischioFormattatoPAT = PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower() : PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, PAT.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
DataRow row2 = ElencoProdotti(prodotti, PAT, "", datiSeiUnico.FormatBanca(labelPatrimonioTotale(productsTypeSelected)));
|
|
row2["ControvaloreAttuale"] = Helper.FormatCurrency(datiSeiUnico.CASA_TOTALE.ToString());
|
|
row2["RendAnnualSott"] = PAT.rendimentoDaSottoscrizioneSpecified ? PAT.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
row2["Complessità"] = PAT.complessitaDec;
|
|
row2["VersatoNettoAssoc"] = "n.c.";
|
|
row2["UtilPerditaAssoc"] = "n.c.";
|
|
row2["RendCumAssoc"] = "n.c.";
|
|
row2["VaR"] = row2["VaR"] + asteriscoVar;
|
|
row2["RischioCredito"] = rischioFormattatoPAT + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
}
|
|
|
|
|
|
private void TotaleRisorseFinanziarieContratti(DataTable prodotti, rsAggregatoPosizioni[] aggregatoPosizioni, rsAggregatoPosizioni[] aggregatoPosizioniAree, bool fontBold = false, bool backGroundColor = false)
|
|
{
|
|
var dettaglioProdotti = GetDettaglioProdotti().dettaglioProdotti.ToList();
|
|
//var pianificazioneVerticale = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale;
|
|
|
|
decimal OC_CASA = datiSeiUnico.CASA_OC;
|
|
decimal CCN_CASA = datiSeiUnico.CASA_CCN;
|
|
|
|
|
|
rsAggregatoPosizioni RA = (from o in aggregatoPosizioniAree
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("RA")
|
|
select o).LastOrDefault();
|
|
rsAggregatoPosizioni PAT = (from o in aggregatoPosizioni
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("PAT")
|
|
select o).FirstOrDefault();
|
|
|
|
if (PAT == null) {
|
|
PAT = (from o in aggregatoPosizioniAree
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("PAT")
|
|
select o).FirstOrDefault();
|
|
}
|
|
|
|
string asteriscoVar = getNote3().Length > 0 && getNote1().Length > 0 ? "**" : getNote1().Length > 0 ? "*" : "";
|
|
|
|
if (CCN_CASA != 0 || OC_CASA != 0)
|
|
{
|
|
DataRow row = ElencoProdotti(prodotti, RA, "", "Totale risorse finanziarie");
|
|
string rischioFormattato = RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? RA.prometeiaInfos.rischioCreditoDecodificato.ToLower() : RA.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, RA.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + RA.prometeiaInfos.rischioCreditoDecodificato.Substring(RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
row["RischioCredito"] = rischioFormattato + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
row["ControvaloreAttuale"] = Helper.FormatCurrency((datiSeiUnico.CASA_SUBTOTALE + datiSeiUnico.CASA_GPELIGO + datiSeiUnico.CASA_TUOFOGLIO).ToString());
|
|
row["RendAnnualSott"] = RA.rendimentoDaSottoscrizioneSpecified ? RA.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
row["VersatoNettoAssoc"] = "n.c.";
|
|
row["UtilPerditaAssoc"] = "n.c.";
|
|
row["RendCumAssoc"] = "n.c.";
|
|
row["VaR"] = row["VaR"] + asteriscoVar;
|
|
if (OC_CASA != 0)
|
|
{
|
|
rsAggregatoPosizioni pv = null;
|
|
ElencoProdottiOC(prodotti, "", "Operazioni in corso")["ControvaloreAttuale"] = Helper.FormatCurrency(OC_CASA.ToString());
|
|
}
|
|
foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Cc" && o.ctv < 0 orderby o.ctv select o)
|
|
{
|
|
ElencoCcNegativi(prodotti, dettaglioProdotto, "", "");
|
|
}
|
|
|
|
}
|
|
string rischioFormattatoPAT = PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower() : PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, PAT.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
DataRow row2 = ElencoProdotti(prodotti, PAT, "", datiSeiUnico.FormatBanca(labelPatrimonioTotale(productsTypeSelected)));
|
|
row2["ControvaloreAttuale"] = Helper.FormatCurrency(datiSeiUnico.CASA_TOTALE.ToString());
|
|
row2["RendAnnualSott"] = PAT.rendimentoDaSottoscrizioneSpecified ? PAT.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
row2["Complessità"] = PAT.complessitaDec;
|
|
row2["VersatoNettoAssoc"] = "n.c.";
|
|
row2["UtilPerditaAssoc"] = "n.c.";
|
|
row2["RendCumAssoc"] = "n.c.";
|
|
row2["VaR"] = row2["VaR"] + asteriscoVar;
|
|
row2["RischioCredito"] = rischioFormattatoPAT + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
}
|
|
|
|
|
|
private void TotaleRisorseFinanziarieCategorie(DataTable prodotti, rsAggregatoPosizioni[] aggregatoPosizioni, rsAggregatoPosizioni[] aggregatoPosizioniAree, bool fontBold = false, bool backGroundColor = false)
|
|
{
|
|
var dettaglioProdotti = GetDettaglioProdotti().dettaglioProdotti.ToList();
|
|
//var pianificazioneVerticale = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale;
|
|
|
|
decimal OC_CASA = datiSeiUnico.CASA_OC;
|
|
decimal CCN_CASA = datiSeiUnico.CASA_CCN;
|
|
|
|
|
|
rsAggregatoPosizioni RA = (from o in aggregatoPosizioniAree
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("RA")
|
|
select o).LastOrDefault();
|
|
rsAggregatoPosizioni PAT = (from o in aggregatoPosizioni
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("PAT")
|
|
select o).FirstOrDefault();
|
|
|
|
if (PAT == null) {
|
|
PAT = (from o in aggregatoPosizioniAree
|
|
where o.posizioniAggregate != null && o.chiaveAggregazione.Equals("PAT")
|
|
select o).FirstOrDefault();
|
|
}
|
|
|
|
string asteriscoVar = getNote3().Length > 0 && getNote1().Length > 0 ? "**" : getNote1().Length > 0 ? "*" : "";
|
|
|
|
if (CCN_CASA != 0 || OC_CASA != 0)
|
|
{
|
|
DataRow row = ElencoProdotti(prodotti, RA, "", "Totale risorse finanziarie");
|
|
string rischioFormattato = RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? RA.prometeiaInfos.rischioCreditoDecodificato.ToLower() : RA.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, RA.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + RA.prometeiaInfos.rischioCreditoDecodificato.Substring(RA.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
row["RischioCredito"] = rischioFormattato + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
row["ControvaloreAttuale"] = Helper.FormatCurrency((datiSeiUnico.CASA_SUBTOTALE + datiSeiUnico.CASA_GPELIGO + datiSeiUnico.CASA_TUOFOGLIO).ToString());
|
|
row["RendAnnualSott"] = RA.rendimentoDaSottoscrizioneSpecified ? RA.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
row["VersatoNettoAssoc"] = "n.c.";
|
|
row["UtilPerditaAssoc"] = "n.c.";
|
|
row["RendCumAssoc"] = "n.c.";
|
|
row["VaR"] = row["VaR"] + asteriscoVar;
|
|
if (OC_CASA != 0)
|
|
{
|
|
rsAggregatoPosizioni pv = null;
|
|
ElencoProdottiOC(prodotti, "", "Operazioni in corso")["ControvaloreAttuale"] = Helper.FormatCurrency(OC_CASA.ToString());
|
|
}
|
|
foreach (rsPosizione dettaglioProdotto in from o in dettaglioProdotti where o.area == "Cc" && o.ctv < 0 orderby o.ctv select o)
|
|
{
|
|
ElencoCcNegativi(prodotti, dettaglioProdotto, "", "");
|
|
}
|
|
|
|
}
|
|
string rischioFormattatoPAT = PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Equals("n.a.") ? PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower() : PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(0, 1).ToUpper() + PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Substring(1, PAT.prometeiaInfos.rischioCreditoDecodificato.Length - 2) + PAT.prometeiaInfos.rischioCreditoDecodificato.Substring(PAT.prometeiaInfos.rischioCreditoDecodificato.ToLower().Length - 1).ToUpper();
|
|
DataRow row2 = ElencoProdotti(prodotti, PAT, "", datiSeiUnico.FormatBanca(labelPatrimonioTotale(productsTypeSelected)));
|
|
row2["ControvaloreAttuale"] = Helper.FormatCurrency(datiSeiUnico.CASA_TOTALE.ToString());
|
|
row2["RendAnnualSott"] = PAT.rendimentoDaSottoscrizioneSpecified ? PAT.rendimentoDaSottoscrizione.ToString() : "n.c.";
|
|
row2["Complessità"] = PAT.complessitaDec;
|
|
row2["VersatoNettoAssoc"] = "n.c.";
|
|
row2["UtilPerditaAssoc"] = "n.c.";
|
|
row2["RendCumAssoc"] = "n.c.";
|
|
row2["VaR"] = row2["VaR"] + asteriscoVar;
|
|
row2["RischioCredito"] = rischioFormattatoPAT + (getNote2().Length > 0 ? !asteriscoVar.Equals("") ? asteriscoVar + "*" : getNote3().Length > 0 ? "**" : "*" : "");
|
|
}
|
|
|
|
|
|
private DataRow ElencoEligoNegativi(DataTable prodotti, rsPosizione dettaglioProdotto, string codArea, string descrizione, bool fontBold = false, bool backGroundColor = false)
|
|
{
|
|
DataRow dr = prodotti.NewRow();
|
|
dr["CodArea"] = codArea;
|
|
dr["Descrizione"] = descrizione;
|
|
dr["FontBold"] = fontBold;
|
|
dr["BackGroundColor"] = backGroundColor;
|
|
if (dettaglioProdotto != null)
|
|
{
|
|
dr["Area"] = dettaglioProdotto.area;
|
|
dr["ContrattoDossier"] = dettaglioProdotto.codContratto;
|
|
dr["NomeProdotto"] = dettaglioProdotto.prodotto.nomeProdotto;
|
|
dr["DistrCedoleDividendi"] = "-";
|
|
dr["ControvaloreAttuale"] = Helper.FormatCurrency(dettaglioProdotto.ctv.ToString());
|
|
dr["DataAgg"] = dettaglioProdotto.dtRiferimentoSpecified ? Convert.ToDateTime(dettaglioProdotto.dtRiferimento).ToShortDateString() : "-";
|
|
dr["DataSott"] = dettaglioProdotto.dtInizioRendimentoSpecified ? Convert.ToDateTime(dettaglioProdotto.dtInizioRendimento).ToShortDateString() : dettaglioProdotto.dtSottoscrizioneSpecified ? Convert.ToDateTime(dettaglioProdotto.dtSottoscrizione).ToShortDateString() : "-";
|
|
dr["VaR"] = dettaglioProdotto.prodotto.varDecodificato;
|
|
dr["RischioCredito"] = dettaglioProdotto.prodotto.rischioCreditoDecodificato;
|
|
dr["VersatoNettoSott"] = "n.c.";
|
|
dr["UtilePerditaSott"] = "n.c.";
|
|
dr["RendAnnualSott"] = "n.c.";
|
|
dr["CodIsin"] = "-";
|
|
dr["Complessità"] = "n.c.";
|
|
dr["RatingMorningstar"] = "-";
|
|
dr["NumqQuantValnom"] = "-";
|
|
dr["QuotaPrezzoEuro"] = "-";
|
|
dr["VersatoNettoAssoc"] = "n.c.";
|
|
dr["UtilPerditaAssoc"] = "n.c.";
|
|
dr["RendCumAssoc"] = "n.c.";
|
|
dr["DataAssoc"] = "-";
|
|
dr["RendInizioTrimestre"] = "n.c.";
|
|
dr["RendInizioAnno"] = "n.c.";
|
|
dr["ValoriDiCarico"] = dettaglioProdotto.costoMedioPonderatoFiscaleSpecified ? dettaglioProdotto.costoMedioPonderatoFiscale.ToString() : "n.c.";
|
|
dr["UtilePerditaCaricoEuro"] = dettaglioProdotto.utilePerditaDiCaricoSpecified ? dettaglioProdotto.utilePerditaDiCarico.ToString() : "n.c.";
|
|
dr["UtilePerditaCaricoPerc"] = dettaglioProdotto.utilePerditaDiCaricoPercentualeSpecified ? dettaglioProdotto.utilePerditaDiCaricoPercentuale.ToString() : "n.c.";
|
|
}
|
|
prodotti.Rows.Add(dr);
|
|
return dr;
|
|
}
|
|
|
|
//AC
|
|
private DataRow ElencoFogliNegativi(DataTable prodotti, rsPosizione dettaglioProdotto, string codArea, string descrizione, bool fontBold = false, bool backGroundColor = false)
|
|
{
|
|
DataRow dr = prodotti.NewRow();
|
|
dr["CodArea"] = codArea;
|
|
dr["Descrizione"] = descrizione;
|
|
dr["FontBold"] = fontBold;
|
|
dr["BackGroundColor"] = backGroundColor;
|
|
if (dettaglioProdotto != null)
|
|
{
|
|
dr["Area"] = dettaglioProdotto.area;
|
|
dr["ContrattoDossier"] = dettaglioProdotto.codContratto;
|
|
dr["NomeProdotto"] = dettaglioProdotto.prodotto.nomeProdotto;
|
|
dr["DistrCedoleDividendi"] = "-";
|
|
dr["ControvaloreAttuale"] = Helper.FormatCurrency(dettaglioProdotto.ctv.ToString());
|
|
dr["DataAgg"] = dettaglioProdotto.dtRiferimentoSpecified ? Convert.ToDateTime(dettaglioProdotto.dtRiferimento).ToShortDateString() : "-";
|
|
dr["DataSott"] = dettaglioProdotto.dtInizioRendimentoSpecified ? Convert.ToDateTime(dettaglioProdotto.dtInizioRendimento).ToShortDateString() : dettaglioProdotto.dtSottoscrizioneSpecified ? Convert.ToDateTime(dettaglioProdotto.dtSottoscrizione).ToShortDateString() : "-";
|
|
dr["VaR"] = dettaglioProdotto.prodotto.varDecodificato;
|
|
dr["RischioCredito"] = dettaglioProdotto.prodotto.rischioCreditoDecodificato;
|
|
dr["VersatoNettoSott"] = "n.c.";
|
|
dr["UtilePerditaSott"] = "n.c.";
|
|
dr["RendAnnualSott"] = "n.c.";
|
|
dr["CodIsin"] = "-";
|
|
dr["Complessità"] = "n.c.";
|
|
dr["RatingMorningstar"] = "-";
|
|
dr["NumqQuantValnom"] = "-";
|
|
dr["QuotaPrezzoEuro"] = "-";
|
|
dr["VersatoNettoAssoc"] = "n.c.";
|
|
dr["UtilPerditaAssoc"] = "n.c.";
|
|
dr["RendCumAssoc"] = "n.c.";
|
|
dr["DataAssoc"] = "-";
|
|
dr["RendInizioTrimestre"] = "n.c.";
|
|
dr["RendInizioAnno"] = "n.c.";
|
|
dr["ValoriDiCarico"] = dettaglioProdotto.costoMedioPonderatoFiscaleSpecified ? dettaglioProdotto.costoMedioPonderatoFiscale.ToString() : "n.c.";
|
|
dr["UtilePerditaCaricoEuro"] = dettaglioProdotto.utilePerditaDiCaricoSpecified ? dettaglioProdotto.utilePerditaDiCarico.ToString() : "n.c.";
|
|
dr["UtilePerditaCaricoPerc"] = dettaglioProdotto.utilePerditaDiCaricoPercentualeSpecified ? dettaglioProdotto.utilePerditaDiCaricoPercentuale.ToString() : "n.c.";
|
|
}
|
|
prodotti.Rows.Add(dr);
|
|
return dr;
|
|
}
|
|
|
|
//--AC
|
|
|
|
private DataRow ElencoProdottiOC(DataTable prodotti, string codArea, string descrizione)
|
|
{
|
|
DataRow dr = prodotti.NewRow();
|
|
dr["CodArea"] = codArea;
|
|
dr["Descrizione"] = descrizione;
|
|
dr["FontBold"] = false;
|
|
dr["BackGroundColor"] = false;
|
|
|
|
prodotti.Rows.Add(dr);
|
|
return dr;
|
|
}
|
|
private DataRow ElencoCcNegativi(DataTable prodotti, rsPosizione dettaglioProdotto, string codArea, string descrizione, bool fontBold = false, bool backGroundColor = false)
|
|
{
|
|
DataRow dr = prodotti.NewRow();
|
|
dr["CodArea"] = codArea;
|
|
dr["Descrizione"] = descrizione;
|
|
dr["FontBold"] = fontBold;
|
|
dr["BackGroundColor"] = backGroundColor;
|
|
if (dettaglioProdotto != null)
|
|
{
|
|
dr["Area"] = dettaglioProdotto.area;
|
|
dr["ContrattoDossier"] = dettaglioProdotto.codContratto;
|
|
dr["NomeProdotto"] = dettaglioProdotto.prodotto.nomeProdotto;
|
|
dr["DistrCedoleDividendi"] = dettaglioProdotto.prodotto.distrCedoleDividendi.Contains("Frequenza") ? dettaglioProdotto.prodotto.distrCedoleDividendi.Replace("Frequenza", "<br>Freq.") : dettaglioProdotto.prodotto.distrCedoleDividendi;
|
|
dr["ControvaloreAttuale"] = Helper.FormatCurrency(dettaglioProdotto.ctv.ToString());
|
|
dr["DataAgg"] = dettaglioProdotto.dtRiferimentoSpecified ? Convert.ToDateTime(dettaglioProdotto.dtRiferimento).ToShortDateString() : "-";
|
|
dr["DataSott"] = dettaglioProdotto.dtInizioRendimentoSpecified ? Convert.ToDateTime(dettaglioProdotto.dtInizioRendimento).ToShortDateString() : dettaglioProdotto.dtSottoscrizioneSpecified ? Convert.ToDateTime(dettaglioProdotto.dtSottoscrizione).ToShortDateString() : "-";
|
|
dr["VaR"] = dettaglioProdotto.prodotto.varDecodificato;
|
|
dr["RischioCredito"] = dettaglioProdotto.prodotto.rischioCreditoDecodificato;
|
|
dr["VersatoNettoSott"] = "n.c.";
|
|
dr["UtilePerditaSott"] = "n.c.";
|
|
dr["RendAnnualSott"] = "n.c.";
|
|
dr["CodIsin"] = "-";
|
|
dr["Complessità"] = "Minima";
|
|
dr["RatingMorningstar"] = "-";
|
|
dr["NumqQuantValnom"] = "-";
|
|
dr["QuotaPrezzoEuro"] = "-";
|
|
dr["VersatoNettoAssoc"] = "n.c.";
|
|
dr["UtilPerditaAssoc"] = "n.c.";
|
|
dr["RendCumAssoc"] = "n.c.";
|
|
dr["DataAssoc"] = "-";
|
|
dr["RendInizioTrimestre"] = "n.c.";
|
|
dr["RendInizioAnno"] = "n.c.";
|
|
dr["ValoriDiCarico"] = dettaglioProdotto.costoMedioPonderatoFiscaleSpecified ? dettaglioProdotto.costoMedioPonderatoFiscale.ToString() : "n.c.";
|
|
dr["UtilePerditaCaricoEuro"] = dettaglioProdotto.utilePerditaDiCaricoSpecified ? dettaglioProdotto.utilePerditaDiCarico.ToString() : "n.c.";
|
|
dr["UtilePerditaCaricoPerc"] = dettaglioProdotto.utilePerditaDiCaricoPercentualeSpecified ? dettaglioProdotto.utilePerditaDiCaricoPercentuale.ToString() : "n.c.";
|
|
}
|
|
prodotti.Rows.Add(dr);
|
|
return dr;
|
|
}
|
|
|
|
|
|
|
|
public virtual string getTesto1()
|
|
{
|
|
if (PRODUCT_TYPE_CASA.Equals(productsTypeSelected))
|
|
{
|
|
string testo = "In questa scheda sono riportati i prodotti che lei detiene presso $/Banca/$ per i quali è primo intestatario di contratto, ";
|
|
if (raggruppaProdotti() == ReportCommon.RaggruppaProdotti.Categoria)
|
|
testo += "raggruppati secondo la categoria di appartenenza.";
|
|
if (raggruppaProdotti() == ReportCommon.RaggruppaProdotti.AreaBisogno)
|
|
testo += "raggruppati per area di bisogno e, dove necessario, per progetto di investimento.";
|
|
if (raggruppaProdotti() == ReportCommon.RaggruppaProdotti.Contratto)
|
|
testo += "raggruppati secondo il contratto di appartenenza.";
|
|
return datiSeiUnico.FormatBanca(testo);
|
|
} else if(PRODUCT_TYPE_COINTESTATI.Equals(productsTypeSelected))
|
|
{
|
|
string testo = "In questa scheda sono riportati i prodotti presso $/Banca/$ per i quali è intestatario di contratto diverso dal primo, " +
|
|
"raggruppati secondo il contratto di appartenenza.";
|
|
return datiSeiUnico.FormatBanca(testo);
|
|
}
|
|
else
|
|
{
|
|
string testo = "In questa scheda sono riportati i prodotti appartenenti alle categorie \"Assicurativi danni\" e \"Temporanee caso morte\" che lei detiene presso $/Banca/$, " +
|
|
"raggruppati secondo il contratto di appartenenza.";
|
|
return datiSeiUnico.FormatBanca(testo);
|
|
}
|
|
|
|
}
|
|
|
|
public virtual RaggruppaProdotti raggruppaProdotti()
|
|
{
|
|
switch(productsTypeSelected)
|
|
{
|
|
case PRODUCT_TYPE_CASA:
|
|
return GetOption<Opzione12>().RaggruppaProdotti;
|
|
case PRODUCT_TYPE_COINTESTATI:
|
|
return ReportCommon.RaggruppaProdotti.Contratto;
|
|
default:
|
|
return ReportCommon.RaggruppaProdotti.Contratto;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public virtual Opzione12 getColonne() { return GetOption<Opzione12>(); }
|
|
|
|
|
|
public virtual string getNote1()
|
|
{
|
|
string nota = "";
|
|
string token = "";
|
|
decimal GCRM = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale.varInfos.stat.copertura;
|
|
if (GCRM < 100 && getColonne().VaR)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("Grado di copertura (%) prodotti in termini di Rischio Mercato (VaR): {0}.", GCRM);
|
|
}
|
|
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
}
|
|
public virtual string getNote2()
|
|
{
|
|
string nota = "";
|
|
string token = "";
|
|
decimal GCRC = datiSeiUnico.pianificazioneUnit().pianificazioneVerticale.varInfos.stat.copertura;
|
|
if (GCRC < 100 && GCRC > 0 && getColonne().RischioCredito)
|
|
{
|
|
nota += token + datiSeiUnico.FormatDecimal("Grado di copertura (%) prodotti in termini di Rischio Credito: {0}.", GCRC);
|
|
}
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
}
|
|
public virtual string getNote3()
|
|
{
|
|
string nota = "";
|
|
string token = "";
|
|
|
|
if (getColonne().RendAnnualSott || getColonne().RendInizioTrimestre || getColonne().RendInizioAnno)
|
|
{
|
|
nota += token + "I rendimenti";
|
|
token = " ";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "da sottoscrizione";
|
|
token = " e ";
|
|
if (getColonne().RendInizioTrimestre && getColonne().RendInizioAnno)
|
|
token = ", ";
|
|
}
|
|
if (getColonne().RendInizioTrimestre)
|
|
{
|
|
nota += token + "da inizio trimestre";
|
|
token = " e ";
|
|
}
|
|
if (getColonne().RendInizioAnno)
|
|
{
|
|
nota += token + "da inizio anno";
|
|
}
|
|
token = " ";
|
|
nota += token + "sono calcolati utilizzando la metodologia del \"Tasso Interno di Rendimento (T.I.R.)\".";
|
|
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "Per gli investimenti di durata superiore all'anno, i rendimenti da sottoscrizione sono espressi su base annua.";
|
|
}
|
|
nota += token + "I rendimenti";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "da sottoscrizione";
|
|
token = " e ";
|
|
if (getColonne().RendInizioTrimestre && getColonne().RendInizioAnno)
|
|
token = ", ";
|
|
}
|
|
if (getColonne().RendInizioTrimestre)
|
|
{
|
|
nota += token + "da inizio trimestre";
|
|
token = " e ";
|
|
}
|
|
if (getColonne().RendInizioAnno)
|
|
{
|
|
nota += token + "da inizio anno";
|
|
}
|
|
token = " ";
|
|
nota += token + "dei singoli prodotti sono calcolati ogni giorno";
|
|
|
|
if (getColonne().RaggruppaProdotti == ReportCommon.RaggruppaProdotti.Categoria)
|
|
{
|
|
nota += ", mentre quelli a livello di categoria prodotto";
|
|
nota += token + "e portafoglio";
|
|
nota += token + "sono calcolati ogni fine settimana";
|
|
}
|
|
if (getColonne().RaggruppaProdotti == ReportCommon.RaggruppaProdotti.Contratto)
|
|
{
|
|
nota += ", mentre quelli a livello di contratto";
|
|
nota += token + "e portafoglio";
|
|
nota += token + "sono calcolati ogni fine settimana";
|
|
}
|
|
nota += ".";
|
|
|
|
# region Omnia No Foglio
|
|
if (gpOmniaPresent && !gpFoglioPresent)
|
|
{
|
|
token = " ";
|
|
nota += token + "Fanno eccezione a queste regole i rendimenti";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "da sottoscrizione";
|
|
token = " e ";
|
|
if (getColonne().RendInizioTrimestre && getColonne().RendInizioAnno)
|
|
token = ", ";
|
|
}
|
|
if (getColonne().RendInizioTrimestre)
|
|
{
|
|
nota += token + "da inizio trimestre";
|
|
token = " e ";
|
|
}
|
|
if (getColonne().RendInizioAnno)
|
|
{
|
|
nota += token + "da inizio anno";
|
|
}
|
|
token = " ";
|
|
nota += token + "delle gestioni patrimoniali \"Omnia\"";
|
|
if (getColonne().RaggruppaProdotti == ReportCommon.RaggruppaProdotti.Contratto)
|
|
{
|
|
nota += " e del relativo contratto";
|
|
}
|
|
nota += ", che sono calcolati utilizzando la metodologia del \"Money Weighted Rate Of Return (M.W.R.R.)\"";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "e, a prescindere dalla durata dell'investimento, sono espressi su base cumulata";
|
|
}
|
|
nota += ".";
|
|
if (gpEligoFondPresent || gpEligoTitPresent)
|
|
{
|
|
token = " ";
|
|
nota += token + "I rendimenti";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "da sottoscrizione";
|
|
token = " e ";
|
|
if (getColonne().RendInizioTrimestre && getColonne().RendInizioAnno)
|
|
token = ", ";
|
|
}
|
|
if (getColonne().RendInizioTrimestre)
|
|
{
|
|
nota += token + "da inizio trimestre";
|
|
token = " e ";
|
|
}
|
|
if (getColonne().RendInizioAnno)
|
|
nota += token + "da inizio anno";
|
|
token = " ";
|
|
nota += token + " dei";
|
|
if (gpEligoFondPresent)
|
|
nota += token + "fondi sottostanti la \"GP Eligo Fondi\"";
|
|
if (gpEligoFondPresent && gpEligoTitPresent)
|
|
nota += token + "e";
|
|
if (gpEligoTitPresent)
|
|
nota += token + "dei basket sottostanti la \"GP Eligo Titoli\"";
|
|
nota += token + "sono invece calcolati utilizzando la metodologia del \"Tasso Interno di Rendimento (T.I.R.)\"";
|
|
if (getColonne().RendAnnualSott)
|
|
nota += token + "e, per gli investimenti di durata superiore all'anno, sono espressi su base annua";
|
|
nota += ".";
|
|
}
|
|
}
|
|
# endregion
|
|
|
|
# region Omnia + Foglio
|
|
if (gpOmniaPresent && gpFoglioPresent)
|
|
{
|
|
token = " ";
|
|
nota += token + "Fanno eccezione a queste regole i rendimenti";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "da sottoscrizione";
|
|
token = " e ";
|
|
if (getColonne().RendInizioTrimestre && getColonne().RendInizioAnno)
|
|
token = ", ";
|
|
}
|
|
if (getColonne().RendInizioTrimestre)
|
|
{
|
|
nota += token + "da inizio trimestre";
|
|
token = " e ";
|
|
}
|
|
if (getColonne().RendInizioAnno)
|
|
{
|
|
nota += token + "da inizio anno";
|
|
}
|
|
token = " ";
|
|
nota += token + "delle gestioni patrimoniali \"Omnia\", dei \"Fogli\"";
|
|
if (getColonne().RaggruppaProdotti == ReportCommon.RaggruppaProdotti.Contratto)
|
|
{
|
|
nota += " e del relativo contratto";
|
|
}
|
|
nota += ", che sono calcolati utilizzando la metodologia del \"Money Weighted Rate Of Return (M.W.R.R.)\"";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "e, a prescindere dalla durata dell'investimento, sono espressi su base cumulata";
|
|
}
|
|
nota += ".";
|
|
if (gpEligoFondPresent || gpEligoTitPresent)
|
|
{
|
|
token = " ";
|
|
nota += token + "I rendimenti";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "da sottoscrizione";
|
|
token = " e ";
|
|
if (getColonne().RendInizioTrimestre && getColonne().RendInizioAnno)
|
|
token = ", ";
|
|
}
|
|
if (getColonne().RendInizioTrimestre)
|
|
{
|
|
nota += token + "da inizio trimestre";
|
|
token = " e ";
|
|
}
|
|
if (getColonne().RendInizioAnno)
|
|
nota += token + "da inizio anno";
|
|
token = " ";
|
|
nota += token + " dei";
|
|
if (gpEligoFondPresent)
|
|
nota += token + "fondi sottostanti la \"GP Eligo Fondi\"";
|
|
if (gpEligoFondPresent && gpEligoTitPresent)
|
|
nota += token + "e";
|
|
if (gpEligoTitPresent)
|
|
nota += token + "dei basket sottostanti la \"GP Eligo Titoli\"";
|
|
nota += token + "sono invece calcolati utilizzando la metodologia del \"Tasso Interno di Rendimento (T.I.R.)\"";
|
|
if (getColonne().RendAnnualSott)
|
|
nota += token + "e, per gli investimenti di durata superiore all'anno, sono espressi su base annua";
|
|
nota += ".";
|
|
}
|
|
}
|
|
# endregion
|
|
|
|
# region No Omnia Si Foglio
|
|
if (!gpOmniaPresent && gpFoglioPresent)
|
|
{
|
|
token = " ";
|
|
nota += token + "Fanno eccezione a queste regole i rendimenti";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "da sottoscrizione";
|
|
token = " e ";
|
|
if (getColonne().RendInizioTrimestre && getColonne().RendInizioAnno)
|
|
token = ", ";
|
|
}
|
|
if (getColonne().RendInizioTrimestre)
|
|
{
|
|
nota += token + "da inizio trimestre";
|
|
token = " e ";
|
|
}
|
|
if (getColonne().RendInizioAnno)
|
|
{
|
|
nota += token + "da inizio anno";
|
|
}
|
|
token = " ";
|
|
nota += token + "dei \"Fogli\"";
|
|
if (getColonne().RaggruppaProdotti == ReportCommon.RaggruppaProdotti.Contratto)
|
|
{
|
|
nota += " e del relativo contratto";
|
|
}
|
|
nota += ", che sono calcolati utilizzando la metodologia del \"Money Weighted Rate Of Return (M.W.R.R.)\"";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "e, a prescindere dalla durata dell'investimento, sono espressi su base cumulata";
|
|
}
|
|
nota += ".";
|
|
if (gpEligoFondPresent || gpEligoTitPresent)
|
|
{
|
|
token = " ";
|
|
nota += token + "I rendimenti";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "da sottoscrizione";
|
|
token = " e ";
|
|
if (getColonne().RendInizioTrimestre && getColonne().RendInizioAnno)
|
|
token = ", ";
|
|
}
|
|
if (getColonne().RendInizioTrimestre)
|
|
{
|
|
nota += token + "da inizio trimestre";
|
|
token = " e ";
|
|
}
|
|
if (getColonne().RendInizioAnno)
|
|
nota += token + "da inizio anno";
|
|
token = " ";
|
|
nota += token + " dei";
|
|
if (gpEligoFondPresent)
|
|
nota += token + "fondi sottostanti la \"GP Eligo Fondi\"";
|
|
if (gpEligoFondPresent && gpEligoTitPresent)
|
|
nota += token + "e";
|
|
if (gpEligoTitPresent)
|
|
nota += token + "dei basket sottostanti la \"GP Eligo Titoli\"";
|
|
nota += token + "sono invece calcolati utilizzando la metodologia del \"Tasso Interno di Rendimento (T.I.R.)\"";
|
|
if (getColonne().RendAnnualSott)
|
|
nota += token + "e, per gli investimenti di durata superiore all'anno, sono espressi su base annua";
|
|
nota += ".";
|
|
}
|
|
}
|
|
# endregion
|
|
|
|
token = " ";
|
|
if (getColonne().RendAnnualSott && (gpPresent || fondiPresent || ulPresent || apPresent || titPresent))
|
|
{
|
|
nota += token + "I rendimenti da sottoscrizione sono calcolati a partire dall'effettiva data di sottoscrizione dei prodotti";
|
|
if (fondiEurizonPresent || gpPresent || titPresent)
|
|
{
|
|
nota += ", con le seguenti eccezioni:";
|
|
if (fondiEurizonPresent)
|
|
nota += token + "per i fondi di \"Eurizon\"";
|
|
if (fondiEurizonPresent && gpPresent)
|
|
nota += token + "e";
|
|
if (gpPresent)
|
|
nota += token + "per le gestioni patrimoniali";
|
|
if (fondiEurizonPresent || gpPresent)
|
|
{
|
|
nota += token + "se la data di sottoscrizione è precedente al 01/01/2007, i rendimenti da sottoscrizione sono calcolati a partire dal 01/01/2007";
|
|
token = ", ";
|
|
}
|
|
if (titPresent)
|
|
nota += token + "per i titoli, se la data di sottoscrizione è precedente al 01/01/1999, i rendimenti da sottoscrizione sono calcolati a partire dal 01/01/1999";
|
|
}
|
|
nota += ".";
|
|
}
|
|
token = " ";
|
|
if (fondiAGaranziaPresent && isCategorieProdotto)
|
|
{
|
|
nota += token + "I rendimenti";
|
|
if (getColonne().RendAnnualSott)
|
|
{
|
|
nota += token + "da sottoscrizione";
|
|
token = " e ";
|
|
if (getColonne().RendInizioTrimestre && getColonne().RendInizioAnno)
|
|
token = ", ";
|
|
}
|
|
if (getColonne().RendInizioTrimestre)
|
|
{
|
|
nota += token + "da inizio trimestre";
|
|
token = " e ";
|
|
}
|
|
if (getColonne().RendInizioAnno)
|
|
nota += token + "da inizio anno";
|
|
token = " ";
|
|
nota += token + "della categoria \"Fondi\" non considerano i rendimenti dei fondi a garanzia, che contribuiscono invece al rendimento da sottoscrizione della categoria \"Titoli\".";
|
|
}
|
|
token = " ";
|
|
if (getColonne().RendAnnualSott && mcGestioniSgrPresent)
|
|
{
|
|
nota += token + "Le gestioni patrimoniali di \"MC Gestioni Sgr\" contribuiscono al calcolo dei rendimenti da sottoscrizione a livello di";
|
|
if (isCategorieProdotto)
|
|
nota += token + "categoria prodotto e";
|
|
nota += token + "portafoglio a partire dal 01/10/2011, anche se l'effettiva data di sottoscrizione è precedente al 01/10/2011.";
|
|
}
|
|
token = " ";
|
|
if (getColonne().RendAnnualSott && ulPresent)
|
|
{
|
|
nota += token + "Le polizze unit linked contribuiscono al calcolo dei rendimenti da sottoscrizione a livello di";
|
|
if (isCategorieProdotto)
|
|
nota += token + "categoria prodotto e";
|
|
nota += token + "portafoglio a partire dal 30/06/2013, anche se l'effettiva data di sottoscrizione è precedente al 30/06/2013.";
|
|
}
|
|
if (getColonne().RendAnnualSott && apPresent)
|
|
{
|
|
nota += token + "I prodotti assicurativi previdenziali non contribuiscono al calcolo dei rendimenti da sottoscrizione a livello di";
|
|
if (isCategorieProdotto)
|
|
nota += token + "categoria prodotto e";
|
|
nota += token + "portafoglio.";
|
|
}
|
|
if (getColonne().RendAnnualSott && fidProgettoPensionePresent)
|
|
{
|
|
nota += token + "Il rendimento da sottoscrizione del prodotto previdenziale \"FID Progetto Pensione\" è calcolato considerando esclusivamente la componente di tipo unit linked.";
|
|
}
|
|
if (getColonne().RendAnnualSott && evProgettoPensionePresent)
|
|
{
|
|
nota += token + "I rendimenti da sottoscrizione del prodotto previdenziale \"EV Progetto Pensione\" sono calcolati considerando esclusivamente la componente di tipo unit linked.";
|
|
}
|
|
}
|
|
if (getColonne().RendCumAssoc)
|
|
{
|
|
nota += token + "I rendimenti da associazione sono calcolati ogni fine settimana utilizzando la metodologia del \"Tasso Interno di Rendimento (T.I.R.)\". I rendimenti da associazione dei singoli prodotti sono calcolati a partire dalla data in cui un prodotto viene associato ad un'area o ad un progetto di Investimento con Monitoraggio avviato.";
|
|
if (isAreeDiBisogno)
|
|
nota += token + "I rendimenti da associazione a livello di area / progetto sono calcolati a partire dalla data di avvio del Monitoraggio.";
|
|
nota += token + "A prescindere dalla durata del Monitoraggio, i rendimenti da associazione sono espressi su base cumulata.";
|
|
}
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
}
|
|
public virtual string getNote4()
|
|
{
|
|
string nota = "";
|
|
if (getColonne().ValoriDiCarico)
|
|
{
|
|
nota = "II \"Prezzo medio di carico\" rappresenta il \"costo medio ponderato fiscale\", ossia il valore comprensivo di commissioni, spese di negoziazione e di eventuali coefficienti di rivalutazione o disaggio di emissione ed il relativo cambio medio ponderato fiscale. I valori di carico, espressi in Euro, sono disponibili esclusivamente per i fondi collocati à la carte, per le azioni e per gli ETF.";
|
|
}
|
|
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
}
|
|
public virtual string getNote5()
|
|
{
|
|
string nota = "";
|
|
if (getColonne().UtilePerditaCaricoEuro)
|
|
{
|
|
nota = " L' \"Utile / Perdita di carico in Euro\" è calcolato come differenza tra il valore attuale (NAV o prezzo) dello strumento e il relativo prezzo medio di carico, moltiplicata per il numero di quote/ quantità in portafoglio.";
|
|
}
|
|
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
}
|
|
public virtual string getNote6()
|
|
{
|
|
string nota = "";
|
|
if (getColonne().UtilePerditaCaricoPerc)
|
|
{
|
|
nota = "L' \"Utile / Perdita di carico in percentuale\" rappresenta la variazione percentuale tra il valore attuale (NAV o prezzo) dello strumento e il relativo prezzo medio di carico.";
|
|
}
|
|
|
|
return datiSeiUnico.FormatBanca(nota);
|
|
}
|
|
|
|
private bool requiredProdottiCointestati ()
|
|
{
|
|
var opt4_2 = GetOption<Opzione4_2>();
|
|
return opt4_2.Valore;
|
|
}
|
|
|
|
private bool requiredProdottiCasa()
|
|
{
|
|
var opt4_1 = GetOption<Opzione4_1>();
|
|
return opt4_1.Valore;
|
|
}
|
|
private bool requiredProdottiTCM()
|
|
{
|
|
var opt4_3 = GetOption<Opzione4_3>();
|
|
return opt4_3.Valore;
|
|
}
|
|
private VisualizzazioneProdotti visualizzazioneScelta()
|
|
{
|
|
var opzione = GetOption<Opzione12>();
|
|
var paramList = opzione.Valore.Split(',');
|
|
string paramVisualizzazione = paramList[paramList.Length - 1];
|
|
switch (paramVisualizzazione)
|
|
{
|
|
case "A":
|
|
return VisualizzazioneProdotti.PosizioniAttive;
|
|
case "SL":
|
|
return VisualizzazioneProdotti.PosizioniLiquidate;
|
|
case "CL":
|
|
return VisualizzazioneProdotti.ContrattiLiquidati;
|
|
default:
|
|
return VisualizzazioneProdotti.All;
|
|
}
|
|
|
|
}
|
|
|
|
//Prodotti Casa
|
|
public virtual string getCapitolo1()
|
|
{
|
|
return "Patrimonio $/Banca/$: dettaglio contratti primo intestatario";
|
|
}
|
|
//Prodotti Cointestati
|
|
public virtual string getCapitolo2()
|
|
{
|
|
return "Patrimonio $/Banca/$: dettaglio altre posizioni cointestate";
|
|
}
|
|
//Prodotti TCM
|
|
public virtual string getCapitolo3()
|
|
{
|
|
return "Patrimonio $/Banca/$: dettaglio prodotti \"Assicurativi danni e TCM\"";
|
|
}
|
|
}
|
|
}
|