426 lines
24 KiB
C#
426 lines
24 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 Consulenza.ReportWriter.Business.Entity;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Consulenza.ReportWriter.Manager.Section.Unica
|
|
{
|
|
/// <summary>
|
|
/// S24.PatrimonioFideuramProdottiNonRappresentabili idSezione = 67
|
|
/// </summary>
|
|
public class S24 : Entity.Section
|
|
{
|
|
|
|
public S24(EnvironmentFacade environmentFacade, int idSection)
|
|
: base(environmentFacade, idSection)
|
|
{
|
|
try
|
|
{
|
|
Draw();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SectionLogger.Write("S24", ex.Message, SectionLoggerMessageLevel.E, EnvironmentFacade.ReportEnvironment);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Disegna la scheda S24.
|
|
/// </summary>
|
|
protected override sealed void Draw()
|
|
{
|
|
|
|
var dati = GetDataSet();
|
|
var testi = GetText();
|
|
foreach (DataTable table in dati.Tables)
|
|
{
|
|
|
|
|
|
if (table.TableName.Contains("_"))
|
|
{
|
|
|
|
|
|
int indiceTabella = Convert.ToInt32(table.ExtendedProperties["IndiceTabella"]);
|
|
|
|
//Vincoli sulla visualizzazione
|
|
if ((indiceTabella == 1 && mostraTabella_Asset()) || (indiceTabella == 3 && mostraTabella_Valute()) || (indiceTabella == 5 && mostraTabella_Rendimenti()))
|
|
{
|
|
var titolo = Helper.ReplaceVariables(testi.Rows[0][string.Format("testo{0}", indiceTabella)].ToString(), EnvironmentFacade.ReportEnvironment);
|
|
var testoIntroduttivo = Helper.ReplaceVariables(testi.Rows[0][string.Format("testo{0}", indiceTabella + 1)].ToString(), EnvironmentFacade.ReportEnvironment);
|
|
|
|
AddElement(new SpacePDF(20));
|
|
AddElement(new FormattedTextAreaPDF(titolo, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 11, FontBold = true });
|
|
AddElement(new SpacePDF(15));
|
|
AddElement(new FormattedTextAreaPDF(testoIntroduttivo, EnvironmentFacade.RendererFacade.XLeftLimit) { FontSize = 7, TextHorizontalAlign = ceTe.DynamicPDF.TextAlign.Justify });
|
|
AddElement(new SpacePDF(10));
|
|
|
|
#region Tabella dei prodotti non rappresentabili
|
|
|
|
var tabella = new TablePDF(EnvironmentFacade.RendererFacade.XLeftLimit, table)
|
|
{
|
|
Style = Style.ConsulenzaUnica,
|
|
Header = true,
|
|
Footer = true,
|
|
WhiteSpacesHorizontalSeparator = true,
|
|
ShowSeparationLines = false,
|
|
AlternateRow = false,
|
|
HeaderHeight = 30,
|
|
HeaderMargin = 2
|
|
};
|
|
|
|
#region Columns e FooterColumns
|
|
|
|
tabella.Columns.Add(new ColumnPDF("Immagine", 15, HorizontalAlignmentType.Sinistra, false, false, 6, ColumnType.Objectpdf, string.Empty, string.Empty) { HeaderFontSize = 7, FontSize = 7, DeltaYContent = 4, PaddingLeft = 2 });
|
|
tabella.Columns.Add(new ColumnPDF("DataSottoscrizione", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Datasottoscrizione", "Data<br> sottoscrizione") { HeaderFontSize = 7, FontSize = 7, BackgroundColor = ColorPDF.Bianco, DeltaYContent = -1 });
|
|
tabella.Columns.Add(new ColumnPDF("CodiceContratto", 70, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Codicecontratto", "Codice<br> contratto") { HeaderFontSize = 7, FontSize = 7, BackgroundColor = ColorPDF.Bianco, DeltaYContent = -1 });
|
|
tabella.Columns.Add(new ColumnPDF("Descrizione", 235, HorizontalAlignmentType.Sinistra, false, false, 7, ColumnType.Testo, "Descrizione", "Descrizione") { HeaderFontSize = 7, BackgroundColor = ColorPDF.Bianco, FontSize = 7, DeltaYContent = -1 });
|
|
tabella.FooterColumns.Add(new ColumnPDF("Totale", tabella.Columns.Sum(o => o.Width), HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Testo));
|
|
tabella.FooterCells[0, 0].Value = "Totale prodotti non rappresentabili";
|
|
|
|
tabella.Columns.Add(new ColumnPDF("ControvaloreAttuale", 80, HorizontalAlignmentType.Sinistra, false, true, 7, ColumnType.Decimale, "ControvaloreAttuale", "Controvalore<br>attuale (€)") { HeaderFontSize = 7, FontSize = 7, BackgroundColor = ColorPDF.Bianco, PaddingRight = 4, DeltaYContent = -1 });
|
|
tabella.FooterColumns.Add(new ColumnPDF("ControvaloreAttuale", 80, HorizontalAlignmentType.Destra, false, true, 7, ColumnType.Testo) { FontSize = 7, PaddingRight = 4});
|
|
tabella.FooterCells[1, 0].Value = Helper.FormatCurrency(table.Select("IsTotal='false' AND IsSubTotal='false'").AsEnumerable().Sum(x => x.Field<decimal>("ControvaloreAttuale")).ToString());
|
|
|
|
tabella.Columns.Add(new ColumnPDF("VaR", 50, HorizontalAlignmentType.Destra, false, true, 7, ColumnType.Testo, "VaR", "VaR (%)") { HeaderFontSize = 7, FontSize = 7, BackgroundColor = ColorPDF.Bianco, PaddingRight = 4, DeltaYContent = -1 });
|
|
tabella.FooterColumns.Add(new ColumnPDF("VaR", 50, HorizontalAlignmentType.Destra, false, true, 7, ColumnType.Testo) { FontSize = 7, PaddingRight = 2 });
|
|
tabella.FooterCells[2, 0].Value = "";
|
|
|
|
#endregion
|
|
|
|
#region Cells
|
|
|
|
int i = 0;
|
|
foreach (DataRow rw in table.Rows)
|
|
{
|
|
var isTotal = Convert.ToBoolean(rw["IsTotal"]);
|
|
var isSubTotal = Convert.ToBoolean(rw["IsSubTotal"]);
|
|
|
|
if (isTotal || isSubTotal)
|
|
{
|
|
// Sfondo grigio per la riga identificata con isTotal [quella di intestazione di area]
|
|
for (int c = 0; c < tabella.Columns.Count; c++)
|
|
{
|
|
tabella.Cells[c, i].BackgroundColor = ColorPDF.Standard_Grigio_SfondoColonnaTabella;
|
|
}
|
|
|
|
// Simboli dell'area di bisogno
|
|
if (isTotal)
|
|
{
|
|
tabella.Cells[1, i].ColSpan = 2;
|
|
tabella.Cells[1, i].Value = new AreaBisogno(rw["CodiceAreaBisogno"].ToString()).Nome;
|
|
var listaOggetti = new List<ObjectPDF>
|
|
{
|
|
new RectanglePDF(10, 10, ColorPDF.GetBy_AreaBisogno(rw["CodiceAreaBisogno"].ToString())),
|
|
new FormattedTextAreaPDF
|
|
{
|
|
Text = new AreaBisogno(rw["CodiceAreaBisogno"].ToString()).Abbreviazione,
|
|
FontBold = true,
|
|
FontColor = ColorPDF.Bianco,
|
|
DeltaX = 2.5F
|
|
}
|
|
};
|
|
|
|
//Quadrato colorato indicatore Area
|
|
tabella.Cells[0, i].ValueObjectList.AddRange(listaOggetti);
|
|
}
|
|
}
|
|
|
|
tabella.Cells[4, i].HorizontalAlignment = HorizontalAlignmentType.Destra;
|
|
tabella.Cells[5, i].Value = rw["VaR"].ToString();
|
|
i++;
|
|
}
|
|
|
|
#endregion
|
|
|
|
AddElement(tabella);
|
|
|
|
#endregion
|
|
|
|
AddElement(new SpacePDF(15));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
protected sealed override DataTable GetDataTable()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
protected sealed override DataSet GetDataSet()
|
|
{
|
|
var ds = new DataSet();
|
|
#region dtNonRappresentabiliAsset
|
|
var dtNonRappresentabiliAsset = new DataTable("dtNonRappresentabiliAsset");
|
|
dtNonRappresentabiliAsset.ExtendedProperties.Add("IndiceTabella", 1);
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("CodiceAreaBisogno", typeof(string)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("DescrizioneAreaBisogno", typeof(string)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("OrdinamentoAreaBisogno", typeof(int)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("DescrizioneProgetto", typeof(string)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("DataSottoscrizione", typeof(string)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("CodiceContratto", typeof(string)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("Descrizione", typeof(string)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("ControvaloreAttuale", typeof(decimal)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("VaR", typeof(string)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("FontBold", typeof(bool)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("CanLastRow", typeof(bool)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("IsTotal", typeof(bool)));
|
|
dtNonRappresentabiliAsset.Columns.Add(new DataColumn("IsSubTotal", typeof(bool)));
|
|
#endregion
|
|
|
|
const string stringReplaceIfZero = " ";
|
|
|
|
#region dati
|
|
var dataDettaglioProdotti = datiSeiUnico.patrimonioUnit().patrimonioCasa.dettaglioProdotti.dettaglioProdotti.ToList();
|
|
var dataProdottiNonRappresentabili_Asset = datiSeiUnico.patrimonioUnit().patrimonioCasa.assetClass.distribuzionePerProdotti.listaProdotti.Where(o => o.rappresentabile == false).ToList();
|
|
var dataProdottiNonRappresentabili_Valute = datiSeiUnico.patrimonioUnit().patrimonioCasa.esposizioneValutariaTutte.distribuzionePerProdotti.listaProdotti.Where(o => o.rappresentabile == false).ToList();
|
|
var dataProdottiNonRappresentabili_Rendimento = mostraTabella_Rendimenti() ? datiSeiUnico.patrimonioUnit().patrimonioCasa.dettaglioProdotti.dettaglioProdotti.Where(p => !p.flagRendimentoMonitoraggio).ToList() : null;
|
|
// var areaMon = mostraTabella_Rendimenti() ? datiSeiUnico.monitoraggioUnit().monitoraggio.Where(p => p.progetti != null).ToList() : null;
|
|
var displayInfo = datiSeiUnico.displayInfos();
|
|
|
|
#endregion
|
|
#region Prodotti non rappresentabili per asset
|
|
|
|
foreach (var prodotto in dataProdottiNonRappresentabili_Asset)
|
|
{
|
|
var itemPosizione = dataDettaglioProdotti.FirstOrDefault(o => o.chiavePosizionePortafoglio.Equals(prodotto.chiaveAggregazione));
|
|
//var itemPiramideModello = dataPiramideModello.FirstOrDefault(o => o.area.ToLower().Trim().Equals(itemPosizione.area.ToLower().Trim()));
|
|
var itemOrdinamento = displayInfo.areeDisplayInfos.LastOrDefault(o => o.key.ToLower() == itemPosizione.area.ToLower().Trim());
|
|
|
|
var rowProdotto = dtNonRappresentabiliAsset.NewRow();
|
|
rowProdotto["CodiceAreaBisogno"] = itemPosizione.area;
|
|
rowProdotto["DescrizioneAreaBisogno"] = itemPosizione.descAreaEstesa;
|
|
rowProdotto["OrdinamentoAreaBisogno"] = itemOrdinamento.value.order;
|
|
rowProdotto["DescrizioneProgetto"] = itemPosizione.nomeProgetto;
|
|
rowProdotto["DataSottoscrizione"] = itemPosizione.dtInizioRendimentoSpecified ?
|
|
itemPosizione.dtInizioRendimento.ToShortDateString() :
|
|
itemPosizione.dtSottoscrizione.ToShortDateString();
|
|
rowProdotto["CodiceContratto"] = itemPosizione.codContratto;
|
|
rowProdotto["Descrizione"] = itemPosizione.prodotto.nomeProdotto;
|
|
rowProdotto["ControvaloreAttuale"] = itemPosizione.ctv;
|
|
rowProdotto["VaR"] = itemPosizione.prodotto.varDecodificato;
|
|
rowProdotto["FontBold"] = false;
|
|
rowProdotto["CanLastRow"] = true;
|
|
rowProdotto["IsTotal"] = false;
|
|
rowProdotto["IsSubTotal"] = false;
|
|
dtNonRappresentabiliAsset.Rows.Add(rowProdotto);
|
|
}
|
|
|
|
if (dtNonRappresentabiliAsset.Rows.Count > 0)
|
|
ds.Tables.Add(dtNonRappresentabiliAsset);
|
|
|
|
#endregion
|
|
|
|
#region Prodotti non rappresentabili per esposizione valutaria
|
|
|
|
var dtNonRappresentabiliValute = new DataTable();
|
|
dtNonRappresentabiliValute = dtNonRappresentabiliAsset.Clone();
|
|
dtNonRappresentabiliValute.TableName = "dtNonRappresentabiliValute";
|
|
dtNonRappresentabiliValute.ExtendedProperties["IndiceTabella"] = 3;
|
|
|
|
foreach (var prodotto in dataProdottiNonRappresentabili_Valute)
|
|
{
|
|
var itemPosizione = dataDettaglioProdotti.FirstOrDefault(o => o.chiavePosizionePortafoglio.Equals(prodotto.chiaveAggregazione));
|
|
var itemOrdinamento = displayInfo.areeDisplayInfos.LastOrDefault(o => o.key.ToLower() == itemPosizione.area.ToLower().Trim());
|
|
|
|
var rowProdotto = dtNonRappresentabiliValute.NewRow();
|
|
|
|
rowProdotto["CodiceAreaBisogno"] = itemPosizione.area;
|
|
rowProdotto["DescrizioneAreaBisogno"] = itemPosizione.descAreaEstesa;
|
|
rowProdotto["OrdinamentoAreaBisogno"] = itemOrdinamento.value.order;
|
|
rowProdotto["DescrizioneProgetto"] = itemPosizione.nomeProgetto;
|
|
rowProdotto["DataSottoscrizione"] = itemPosizione.dtInizioRendimentoSpecified ?
|
|
itemPosizione.dtInizioRendimento.ToShortDateString() :
|
|
itemPosizione.dtSottoscrizione.ToShortDateString();
|
|
rowProdotto["CodiceContratto"] = itemPosizione.codContratto;
|
|
rowProdotto["Descrizione"] = itemPosizione.prodotto.nomeProdotto;
|
|
rowProdotto["ControvaloreAttuale"] = itemPosizione.ctv;
|
|
rowProdotto["VaR"] = itemPosizione.prodotto.varDecodificato;
|
|
|
|
rowProdotto["FontBold"] = false;
|
|
|
|
rowProdotto["CanLastRow"] = true;
|
|
rowProdotto["IsTotal"] = false;
|
|
rowProdotto["IsSubTotal"] = false;
|
|
|
|
dtNonRappresentabiliValute.Rows.Add(rowProdotto);
|
|
}
|
|
|
|
|
|
if (dtNonRappresentabiliValute.Rows.Count > 0)
|
|
ds.Tables.Add(dtNonRappresentabiliValute);
|
|
|
|
#endregion
|
|
if (mostraTabella_Rendimenti())
|
|
{
|
|
|
|
#region Prodotti non rappresentabili per calcolo di rendimento
|
|
|
|
var dtNonRappresentabiliRendimenti = new DataTable();
|
|
dtNonRappresentabiliRendimenti = dtNonRappresentabiliAsset.Clone();
|
|
dtNonRappresentabiliRendimenti.TableName = "dtNonRappresentabiliRendimenti";
|
|
dtNonRappresentabiliRendimenti.ExtendedProperties["IndiceTabella"] = 5;
|
|
|
|
int d = 0;
|
|
if (dataProdottiNonRappresentabili_Rendimento.Count > 0)
|
|
{
|
|
foreach (var progetti in dataProdottiNonRappresentabili_Rendimento)
|
|
{
|
|
|
|
var itemPosizione = dataDettaglioProdotti.FirstOrDefault(o => o.chiavePosizionePortafoglio.Equals(progetti.chiavePosizionePortafoglio) && o.area.ToLower() != "cc");
|
|
|
|
if (itemPosizione != null && !itemPosizione.flagRendimentoMonitoraggio)
|
|
{
|
|
var itemOrdinamento = displayInfo.areeDisplayInfos.LastOrDefault(o => o.key.ToLower() == itemPosizione.area.ToLower().Trim());
|
|
var rowProdotto = dtNonRappresentabiliRendimenti.NewRow();
|
|
d = d == 0 ? 1 : d += 1;
|
|
rowProdotto["CodiceAreaBisogno"] = itemPosizione.area;
|
|
rowProdotto["DescrizioneAreaBisogno"] = itemPosizione.descAreaEstesa;
|
|
rowProdotto["OrdinamentoAreaBisogno"] = itemOrdinamento.value.order;
|
|
rowProdotto["DescrizioneProgetto"] = itemPosizione.nomeProgetto;
|
|
rowProdotto["DataSottoscrizione"] = itemPosizione.dtInizioRendimentoSpecified ?
|
|
itemPosizione.dtInizioRendimento.ToShortDateString() :
|
|
itemPosizione.dtSottoscrizione.ToShortDateString();
|
|
rowProdotto["CodiceContratto"] = itemPosizione.codContratto;
|
|
rowProdotto["Descrizione"] = itemPosizione.prodotto.nomeProdotto;
|
|
rowProdotto["ControvaloreAttuale"] = itemPosizione.ctv;
|
|
rowProdotto["VaR"] = itemPosizione.prodotto.varDecodificato;
|
|
|
|
rowProdotto["FontBold"] = false;
|
|
|
|
rowProdotto["CanLastRow"] = true;
|
|
rowProdotto["IsTotal"] = false;
|
|
rowProdotto["IsSubTotal"] = false;
|
|
|
|
dtNonRappresentabiliRendimenti.Rows.Add(rowProdotto);
|
|
}
|
|
}
|
|
|
|
if (dtNonRappresentabiliRendimenti.Rows.Count > 0)
|
|
ds.Tables.Add(dtNonRappresentabiliRendimenti);
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
#region Raggruppamento per area di bisogno
|
|
|
|
var dsCopy = new DataSet();
|
|
dsCopy = ds.Copy();
|
|
|
|
foreach (DataTable table in dsCopy.Tables)
|
|
{
|
|
#region Prodotti raggruppati per area
|
|
|
|
var dtProdottiPerArea = new DataTable();
|
|
dtProdottiPerArea = table.Clone(); // Clono la struttura
|
|
dtProdottiPerArea.TableName = table.TableName + "_ProdottiPerArea";
|
|
|
|
var viewAree = new DataView(table) { Sort = "OrdinamentoAreaBisogno" };
|
|
var dtAree = viewAree.ToTable(true, "CodiceAreaBisogno", "DescrizioneAreaBisogno", "OrdinamentoAreaBisogno");
|
|
|
|
var area = string.Empty;
|
|
var progetto = string.Empty;
|
|
|
|
#region Prodotti delle Risorse Finanziarie
|
|
|
|
foreach (DataRow rowAreaProgetto in dtAree.Rows)
|
|
{
|
|
area = rowAreaProgetto["CodiceAreaBisogno"].ToString();
|
|
|
|
if (new AreaBisogno(area).Visibile)
|
|
{
|
|
//Progetti
|
|
var viewProgetti = new DataView(table.Select("CodiceAreaBisogno='" + area + "'").OrderByDescending(x => x.Field<decimal>("ControvaloreAttuale")).CopyToDataTable()); //{ Sort = "ControvaloreAttuale DESC" };
|
|
var dtProgetti = viewProgetti.ToTable(true, "DescrizioneProgetto");
|
|
var bIntestazioneArea = true; // la riga di intestazione dell'area va stampata una sola volta.
|
|
var bItestazioneProgetto = area == "Inv" || area == "Pre"; // la riga di intestazione del progetto va stampata solo per area Inv e Pre.
|
|
|
|
DataRow rowProdottiPerArea;
|
|
|
|
|
|
foreach (DataRow itemProgetto in dtProgetti.Rows)
|
|
{
|
|
progetto = itemProgetto["DescrizioneProgetto"].ToString();
|
|
|
|
// Subset di prodotti filtrati per Area/Progetto
|
|
var totalecontrovaloreArea = table.Select("CodiceAreaBisogno='" + area + "'").CopyToDataTable().AsEnumerable().Sum(p => p.Field<decimal>("ControvaloreAttuale"));
|
|
|
|
var dtArea = new DataView(table.Select("CodiceAreaBisogno='" + area + "' AND " + string.Format("DescrizioneProgetto ='{0}'", itemProgetto["DescrizioneProgetto"].ToString().Replace("'", "''"))).CopyToDataTable()) { Sort = "ControvaloreAttuale DESC" }.ToTable();
|
|
var dtAreaProgetto = table.Select("CodiceAreaBisogno='" + area + "' AND " + string.Format("DescrizioneProgetto ='{0}'", itemProgetto["DescrizioneProgetto"].ToString().Replace("'", "''"))).OrderByDescending(x => x.Field<decimal>("ControvaloreAttuale")).CopyToDataTable();
|
|
|
|
if (bIntestazioneArea)
|
|
{
|
|
#region riga con background grigio di intestazione per ogni area
|
|
|
|
rowProdottiPerArea = dtProdottiPerArea.NewRow();
|
|
rowProdottiPerArea["CodiceAreaBisogno"] = rowAreaProgetto["CodiceAreaBisogno"];
|
|
rowProdottiPerArea["DataSottoscrizione"] = rowAreaProgetto["DescrizioneAreaBisogno"];
|
|
|
|
// Totali per area
|
|
rowProdottiPerArea["ControvaloreAttuale"] = totalecontrovaloreArea;// dtArea.AsEnumerable().Sum(p => p.Field<decimal>("ControvaloreAttuale"));
|
|
rowProdottiPerArea["VaR"] = "";
|
|
rowProdottiPerArea["FontBold"] = true;
|
|
|
|
rowProdottiPerArea["CanLastRow"] = false;
|
|
rowProdottiPerArea["IsTotal"] = true;
|
|
rowProdottiPerArea["IsSubTotal"] = false;
|
|
dtProdottiPerArea.Rows.Add(rowProdottiPerArea);
|
|
|
|
bIntestazioneArea = false;
|
|
#endregion
|
|
}
|
|
|
|
if (bItestazioneProgetto)
|
|
{
|
|
#region Riga con background grigio di intestazione per ogni Progetto
|
|
|
|
rowProdottiPerArea = dtProdottiPerArea.NewRow();
|
|
rowProdottiPerArea["CodiceAreaBisogno"] = rowAreaProgetto["CodiceAreaBisogno"];
|
|
rowProdottiPerArea["DataSottoscrizione"] = progetto;
|
|
|
|
// Totali per area
|
|
rowProdottiPerArea["ControvaloreAttuale"] = dtArea.AsEnumerable().Where(o => o.Field<string>("DescrizioneProgetto").Equals(progetto)).Sum(p => p.Field<decimal>("ControvaloreAttuale"));
|
|
rowProdottiPerArea["VaR"] = "";
|
|
rowProdottiPerArea["FontBold"] = true;
|
|
|
|
rowProdottiPerArea["CanLastRow"] = false;
|
|
rowProdottiPerArea["IsTotal"] = false;
|
|
rowProdottiPerArea["IsSubTotal"] = true;
|
|
|
|
dtProdottiPerArea.Rows.Add(rowProdottiPerArea);
|
|
|
|
#endregion
|
|
}
|
|
|
|
// I prodotti della dtProdotti vengono mergiati sulla dtProdottiPerArea
|
|
dtProdottiPerArea.Merge(dtArea);
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
ds.Tables.Add(dtProdottiPerArea);
|
|
}
|
|
|
|
#endregion
|
|
|
|
return ds;
|
|
}
|
|
|
|
public virtual bool mostraTabella_Asset(){return GetOption<Opzione4_1>().Valore;}
|
|
public virtual bool mostraTabella_Valute(){return GetOption<Opzione4_2>().Valore;}
|
|
public virtual bool mostraTabella_Rendimenti() { return GetOption<Opzione4_3>().Valore; }
|
|
|
|
}
|
|
}
|