497 lines
26 KiB
C#
497 lines
26 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Data;
|
|
|
|
// cercare la stringa manca per individuare le parti mancanti
|
|
|
|
namespace PDFGenerator.BusinessLayer.DataSection
|
|
{
|
|
class DSS80BISEvoluzioneRischio : IDataSection
|
|
{
|
|
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
public DSS80BISEvoluzioneRischio()
|
|
{
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
|
|
public DataSectionResult getDataSection(List<SessionStruct> tabelleSessione, string querySql, DataThread dataThread)
|
|
{
|
|
|
|
try {
|
|
|
|
DataSectionResult dsr = new DataSectionResult();
|
|
|
|
|
|
FormatNum formatNum = new FormatNum();
|
|
//dati del grafico + dati della tabella
|
|
|
|
DataTable dt = SectionManager.GetDataSection(tabelleSessione, querySql, dataThread);
|
|
DataSetS80BIS ds80BIS = new DataSetS80BIS();
|
|
|
|
|
|
// dati tabella
|
|
DataView dv = new DataView(dt);
|
|
DataTable dtDatiTabella = dv.ToTable("VaRMassimoProfiloFinanziario", true, "Fase", "varcomplessivo", "copertura");
|
|
// MZ-03052010: Number of Columns to be displayed in the table.
|
|
int nColonne = dtDatiTabella.Rows.Count; // numero di colonne da mostrare, corrisponde al nuemro delle FASI
|
|
|
|
//Se è presente un solo istogramma la sezione non viene mostrata
|
|
//Richiesta fatta dal cliente.
|
|
if (nColonne > 1)
|
|
{
|
|
// The starting of monitoring date.
|
|
DateTime? dataAvvioMonitoraggio = null;
|
|
DateTime dataPrecedenteInvioReport = new DateTime();
|
|
|
|
// Set Phase 1 date
|
|
#region Data Avvio Monitoraggio
|
|
|
|
DataView dvAvvioMonitoraggio = new DataView(dt);
|
|
dvAvvioMonitoraggio.RowFilter = ("Fase = 1");
|
|
if (dvAvvioMonitoraggio.Count > 0)
|
|
{
|
|
DataRow row = dvAvvioMonitoraggio[0].Row;
|
|
dataAvvioMonitoraggio = Convert.ToDateTime(row["DataFase"].ToString());
|
|
}
|
|
#endregion
|
|
|
|
// Set Phase 2 date
|
|
#region Data Precedente Invio Report
|
|
|
|
DataView dwPrecedenteInvioReport = new DataView(dt);
|
|
dwPrecedenteInvioReport.RowFilter = ("Fase = 2");
|
|
if (dwPrecedenteInvioReport.Count > 0)
|
|
{
|
|
DataRow rowPrecedenteInvioReport = dwPrecedenteInvioReport[0].Row;
|
|
dataPrecedenteInvioReport = Convert.ToDateTime(rowPrecedenteInvioReport["DataFase"].ToString());
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region VaR massimo profilo finanziario
|
|
// The data rows of each phase.
|
|
DataRow[] drFase1 = dt.Select(" fase = 1");
|
|
DataRow[] drFase2 = dt.Select(" fase = 2");
|
|
DataRow[] drFase3 = dt.Select(" fase = 3");
|
|
|
|
|
|
|
|
// caption dell' header della Tabella
|
|
if (dataAvvioMonitoraggio.HasValue)
|
|
{
|
|
ds80BIS.VaRMassimoProfiloFinanziario.DescrizioneColumn.Caption = string.Empty; // la setto a stringa vuota
|
|
ds80BIS.VaRMassimoProfiloFinanziario.Fase1Column.Caption = "Avvio Monitoraggio <BR>(" + dataAvvioMonitoraggio.Value.ToShortDateString() + ")";
|
|
}
|
|
|
|
if (dwPrecedenteInvioReport.Count > 0)
|
|
ds80BIS.VaRMassimoProfiloFinanziario.Fase2Column.Caption = "Precedente invio report <BR>(" + dataPrecedenteInvioReport.ToShortDateString() + ")";
|
|
else
|
|
ds80BIS.VaRMassimoProfiloFinanziario.Fase2Column.Caption = string.Empty;
|
|
|
|
ds80BIS.VaRMassimoProfiloFinanziario.Fase3Column.Caption = "Situazione Corrente <BR>(" + dataThread.DataFineTrimestreCorrente.ToShortDateString() + ")";
|
|
|
|
|
|
DataSetS80BIS.VaRMassimoProfiloFinanziarioRow rowVaRMassimoProfiloFinanziario;
|
|
rowVaRMassimoProfiloFinanziario = ds80BIS.VaRMassimoProfiloFinanziario.NewVaRMassimoProfiloFinanziarioRow();
|
|
rowVaRMassimoProfiloFinanziario.Descrizione = "VaR massimo profilo finanziario";
|
|
string varmassimo;
|
|
if (drFase1.Length > 0)
|
|
{
|
|
varmassimo = (drFase1.Length == 0 || drFase1[0]["VaRMassimoProfiloFinanziario"].ToString() == string.Empty ? "0,00%" : formatNum.ConvertNum(SoglieVar.ConvOld(drFase1[0]["VaRMassimoProfiloFinanziario"]), 2) + " %");
|
|
// if (dataThread.IsProffesionalClient && dataThread.RiskArea == 5)
|
|
// {
|
|
// varmassimo = "50,00%";
|
|
// }
|
|
rowVaRMassimoProfiloFinanziario.Fase1 = varmassimo;
|
|
rowVaRMassimoProfiloFinanziario.ValoreFase1 = (drFase1.Length == 0 || drFase1[0]["VaRMassimoProfiloFinanziario"].ToString() == string.Empty ? 0 : Convert.ToDecimal(SoglieVar.ConvOld(drFase1[0]["VaRMassimoProfiloFinanziario"])));
|
|
}
|
|
|
|
|
|
if (drFase2.Length > 0)
|
|
{
|
|
varmassimo = (drFase2.Length == 0 || drFase2[0]["VaRMassimoProfiloFinanziario"].ToString() == string.Empty ? "0,00%" : formatNum.ConvertNum(SoglieVar.ConvOld(drFase2[0]["VaRMassimoProfiloFinanziario"]), 2) + " %");
|
|
// if (dataThread.IsProffesionalClient && dataThread.RiskArea == 5)
|
|
// {
|
|
// varmassimo = "50,00%";
|
|
// }
|
|
rowVaRMassimoProfiloFinanziario.Fase2 = varmassimo;
|
|
rowVaRMassimoProfiloFinanziario.ValoreFase2 = (drFase2.Length == 0 || drFase2[0]["VaRMassimoProfiloFinanziario"].ToString() == string.Empty ? 0 : Convert.ToDecimal(SoglieVar.ConvOld(drFase2[0]["VaRMassimoProfiloFinanziario"])));
|
|
}
|
|
|
|
|
|
if (drFase3.Length > 0)
|
|
{
|
|
varmassimo = (drFase3.Length == 0 || drFase3[0]["VaRMassimoProfiloFinanziario"].ToString() == string.Empty ? "0,00%" : formatNum.ConvertNum(SoglieVar.ConvOld(drFase3[0]["VaRMassimoProfiloFinanziario"]), 2) + " %");
|
|
if (dataThread.IsProffesionalClient && dataThread.RiskArea == 5)
|
|
{
|
|
varmassimo = "50,00%";
|
|
}
|
|
rowVaRMassimoProfiloFinanziario.Fase3 = varmassimo;
|
|
rowVaRMassimoProfiloFinanziario.ValoreFase3 = (drFase3.Length == 0 || drFase3[0]["VaRMassimoProfiloFinanziario"].ToString() == string.Empty ? 0 : Convert.ToDecimal(SoglieVar.ConvOld(drFase3[0]["VaRMassimoProfiloFinanziario"])));
|
|
}
|
|
|
|
rowVaRMassimoProfiloFinanziario.NumeroFasi = nColonne;
|
|
ds80BIS.VaRMassimoProfiloFinanziario.AddVaRMassimoProfiloFinanziarioRow(rowVaRMassimoProfiloFinanziario);
|
|
|
|
#endregion
|
|
|
|
#region VaR
|
|
//DataRow[] drFase1 = dt.Select(" fase = 1");
|
|
//DataRow[] drFase2 = dt.Select(" fase = 2");
|
|
//DataRow[] drFase3 = dt.Select(" fase = 3");
|
|
|
|
string VaRFase1 = string.Empty;
|
|
string VaRFase2 = string.Empty;
|
|
string VaRFase3 = string.Empty;
|
|
|
|
// dati per la FASE 1
|
|
if (drFase1.Length > 0)
|
|
{
|
|
if (Convert.ToSingle(drFase1[0]["varcomplessivo"]) == -1000)
|
|
VaRFase1 = "n.c.";
|
|
else
|
|
VaRFase1 = (drFase1.Length == 0 || drFase1[0]["varcomplessivo"].ToString() == string.Empty ? "0,00%" : formatNum.ConvertNum(drFase1[0]["varcomplessivo"], 2) + " %");
|
|
}
|
|
//V aggiunta perchè mancava 17/12/2009
|
|
// dati per la FASE 2
|
|
if (drFase2.Length > 0)
|
|
VaRFase2 = (drFase2.Length == 0 || drFase2[0]["varcomplessivo"].ToString() == string.Empty ? "0,00%" : formatNum.ConvertNum(drFase2[0]["varcomplessivo"], 2) + " %");
|
|
//
|
|
|
|
// dati per la FASE 3
|
|
if (drFase3.Length > 0)
|
|
VaRFase3 = (drFase3.Length == 0 || drFase3[0]["varcomplessivo"].ToString() == string.Empty ? "0,00%" : formatNum.ConvertNum(drFase3[0]["varcomplessivo"], 2) + " %");
|
|
|
|
|
|
|
|
|
|
DataSetS80BIS.VaRRow rowVaR;
|
|
rowVaR = ds80BIS.VaR.NewVaRRow();
|
|
rowVaR.Descrizione = "Rischio (VaR %)";
|
|
rowVaR.Fase1 = VaRFase1;
|
|
rowVaR.Fase2 = VaRFase2;
|
|
rowVaR.Fase3 = VaRFase3;
|
|
|
|
rowVaR.ValoreFase1 = (drFase1.Length == 0 || drFase1[0]["varcomplessivo"].ToString() == string.Empty ? 0 : Convert.ToDecimal(drFase1[0]["varcomplessivo"]));
|
|
rowVaR.ValoreFase2 = (drFase2.Length == 0 || drFase2[0]["varcomplessivo"].ToString() == string.Empty ? 0 : Convert.ToDecimal(drFase2[0]["varcomplessivo"]));
|
|
rowVaR.ValoreFase3 = (drFase3.Length == 0 || drFase3[0]["varcomplessivo"].ToString() == string.Empty ? 0 : Convert.ToDecimal(drFase3[0]["varcomplessivo"]));
|
|
|
|
#region Indicatori OK/NO
|
|
// Se non è possibile il confronto tra il Var Max e il Var di portafoglio ,
|
|
// ovvero se manca uno dei due quindi decade la possibilità di fare il confronto, non devono esserci gli indicatori (OK-NO)
|
|
DateTime cend = DateTime.MinValue ;
|
|
if (dataThread.IsProffesionalClient)
|
|
{
|
|
try
|
|
{
|
|
cend = dataThread.ContractSubscriptionDate;
|
|
}catch(Exception ex)
|
|
{
|
|
logger.Error("Error in dataThread.ContractSubscriptionDate - missing data in vcontratti");
|
|
throw ex;
|
|
}
|
|
DateTime fase;
|
|
decimal valore;
|
|
if (!rowVaRMassimoProfiloFinanziario.IsFase1Null())
|
|
{
|
|
valore = 50;
|
|
fase = (DateTime)drFase1[0]["dataFase"];
|
|
if (fase < cend) valore = 27;
|
|
|
|
if (rowVaR.ValoreFase1 <= valore)
|
|
rowVaR.IMAGE_Fase1 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
else
|
|
rowVaR.IMAGE_Fase1 = WebConfigParameter.getParameter("FlagNO_RIDOTTA");
|
|
}
|
|
|
|
if (!rowVaRMassimoProfiloFinanziario.IsFase2Null())
|
|
{
|
|
|
|
valore = 50;
|
|
fase = (DateTime)drFase2[0]["dataFase"];
|
|
if (fase < cend) valore = 27;
|
|
|
|
if (rowVaR.ValoreFase2 <= valore)
|
|
rowVaR.IMAGE_Fase2 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
else
|
|
rowVaR.IMAGE_Fase2 = WebConfigParameter.getParameter("FlagNO_RIDOTTA");
|
|
}
|
|
|
|
if (!rowVaRMassimoProfiloFinanziario.IsFase3Null())
|
|
{
|
|
valore = 50;
|
|
fase = (DateTime)drFase3[0]["dataFase"];
|
|
if (fase < cend) valore = 27;
|
|
|
|
if (rowVaR.ValoreFase3 <= valore)
|
|
rowVaR.IMAGE_Fase3 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
else
|
|
rowVaR.IMAGE_Fase3 = WebConfigParameter.getParameter("FlagNO_RIDOTTA");
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
//if (rowVaR.ValoreFase1 != 0M && rowVaRMassimoProfiloFinanziario.ValoreFase1 != 0M)
|
|
if (!rowVaRMassimoProfiloFinanziario.IsFase1Null())
|
|
//if (rowVaRMassimoProfiloFinanziario.ValoreFase1 != 0M)
|
|
{
|
|
if (rowVaR.ValoreFase1 <= rowVaRMassimoProfiloFinanziario.ValoreFase1)
|
|
rowVaR.IMAGE_Fase1 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
else
|
|
rowVaR.IMAGE_Fase1 = WebConfigParameter.getParameter("FlagNO_RIDOTTA");
|
|
}
|
|
|
|
//if (rowVaR.ValoreFase2 != 0M && rowVaRMassimoProfiloFinanziario.ValoreFase2 != 0M)
|
|
if (!rowVaRMassimoProfiloFinanziario.IsFase2Null())
|
|
//V in the case of only 2 phase (1 and 3) the code is broken here
|
|
//if (rowVaRMassimoProfiloFinanziario.ValoreFase2 != 0M)
|
|
{
|
|
if (rowVaR.ValoreFase2 <= rowVaRMassimoProfiloFinanziario.ValoreFase2)
|
|
rowVaR.IMAGE_Fase2 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
else
|
|
rowVaR.IMAGE_Fase2 = WebConfigParameter.getParameter("FlagNO_RIDOTTA");
|
|
}
|
|
|
|
//if (rowVaR.ValoreFase3 != 0M && rowVaRMassimoProfiloFinanziario.ValoreFase3 != 0M)
|
|
if (!rowVaRMassimoProfiloFinanziario.IsFase3Null())
|
|
//if (rowVaRMassimoProfiloFinanziario.ValoreFase3 != 0M)
|
|
{
|
|
if (rowVaR.ValoreFase3 <= rowVaRMassimoProfiloFinanziario.ValoreFase3)
|
|
rowVaR.IMAGE_Fase3 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
else
|
|
rowVaR.IMAGE_Fase3 = WebConfigParameter.getParameter("FlagNO_RIDOTTA");
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
ds80BIS.VaR.AddVaRRow(rowVaR);
|
|
|
|
#endregion
|
|
|
|
#region Copertura
|
|
|
|
DataSetS80BIS.CoperturaRow rowCopertura;
|
|
rowCopertura = ds80BIS.Copertura.NewCoperturaRow();
|
|
rowCopertura.Descrizione = "Copertura";
|
|
|
|
if (drFase1.Length > 0)
|
|
{
|
|
if (Convert.ToSingle(drFase1[0]["copertura"].ToString()) == -1000)
|
|
rowCopertura.Fase1 = "n.c.";
|
|
else
|
|
rowCopertura.Fase1 = (drFase1.Length == 0 || drFase1[0]["copertura"].ToString() == string.Empty ? "0,00 %" : formatNum.ConvertNum(drFase1[0]["copertura"], 2) + " %");
|
|
}
|
|
if (drFase2.Length > 0)
|
|
rowCopertura.Fase2 = (drFase2.Length == 0 || drFase2[0]["copertura"].ToString() == string.Empty ? "0,00 %" : formatNum.ConvertNum(drFase2[0]["copertura"], 2) + " %");
|
|
|
|
if (drFase3.Length > 0)
|
|
rowCopertura.Fase3 = (drFase3.Length == 0 || drFase3[0]["copertura"].ToString() == string.Empty ? "0,00 %" : formatNum.ConvertNum(drFase3[0]["copertura"], 2) + " %");
|
|
|
|
// se per tutti e 3 gli istogrammi il grado di copertura= 100 la riga non viene visualizzata
|
|
decimal valoreCoperturaFase1 = 100;
|
|
decimal valoreCoperturaFase2 = 100;
|
|
decimal valoreCoperturaFase3 = 100;
|
|
if (drFase1.Length > 0)
|
|
valoreCoperturaFase1 = (drFase1.Length == 0 || drFase1[0]["copertura"].ToString() == string.Empty ? 100 : decimal.Round(Convert.ToDecimal(drFase1[0]["copertura"].ToString()), 2));
|
|
|
|
if (drFase2.Length > 0)
|
|
valoreCoperturaFase2 = (drFase2.Length == 0 || drFase2[0]["copertura"].ToString() == string.Empty ? 100 : decimal.Round(Convert.ToDecimal(drFase2[0]["copertura"].ToString()), 2));
|
|
|
|
if (drFase3.Length > 0)
|
|
valoreCoperturaFase3 = (drFase3.Length == 0 || drFase3[0]["copertura"].ToString() == string.Empty ? 100 : decimal.Round(Convert.ToDecimal(drFase3[0]["copertura"].ToString()), 2));
|
|
|
|
|
|
if (valoreCoperturaFase1 + valoreCoperturaFase2 + valoreCoperturaFase3 < 300)
|
|
ds80BIS.Copertura.AddCoperturaRow(rowCopertura);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
// Marian
|
|
///////////////////////////////////
|
|
#region RiskClassMax
|
|
|
|
|
|
//string RiskClassMaxFase1 = string.Empty;
|
|
//string RiskClassMaxFase2 = string.Empty;
|
|
//string RiskClassMaxFase3 = string.Empty;
|
|
//string riskClassMaxClassName = string.Empty;
|
|
|
|
//// dati per la FASE 1
|
|
|
|
//if (drFase1.Length > 0)
|
|
//{
|
|
|
|
// if (drFase1[0]["RiskClassMax"].ToString() != "0")
|
|
// riskClassMaxClassName = UtilityBusinessLayer.GetRiskCreditClassName(drFase1[0]["RiskClassMax"].ToString());
|
|
|
|
|
|
// RiskClassMaxFase1 = (drFase1.Length != 0 && drFase1[0]["RiskClassMaxString"].ToString() != string.Empty ? drFase1[0]["RiskClassMaxString"].ToString() : riskClassMaxClassName);
|
|
//}
|
|
|
|
////V aggiunta perchè mancava 17/12/2009
|
|
//// dati per la FASE 2
|
|
//if (drFase2.Length > 0)
|
|
//{
|
|
// if (drFase2[0]["RiskClassMax"].ToString() != "0")
|
|
// riskClassMaxClassName = UtilityBusinessLayer.GetRiskCreditClassName(drFase2[0]["RiskClassMax"].ToString());
|
|
|
|
// RiskClassMaxFase2 = (drFase2.Length != 0 && drFase2[0]["RiskClassMaxString"].ToString() != string.Empty ? drFase2[0]["RiskClassMaxString"].ToString() : riskClassMaxClassName);
|
|
//}
|
|
////
|
|
|
|
//// dati per la FASE 3
|
|
//if (drFase3.Length > 0)
|
|
//{
|
|
// if (drFase3[0]["RiskClassMax"].ToString() != "0")
|
|
// riskClassMaxClassName = UtilityBusinessLayer.GetRiskCreditClassName(drFase3[0]["RiskClassMax"].ToString());
|
|
|
|
// RiskClassMaxFase3 = (drFase3.Length != 0 && drFase3[0]["RiskClassMaxString"].ToString() != string.Empty ? drFase3[0]["RiskClassMaxString"].ToString() : riskClassMaxClassName);
|
|
//}
|
|
|
|
|
|
|
|
|
|
//DataSetS80BIS.RiskClassMaxRow rowRiskClassMax;
|
|
//rowRiskClassMax = ds80BIS.RiskClassMax.NewRiskClassMaxRow();
|
|
//rowRiskClassMax.Descrizione = "Rischio Credito massimo";
|
|
//rowRiskClassMax.Fase1 = RiskClassMaxFase1;
|
|
//rowRiskClassMax.Fase2 = RiskClassMaxFase2;
|
|
//rowRiskClassMax.Fase3 = RiskClassMaxFase3;
|
|
|
|
//rowRiskClassMax.ValoreFase1 = (drFase1.Length == 0 || drFase1[0]["RiskClassMaxString"].ToString() != string.Empty ? 0 : Convert.ToInt32(drFase1[0]["RiskClassMax"]));
|
|
//rowRiskClassMax.ValoreFase2 = (drFase2.Length == 0 || drFase2[0]["RiskClassMaxString"].ToString() != string.Empty ? 0 : Convert.ToInt32(drFase2[0]["RiskClassMax"]));
|
|
//rowRiskClassMax.ValoreFase3 = (drFase3.Length == 0 || drFase3[0]["RiskClassMaxString"].ToString() != string.Empty ? 0 : Convert.ToInt32(drFase3[0]["RiskClassMax"]));
|
|
|
|
|
|
|
|
//ds80BIS.RiskClassMax.AddRiskClassMaxRow(rowRiskClassMax);
|
|
|
|
#endregion
|
|
///////////////////////////////////
|
|
|
|
///////////////////
|
|
#region RiskClass
|
|
////DataRow[] drFase1 = dt.Select(" fase = 1");
|
|
////DataRow[] drFase2 = dt.Select(" fase = 2");
|
|
////DataRow[] drFase3 = dt.Select(" fase = 3");
|
|
|
|
//string RiskClassFase1 = string.Empty;
|
|
//string RiskClassFase2 = string.Empty;
|
|
//string RiskClassFase3 = string.Empty;
|
|
//string riskClassName = string.Empty;
|
|
|
|
//// dati per la FASE 1
|
|
//if (drFase1.Length > 0)
|
|
//{
|
|
// if (drFase1[0]["RiskClass"].ToString() != "0")
|
|
// riskClassName = UtilityBusinessLayer.GetRiskCreditClassName(drFase1[0]["RiskClass"].ToString());
|
|
|
|
// RiskClassFase1 = (drFase1.Length != 0 && drFase1[0]["RiskClassString"].ToString() != string.Empty ? drFase1[0]["RiskClassString"].ToString() : riskClassName);
|
|
//}
|
|
|
|
////V aggiunta perchè mancava 17/12/2009
|
|
//// dati per la FASE 2
|
|
//if (drFase2.Length > 0)
|
|
//{
|
|
// if (drFase2[0]["RiskClass"].ToString() != "0")
|
|
// riskClassName = UtilityBusinessLayer.GetRiskCreditClassName(drFase2[0]["RiskClass"].ToString());
|
|
// RiskClassFase2 = (drFase2.Length != 0 && drFase2[0]["RiskClassString"].ToString() != string.Empty ? drFase2[0]["RiskClassString"].ToString() : riskClassName);
|
|
//}
|
|
////
|
|
|
|
//// dati per la FASE 3
|
|
//if (drFase3.Length > 0)
|
|
//{
|
|
// if (drFase3[0]["RiskClass"].ToString() != "0")
|
|
// riskClassName = UtilityBusinessLayer.GetRiskCreditClassName(drFase3[0]["RiskClass"].ToString());
|
|
// RiskClassFase3 = (drFase3.Length != 0 && drFase3[0]["RiskClassString"].ToString() != string.Empty ? drFase3[0]["RiskClassString"].ToString() : riskClassName);
|
|
//}
|
|
|
|
|
|
|
|
|
|
//DataSetS80BIS.RiskClassRow rowRiskClass;
|
|
//rowRiskClass = ds80BIS.RiskClass.NewRiskClassRow();
|
|
//rowRiskClass.Descrizione = "Rischio Credito";
|
|
//rowRiskClass.Fase1 = RiskClassFase1;
|
|
//rowRiskClass.Fase2 = RiskClassFase2;
|
|
//rowRiskClass.Fase3 = RiskClassFase3;
|
|
|
|
//rowRiskClass.ValoreFase1 = (drFase1.Length == 0 || drFase1[0]["RiskClassString"].ToString() != string.Empty ? 0 : Convert.ToInt32(drFase1[0]["RiskClass"]));
|
|
//rowRiskClass.ValoreFase2 = (drFase2.Length == 0 || drFase2[0]["RiskClassString"].ToString() != string.Empty ? 0 : Convert.ToInt32(drFase2[0]["RiskClass"]));
|
|
//rowRiskClass.ValoreFase3 = (drFase3.Length == 0 || drFase3[0]["RiskClassString"].ToString() != string.Empty ? 0 : Convert.ToInt32(drFase3[0]["RiskClass"]));
|
|
|
|
//#region Indicatori OK/NO
|
|
//// Se non è possibile il confronto tra il Var Max e il Var di portafoglio ,
|
|
//// ovvero se manca uno dei due quindi decade la possibilità di fare il confronto, non devono esserci gli indicatori (OK-NO)
|
|
|
|
//if (RiskClassFase1 == "n.a.")
|
|
// rowRiskClass.IMAGE_Fase1 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
|
|
//if (rowRiskClass.ValoreFase1 != 0 && rowRiskClassMax.ValoreFase1 != 0)
|
|
//{
|
|
// if (rowRiskClass.ValoreFase1 <= rowRiskClassMax.ValoreFase1)
|
|
// rowRiskClass.IMAGE_Fase1 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
// else
|
|
// rowRiskClass.IMAGE_Fase1 = WebConfigParameter.getParameter("FlagNO_RIDOTTA");
|
|
//}
|
|
|
|
//if (RiskClassFase2 == "n.a.")
|
|
// rowRiskClass.IMAGE_Fase2 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
|
|
//if (rowRiskClass.ValoreFase2 != 0 && rowRiskClassMax.ValoreFase2 != 0)
|
|
//{
|
|
// if (rowRiskClass.ValoreFase2 <= rowRiskClassMax.ValoreFase2)
|
|
// rowRiskClass.IMAGE_Fase2 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
// else
|
|
// rowRiskClass.IMAGE_Fase2 = WebConfigParameter.getParameter("FlagNO_RIDOTTA");
|
|
//}
|
|
|
|
//if (RiskClassFase3 == "n.a.")
|
|
// rowRiskClass.IMAGE_Fase3 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
|
|
//if (rowRiskClass.ValoreFase3 != 0 && rowRiskClassMax.ValoreFase3 != 0)
|
|
//{
|
|
// if (rowRiskClass.ValoreFase3 <= rowRiskClassMax.ValoreFase3)
|
|
// rowRiskClass.IMAGE_Fase3 = WebConfigParameter.getParameter("FlagOK_RIDOTTA");
|
|
// else
|
|
// rowRiskClass.IMAGE_Fase3 = WebConfigParameter.getParameter("FlagNO_RIDOTTA");
|
|
//}
|
|
//#endregion
|
|
|
|
//ds80BIS.RiskClass.AddRiskClassRow(rowRiskClass);
|
|
|
|
#endregion
|
|
//////////////////
|
|
|
|
dsr.DatiSezione = ds80BIS;
|
|
dsr.Esito = ds80BIS.VaR.Count;
|
|
}
|
|
else
|
|
{
|
|
dsr.Esito = 0;
|
|
}
|
|
|
|
return dsr;
|
|
|
|
}catch(Exception ex)
|
|
{
|
|
try {
|
|
logger.Error(String.Concat(dataThread.CodiceFiscale, " ", ex.Message," ", querySql));
|
|
}
|
|
catch { }
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|