332 lines
12 KiB
C#
332 lines
12 KiB
C#
using System;
|
||
using System.Data;
|
||
using System.Web;
|
||
using System.Web.UI;
|
||
using PrometeiaMessage.bancafideuram.nac.profilazione;
|
||
using ConsulenzaEvoluta;
|
||
|
||
|
||
[ControlValuePropertyAttribute("Checked")]
|
||
public partial class schedeDiLavoro : System.Web.UI.Page
|
||
{
|
||
public string codiceFiscale;
|
||
public string codiceRete;
|
||
public string codicePB;
|
||
public string pathNav;
|
||
public string checkPrivacy;
|
||
public string chkPatrComp;
|
||
public string chkAnRischio;
|
||
public string chkPatrAltri;
|
||
public string chkPatrBF;
|
||
public string tipoCliente;
|
||
public string token;
|
||
|
||
//public string absolutePrivacy; //absolute
|
||
//public string privacy; //relative
|
||
|
||
private DataTable dtMenuCaratteristichePatrimonio;
|
||
private DataTable dtMenuCaratteristicheVarie;
|
||
|
||
#region Web Form Designer generated code
|
||
|
||
override protected void OnInit(EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
//
|
||
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
|
||
//
|
||
InitializeComponent();
|
||
base.OnInit(e);
|
||
}
|
||
catch (Exception)
|
||
{
|
||
|
||
}
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// Required method for Designer support - do not modify
|
||
/// the contents of this method with the code editor.
|
||
/// </summary>
|
||
private void InitializeComponent()
|
||
{
|
||
|
||
}
|
||
|
||
#endregion
|
||
|
||
private Cliente cliente;
|
||
|
||
protected void Page_Load(object sender, System.EventArgs e)
|
||
{
|
||
dtMenuCaratteristichePatrimonio = new DataTable();
|
||
dtMenuCaratteristicheVarie = new DataTable();
|
||
|
||
codiceFiscale = Request.QueryString.Get("codCliente");
|
||
codiceRete = Request.QueryString.Get("tipoRete");
|
||
codicePB = Request.QueryString.Get("codPB");
|
||
pathNav = Request.QueryString.Get("pathNav");
|
||
token = Request.QueryString.Get("token");
|
||
|
||
cliente = Cliente.getCliente(codiceRete + codicePB, codiceFiscale);
|
||
|
||
if (!Page.IsPostBack)
|
||
{
|
||
//lettura del valore PRIVACY ABSOLUTE dal cookie
|
||
//HttpCookie ck_absolutePrivacy = System.Web.HttpContext.Current.Request.Cookies["absolutePrivacy"];
|
||
|
||
//if (ck_absolutePrivacy == null)
|
||
// absolutePrivacy = "0";
|
||
//else
|
||
// absolutePrivacy = ck_absolutePrivacy.Value.ToString();
|
||
|
||
//if (privacy == "" || privacy == null)
|
||
// privacy = absolutePrivacy;
|
||
|
||
#region Nuova gestione privacy
|
||
|
||
if (cliente.SottoscrizioneContrattoSei)
|
||
{
|
||
RadioButton1.Checked = true;
|
||
RadioButton1.Enabled = true;
|
||
RadioButton2.Enabled = true;
|
||
lbl_Privacy.Visible = false;
|
||
}
|
||
else
|
||
{
|
||
RadioButton2.Checked = true;
|
||
RadioButton1.Enabled = false;
|
||
this.lbl_Privacy.Visible = true;
|
||
lbl_Privacy.Text = "La reportistica nominativa pu<70> essere stampata per i clienti che hanno sottoscritto la consulenza evoluta SEI";
|
||
}
|
||
#endregion
|
||
|
||
}
|
||
|
||
if (codiceRete != "F")
|
||
chk_PatrimonioBancaFideuram.Text = "Patrimonio Sanpaolo Invest";
|
||
|
||
|
||
this.LoadDati(codiceFiscale, codiceRete, codicePB);
|
||
|
||
this.chk_PatrimonioComplessivoCliente();
|
||
|
||
//this.LoadProfilatura();
|
||
|
||
this.LoadPiramideSimulazione();
|
||
|
||
this.LoadPiramideModello();
|
||
}
|
||
|
||
protected void chk_PatrimonioComplessivoCliente()
|
||
{
|
||
if (dtMenuCaratteristichePatrimonio.Rows.Count != 0)
|
||
{
|
||
if (Convert.ToInt32(dtMenuCaratteristichePatrimonio.Rows[0]["cf_patrimonioterzi"]) != 0)
|
||
{
|
||
if (Convert.ToInt32(dtMenuCaratteristichePatrimonio.Rows[0]["cf_con_port_bf"]) == 0)
|
||
{
|
||
//nel caso il cliente ha solo il CC presso BF lo trattiamo come "prospect"
|
||
stampa_MigrazioneProdotti.Disabled = true;
|
||
//tipoCliente = "Prospect";
|
||
btnConfronto.Disabled = true;
|
||
chk_PatrimonioBancaFideuram.Checked = false;
|
||
chk_PatrimonioBancaFideuram.Enabled = false;
|
||
//chk_PatrimonioComplessivo.Enabled = false;
|
||
//chk_PatrimonioComplessivo.Checked = false;
|
||
}
|
||
|
||
chk_PatrimonioAltriIstituti.Enabled = true;
|
||
}
|
||
else
|
||
{
|
||
if (Convert.ToInt32(dtMenuCaratteristichePatrimonio.Rows[0]["cf_con_port_bf"]) == 0)
|
||
{
|
||
//Non ho ne patrimonio altri isituti ne banca fideuram
|
||
btnConfronto.Disabled = true;
|
||
stampa_MigrazioneProdotti.Disabled = true;
|
||
//stampa_PatrimonioCliente.Disabled = true;
|
||
chk_PatrimonioComplessivo.Enabled = false;
|
||
chk_PatrimonioComplessivo.Checked = false;
|
||
chk_PatrimonioBancaFideuram.Enabled = false;
|
||
chk_PatrimonioBancaFideuram.Checked = false;
|
||
//chk_AnalisiRischio.Enabled = false;
|
||
//chk_AnalisiRischio.Checked = false;
|
||
|
||
//nel caso il cliente ha solo il CC presso BF lo trattiamo come "prospect"
|
||
//tipoCliente = "Prospect";
|
||
}
|
||
chk_PatrimonioAltriIstituti.Enabled = false;
|
||
chk_PatrimonioAltriIstituti.Checked = false;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//La query non ha restituito niente disabilito tutto
|
||
stampa_PatrimonioCliente.Disabled = true;
|
||
stampa_MigrazioneProdotti.Disabled = true;
|
||
chk_PatrimonioComplessivo.Enabled = false;
|
||
chk_PatrimonioComplessivo.Checked = false;
|
||
chk_PatrimonioBancaFideuram.Enabled = false;
|
||
chk_PatrimonioBancaFideuram.Checked = false;
|
||
chk_AnalisiRischio.Enabled = false;
|
||
chk_AnalisiRischio.Checked = false;
|
||
chk_PatrimonioAltriIstituti.Enabled = false;
|
||
chk_PatrimonioAltriIstituti.Checked = false;
|
||
}
|
||
}
|
||
|
||
private void LoadProfilatura()
|
||
{
|
||
DataTable dtQuestionario;
|
||
|
||
#region Recupero dati dal WS Profilazione
|
||
|
||
ProfilazioneWS profiloQuestionario = new ProfilazioneWS();
|
||
ParametriChiamataWS paramWS = new ParametriChiamataWS();
|
||
|
||
// Chiave
|
||
ChiaveCliente chiave = new ChiaveCliente();
|
||
chiave.codiceAgente = codicePB;
|
||
chiave.codiceRete = codiceRete;
|
||
chiave.potenzialeClienteNAC = true;
|
||
chiave.codicefiscale = cliente.Definizione == Cliente.TipoDefinizione.Fiduciaria ? cliente.PIVAFiduciaria : codiceFiscale;
|
||
chiave.codiceMandato = cliente.Definizione == Cliente.TipoDefinizione.Fiduciaria ? cliente.CodiceMandatoFiduciaria : string.Empty;
|
||
|
||
// InfoClient
|
||
InfoClient info = new InfoClient();
|
||
info.codiceApplicazione = WebConfigParameter.getParameter("CODICEAPPLICAZIONE");
|
||
info.codiceRete = codiceRete;
|
||
info.versioneDatabaseSIMPB = Convert.ToInt32(token);
|
||
paramWS.ChiaveClienteProperty_Profilazione = chiave;
|
||
paramWS.InfoClienteProperty_Profilazione = info;
|
||
|
||
dtQuestionario = profiloQuestionario.GetQuestionariClienteMiFID(paramWS);
|
||
if (dtQuestionario.Rows.Count == 0 || dtQuestionario.Rows[0]["TipoQuestionario"].ToString().Trim() != "MIFID")
|
||
{
|
||
//btnProfilatura.Disabled = true;
|
||
}
|
||
|
||
bool rc = (Convert.ToInt32(dtMenuCaratteristichePatrimonio.Rows[0]["cf_ne_bf_e_ne_altri"]) == 1);
|
||
|
||
if ((dtQuestionario.Rows.Count == 0 || dtQuestionario.Rows[0]["TipoQuestionario"].ToString().Trim() == "EMPTY") && rc)
|
||
{
|
||
chk_AnalisiRischio.Enabled = false;
|
||
chk_AnalisiRischio.Checked = false;
|
||
if (!chk_PatrimonioAltriIstituti.Enabled && !chk_PatrimonioBancaFideuram.Enabled && !chk_PatrimonioComplessivo.Enabled)
|
||
stampa_PatrimonioCliente.Disabled = true;
|
||
}
|
||
|
||
//PCK-072011 Fix Ticket #19201194 : Se il cliente non ha il questionario(o e' scaduto) il test seguente viene bucato.
|
||
//Nella if premetto l'esistenza del questionario, poiche' in sua assenza il bottone deve comunque essere disabilitato.
|
||
|
||
// Disabilito il bottone di stampa questionario per i clienti persona giuridica
|
||
if (dtQuestionario.Rows.Count == 0)
|
||
//btnProfilatura.Disabled = true;
|
||
|
||
dtQuestionario.TableName = "QUESTIONARIOCLIENTE";
|
||
|
||
#endregion
|
||
}
|
||
|
||
private void LoadPiramideModello()
|
||
{
|
||
if (Convert.ToInt32(dtMenuCaratteristicheVarie.Rows[0]["cf_con_piram_model"]) == 0)
|
||
btnConfronto.Disabled = true;
|
||
}
|
||
|
||
private void LoadPiramideSimulazione()
|
||
{
|
||
if (Convert.ToInt32(dtMenuCaratteristicheVarie.Rows[0]["cf_tutte_piramidi"]) == 0)
|
||
btnPiramide.Disabled = true;
|
||
}
|
||
|
||
private void LoadDati(string codiceFiscale, string tipoRete, string codPB)
|
||
{
|
||
HttpContext contesto = HttpContext.Current;
|
||
|
||
Cliente cliente = Cliente.getCliente(tipoRete + codPB, codiceFiscale);
|
||
int _chiaveClientePB = cliente.ChiaveClientePB;
|
||
|
||
//Caratteristiche Varie
|
||
if (contesto.Session["CTable_CaratteristicheVarie"] == null)
|
||
{
|
||
this.dtMenuCaratteristicheVarie = BusinessManager.GetDataTableFromStoredProcedure_ConsulenzaEvoluta("REP_CTable_Menu_Caratteristiche_Varie", _chiaveClientePB);
|
||
if (dtMenuCaratteristicheVarie.Rows.Count == 0)
|
||
throw new Exception("REP_CTable_Menu_Caratteristiche_Varie non ritorna dati");
|
||
|
||
contesto.Session.Add("CTable_CaratteristicheVarie", dtMenuCaratteristicheVarie);
|
||
}
|
||
else
|
||
this.dtMenuCaratteristicheVarie = (DataTable)contesto.Session["CTable_CaratteristicheVarie"];
|
||
|
||
// Caratteristiche Patrimonio
|
||
if (contesto.Session["CTable_CaratteristichePatrimonio"] == null)
|
||
{
|
||
this.dtMenuCaratteristichePatrimonio = BusinessManager.GetDataTableFromStoredProcedure_ConsulenzaEvoluta("REP_CTable_Menu_Caratteristiche_Patrimonio", _chiaveClientePB);
|
||
if (dtMenuCaratteristichePatrimonio.Rows.Count == 0)
|
||
throw new Exception("REP_CTable_Menu_Caratteristiche_Patrimonio non ritorna dati");
|
||
|
||
contesto.Session.Add("CTable_CaratteristichePatrimonio", dtMenuCaratteristichePatrimonio);
|
||
}
|
||
else
|
||
this.dtMenuCaratteristichePatrimonio = (DataTable)contesto.Session["CTable_CaratteristichePatrimonio"];
|
||
|
||
|
||
////dati patrimonio cliente --proposta non ha bisogno di questi dati
|
||
//this.dtMenuCaratteristichePatrimonio = SectionManager.GetDataSection("CTable_Menu_Caratteristiche_Patrimonio", codPB, codiceFiscale, tipoRete);
|
||
|
||
//if (dtMenuCaratteristichePatrimonio.Rows.Count == 0)
|
||
//{
|
||
// throw new Exception("v_caratteristic_cf_patrim non ritorna dati");
|
||
//}
|
||
|
||
////dati vari cliente
|
||
|
||
//this.dtMenuCaratteristicheVarie = SectionManager.GetDataSection("CTable_Menu_Caratteristiche_Varie", codPB, codiceFiscale, tipoRete);
|
||
|
||
//if (dtMenuCaratteristicheVarie.Rows.Count == 0)
|
||
//{
|
||
// throw new Exception("v_caratteristic_cf_varie non ritorna dati");
|
||
//}
|
||
|
||
}
|
||
|
||
//private void setTipoCliente()
|
||
//{
|
||
// if (Convert.ToInt32(dtMenuCaratteristichePatrimonio.Rows[0]["cf_prospect"]) == 1)
|
||
// {
|
||
// stampa_MigrazioneProdotti.Disabled = true;
|
||
// if (!chk_PatrimonioAltriIstituti.Enabled)
|
||
// {
|
||
// stampa_PatrimonioCliente.Disabled = true;
|
||
// chk_PatrimonioComplessivo.Enabled = false;
|
||
// chk_PatrimonioComplessivo.Checked = false;
|
||
// chk_PatrimonioBancaFideuram.Enabled = false;
|
||
// chk_PatrimonioBancaFideuram.Checked = false;
|
||
// }
|
||
// else
|
||
// {
|
||
// chk_PatrimonioComplessivo.Enabled = false;
|
||
// chk_PatrimonioComplessivo.Checked = false;
|
||
// chk_PatrimonioBancaFideuram.Enabled = false;
|
||
// chk_PatrimonioBancaFideuram.Checked = false;
|
||
// //chk_AnalisiRischio.Enabled = false;
|
||
// }
|
||
// }
|
||
//}
|
||
|
||
protected void chk_IndicatoriRischio_CheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chk_PatrimonioBancaFideuram.Checked == false)
|
||
chk_PatrimonioBancaFideuram.Checked = true;
|
||
}
|
||
|
||
protected void chk_PatrimonioBancaFideuram_CheckedChanged(object sender, EventArgs e)
|
||
{
|
||
chk_IndicatoriRischio.Checked = chk_PatrimonioBancaFideuram.Checked;
|
||
}
|
||
}
|