145 lines
5.8 KiB
C#
145 lines
5.8 KiB
C#
using System;
|
|
using Consulenza.ReportCommon;
|
|
using Consulenza.DataServices.fideuram.data.service;
|
|
|
|
namespace Consulenza.DataServices
|
|
{
|
|
/// <summary>
|
|
/// Classe che gestisce i dati anagrafici del Cliente e del PrivateBanker
|
|
/// </summary>
|
|
public class Anagrafica : FideuramData
|
|
{
|
|
private const string ClassName = "Anagrafica";
|
|
|
|
/// <summary>
|
|
/// Costruttore
|
|
/// </summary>
|
|
/// <param name="chiaveClientePb">chiaveClientePb</param>
|
|
public Anagrafica(Int64 chiaveClientePb)
|
|
{
|
|
ChiaveClientePb = chiaveClientePb;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Recupera l'anagrafica del cliente
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public Cliente GetCliente()
|
|
{
|
|
var keyForCache = GetKeyForCache(ClassName, "GetCliente");
|
|
var cliente = new Cliente();
|
|
|
|
//if (CacheStore.Exists<Cliente>(keyForCache))
|
|
//{
|
|
// // Rileggo dalla cache
|
|
// cliente = CacheStore.Get<Cliente>(keyForCache);
|
|
//}
|
|
//else
|
|
//{
|
|
var data = Execute(new fideuram.data.service.rqData { clienteUnit = new fideuram.data.service.rqClienteUnit { anagraficaCliente = true } });
|
|
|
|
cliente = new Cliente
|
|
{
|
|
Chiave = ChiaveClientePb,
|
|
CodiceFiscale = data.responseData.clienteUnit.anagrafica.codiceFiscale,
|
|
Cognome = data.responseData.clienteUnit.anagrafica.cognome,
|
|
Nome = data.responseData.clienteUnit.anagrafica.nome,
|
|
PartitaIva = data.responseData.clienteUnit.anagrafica.partitaIva,
|
|
DataSottoscrizioneContratto = data.responseData.clienteUnit.anagrafica.dtSottoscrizione,
|
|
TipologiaContratto = data.responseData.clienteUnit.anagrafica.contratto,
|
|
DescrizioneProfilo = data.responseData.clienteUnit.anagrafica.descProfiloReport,
|
|
CodiceProfilo = data.responseData.clienteUnit.anagrafica.codProfilo
|
|
|
|
#region MOK
|
|
//Chiave = 250959, // CON PATR TERZI
|
|
//Chiave = 385351,
|
|
//Chiave = 196340,
|
|
//Chiave = 4880,
|
|
|
|
//CodiceFiscale = "ZZLDRN51E10B025O",
|
|
//Cognome = "AZZALIN",
|
|
//Nome = "ADRIANO",
|
|
//PartitaIva = "",
|
|
//DataSottoscrizioneContratto = DateTime.Today,
|
|
//TipologiaContratto = "OLD",
|
|
//DescrizioneProfilo = "AGGRESSIVO",
|
|
//CodiceProfilo = 1
|
|
#endregion
|
|
};
|
|
|
|
// Memorizzo in chache
|
|
// CacheStore.Add(keyForCache, cliente);
|
|
//}
|
|
|
|
return cliente;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Recupera l'anagrafica del private bancker
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public PrivateBanker GetPrivateBanker()
|
|
{
|
|
// var keyForCache = GetKeyForCache(ClassName, "GetPrivateBanker");
|
|
var privateBanker = new PrivateBanker();
|
|
|
|
//if (CacheStore.Exists<PrivateBanker>(keyForCache))
|
|
//{
|
|
// // Rileggo dalla cache
|
|
// privateBanker = CacheStore.Get<PrivateBanker>(keyForCache);
|
|
//}
|
|
//else
|
|
//{
|
|
var data = Execute(new fideuram.data.service.rqData { clientePB = true });
|
|
|
|
privateBanker = new PrivateBanker
|
|
{
|
|
Cap = data.responseData.clientePB.holderProfile.zipCode ?? string.Empty,
|
|
Citta = data.responseData.clientePB.holderProfile.city ?? string.Empty,
|
|
Codice = data.responseData.clientePB.holderProfile.codAge ?? string.Empty,
|
|
CodiceRete = data.responseData.clientePB.holderProfile.network ?? string.Empty,
|
|
Indirizzo = data.responseData.clientePB.holderProfile.address ?? string.Empty,
|
|
//Livello = data.responseData.clientePB.holderProfile.rank.Trim(),
|
|
Nominativo = string.Format("{0} {1}", data.responseData.clientePB.holderProfile.surname, data.responseData.clientePB.holderProfile.name),
|
|
NumeroCivico = "", //TODO è nell'indirizzo
|
|
PrefissoTelefono =string.Empty,// data.responseData.clientePB.holderProfile.PrefissoTelefono ?? string.Empty, //TODO manca su ws e non è compreso nel phonenumber
|
|
Telefono = data.responseData.clientePB.holderProfile.phoneNumber ?? string.Empty
|
|
};
|
|
|
|
// Memorizzo in chache
|
|
//re.Add(keyForCache, privateBanker);
|
|
// }
|
|
|
|
return privateBanker;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ritorna il Quastionario Mifid del cliente.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public questionarioBean GetQuestionarioCliente()
|
|
{
|
|
var keyForCache = GetKeyForCache(ClassName, "GetQuestionarioCliente");
|
|
var returnObject = new questionarioBean();
|
|
|
|
//if (CacheStore.Exists<questionarioBean>(keyForCache))
|
|
//{
|
|
// returnObject = CacheStore.Get<questionarioBean>(keyForCache);
|
|
//}
|
|
//else
|
|
//{
|
|
var data = Execute(new rqData { piramideModelloUnit = new rqPiramideModelloUnit { questionarioMifid = true } });
|
|
|
|
if (data.responseData.piramideModelloUnit.questionarioMifid != null)
|
|
returnObject = data.responseData.piramideModelloUnit.questionarioMifid;
|
|
|
|
|
|
// Memorizzo in chache
|
|
// CacheStore.Add(keyForCache, returnObject);
|
|
//}
|
|
|
|
return returnObject;
|
|
}
|
|
}
|
|
}
|