236 lines
11 KiB
C#
236 lines
11 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web.UI;
|
|
using System.Data;
|
|
using System.Web;
|
|
using ConsulenzaEvoluta;
|
|
using PrometeiaMessage.bancafideuram.nac.anagrafica;
|
|
|
|
public partial class reportPatriImmobiliareNuclei : System.Web.UI.Page
|
|
{
|
|
public string codCliente;
|
|
public string tipoRete;
|
|
public string codPB;
|
|
public string codAs;
|
|
public string codiceUtenteQueryString;
|
|
public string token;
|
|
public string userName = string.Empty;
|
|
public string codiceApplicazione = string.Empty;
|
|
public string checkPrivacy;
|
|
|
|
private Nucleo _nucleo;
|
|
public string pathNav;
|
|
public int idReport; //indica il modello (fixed) COMPLETO di QUESTO report da cui costruire la treeview iniziale
|
|
private string sUtente;
|
|
public int chiaveNucleo;
|
|
public static int tpReport = 8; //valore proprietario (fixed) di QUESTO report //DA VALUTARE!!
|
|
public static int idReportAlbero = 16; //valore proprietario (fixed) di QUESTO report //DA VALUTARE!!
|
|
public static int idReportBase = 16;
|
|
public static int idReportCompleto = 16;
|
|
public string codiceRete;
|
|
public string codicePB;
|
|
public string ambiente;
|
|
public int lastSavedReportId;
|
|
public static string nomeReport = "PATRIMONIOIMMOBILLIARE"; //valore proprietario (fixed) di QUESTO report
|
|
public static string nomeReportCompleto = "Nucleo completo"; //valore proprietario (fixed) di QUESTO report
|
|
public static string nomeReportRischio = "NUCLEO"; //valore proprietario (fixed) di QUESTO report
|
|
public static string nomeReportBaseRischio = "Nucleo base"; //valore proprietario (fixed) di QUESTO report
|
|
public static string nomeReportCompletoRischio = "Nucleo completo"; //valore proprietario (fixed) di QUESTO report
|
|
|
|
string nomeReportPerLabel;
|
|
string descrizioneReportPerLabel;
|
|
public int reportIdToLoadBack = -1;
|
|
public string endOfjob = "0";
|
|
|
|
//private bool reportNominativo = false;
|
|
int IDReportToLoad = -1;
|
|
public string baseCompleto;
|
|
public string reportName;
|
|
|
|
private int IdModello;
|
|
private GestReport m = new GestReport();
|
|
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
if (Debug.iSDebug && Request.QueryString.Get("tipoRete") == null)
|
|
{
|
|
Response.Redirect("reportPatriImmobiliareNuclei.aspx?codPB=" + Debug.Agente + "&chiaveNucleo=" + Debug.ChiaveNucleo + "&token=&tipoRete=" + Debug.Rete);
|
|
return;
|
|
}
|
|
|
|
token = Request.QueryString.Get("token");
|
|
codiceRete = Request.QueryString.Get("tipoRete");
|
|
tipoRete = Request.QueryString.Get("tiporete").ToUpper();
|
|
codicePB = Request.QueryString.Get("codPB");
|
|
codPB = Request.QueryString.Get("codpb").ToUpper();
|
|
codAs = Request.QueryString.Get("codas") != null ? Request.QueryString.Get("codas").ToUpper() : string.Empty;
|
|
codiceUtenteQueryString = tipoRete.Trim() + codicePB.Trim();
|
|
chiaveNucleo = Convert.ToInt32(Request.QueryString["chiaveNucleo"]);
|
|
IdModello = codiceRete.Equals("S") ? 8 : 7;
|
|
|
|
|
|
if (!Page.IsPostBack)
|
|
{
|
|
|
|
|
|
#region From Gestione Modelli
|
|
//string loadingReport = Request.QueryString.Get("idReportToLoad");
|
|
//nomeReportPerLabel = Request.QueryString.Get("nomeInizialeReport");
|
|
//descrizioneReportPerLabel = Request.QueryString.Get("descrizioneInizialeReport");
|
|
#endregion
|
|
|
|
if (HFERRORMSG.Value.Equals(""))
|
|
{
|
|
m.TipoRete = codiceRete.Equals("F") ? "Banca Fideuram" : "SanPaolo Invest";
|
|
m.AcquisisciModello(IdModello);
|
|
m.AcquisisciElencoFabbricatiNucleo(chiaveNucleo);
|
|
}
|
|
|
|
|
|
List<string> vincoli = m.GetVincoliSchedeNucleoImmobigliare(chiaveNucleo);
|
|
m.SetEnableSchede(vincoli);
|
|
foreach (SchedaReport sr in m.Modello)
|
|
{
|
|
if (sr.Sezioni == "37" && !vincoli.Exists(item => item == "flaganomaliafabbricati"))
|
|
sr.Vincoli += "&CON_40_Sono presenti anomalie catastali(fabbricati). è necessario inserire la scheda 8 o eliminare la scheda 5";
|
|
if (sr.Sezioni == "38" && !vincoli.Exists(item => item == "flaganomaliaterreni"))
|
|
sr.Vincoli += "&CON_40_Sono presenti anomalie catastali(terreni). è necessario inserire la scheda 8 o eliminare la scheda 6";
|
|
}
|
|
|
|
DatiHidden.Value = m.GetHtmlClient();
|
|
|
|
|
|
SessionGeneratorPdf spdf = new SessionGeneratorPdf(chiaveNucleo, null, "ImmobiliareNucleo", null);
|
|
|
|
if (Debug.iSDebug) {
|
|
Debug.LogFunzionalita("iSDebug", "return forzato");
|
|
return; }
|
|
|
|
|
|
|
|
#region Recupero token da AnagraficaWS.GetVersion
|
|
|
|
if (string.IsNullOrEmpty(token))
|
|
{
|
|
string codPortal = WebConfigParameter.getParameter("CODICEPORTALEPERVERSIONESIMPB");
|
|
|
|
InfoClient infoCliente = new InfoClient();
|
|
infoCliente.codiceApplicazione = WebConfigParameter.getParameter("CODICEAPPLICAZIONE").ToString();
|
|
infoCliente.codiceRete = codiceRete;
|
|
infoCliente.versioneDatabaseSIMPB = 0;
|
|
|
|
AnagraficaWS wsana = new AnagraficaWS();
|
|
PBRes risposta = wsana.GetVersion(infoCliente, codPortal);
|
|
token = risposta.info.versioneDatabaseSIMPB.ToString();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region InfoClient e ChiaveCliente di GlobalPosition e Anagrafica
|
|
|
|
// Global Position
|
|
PrometeiaMessage.bancafideuram.nac.globalposition.InfoClient _infoCliente_GlobalPosition = new PrometeiaMessage.bancafideuram.nac.globalposition.InfoClient();
|
|
_infoCliente_GlobalPosition.codiceApplicazione = WebConfigParameter.getParameter("CODICEAPPLICAZIONE").ToString();
|
|
_infoCliente_GlobalPosition.versioneDatabaseSIMPB = int.Parse(token);
|
|
|
|
|
|
PrometeiaMessage.bancafideuram.nac.globalposition.ChiaveCliente _chiaveCliente_GlobalPosition = new PrometeiaMessage.bancafideuram.nac.globalposition.ChiaveCliente();
|
|
_chiaveCliente_GlobalPosition.potenzialeClienteNAC = true;
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Gestione Autorizzazione
|
|
|
|
if (WebConfigParameter.getParameter("Ambiente") == "esterno")
|
|
userName = User.Identity.Name;
|
|
else
|
|
userName = WebConfigParameter.getParameter("UtenzaWindowsAccessoHP");
|
|
|
|
//1) utente loggato (VINCENZO UT.PROVA 2 MAGRI)
|
|
//2) utente impersonificato (VIOTTI GIANCARLO)
|
|
|
|
string AbilitazionePrimaria = string.Empty;
|
|
|
|
codiceApplicazione = WebConfigParameter.getParameter("CodiceApplicazione");
|
|
|
|
string codiceUtente = tipoRete + Utente.GetCodiceUtente(userName); // è il codiceutente con cui andrò a interrogare la ConsulenzaBase.dbo.PromotoreBancario per recuperare le informazioni dell'utente loggato
|
|
|
|
Utente utenteLoggato_WS = Utente.GetAutorizzazioniAccessoGestioneControlli(userName, codiceApplicazione); // utente loggato (VINCENZO UT.PROVA 2 MAGRI), informazioni prese dai WS
|
|
Utente utenteLoggato = Utente.GetProfiloUtente(codiceUtente, utenteLoggato_WS.ProfiloUtenteLoggato); // utente loggato (VINCENZO UT.PROVA 2 MAGRI) , informazioni prese da DB
|
|
utenteLoggato.ProfiloUtenteLoggato = utenteLoggato_WS.ProfiloUtenteLoggato;
|
|
utenteLoggato.AbilitazionePrimaria = utenteLoggato_WS.AbilitazionePrimaria;
|
|
utenteLoggato.IsUtenteImpersonificato = utenteLoggato_WS.IsUtenteImpersonificato;
|
|
utenteLoggato.UtenteAutorizzatoApplicazione = utenteLoggato_WS.UtenteAutorizzatoApplicazione;
|
|
|
|
Utente utenteImpersonificato = Utente.GetProfiloUtente(codiceUtenteQueryString, null); // utente impersonificato (VIOTTI GIANCARLO)
|
|
utenteImpersonificato.AbilitazionePrimaria = utenteLoggato.AbilitazionePrimaria;
|
|
utenteImpersonificato.IsUtenteImpersonificato = utenteLoggato.IsUtenteImpersonificato;
|
|
utenteImpersonificato.UtenteAutorizzatoApplicazione = utenteLoggato.UtenteAutorizzatoApplicazione;
|
|
|
|
// FIX da valutare per TK T-300675-L4Y3
|
|
if (!codAs.Equals(codPB))
|
|
codiceUtenteQueryString = codiceUtente;
|
|
|
|
Utente utenteSoloPerAutorizzazione = Utente.GetAutorizzazioni(userName, codiceApplicazione, tipoRete, codiceUtenteQueryString, Convert.ToInt32(token));
|
|
|
|
if (utenteSoloPerAutorizzazione.UtenteAutorizzatoApplicazione)
|
|
{
|
|
if (Request.Browser.Cookies)
|
|
{
|
|
#region utente Loggato (UtenteLoggatoDiSessione)
|
|
|
|
string utenteLoggatoString = Utente.SerializeMessage(utenteLoggato);
|
|
|
|
utenteLoggatoString = HttpUtility.UrlDecode(utenteLoggatoString.TrimStart().TrimEnd());
|
|
Session.Add("UtenteLoggatoDiSessione", utenteLoggatoString);
|
|
|
|
#endregion
|
|
|
|
#region utente Impersonificato (UtenteImpersonificatoDiSessione)
|
|
|
|
string utenteImpersonificatoString = Utente.SerializeMessage(utenteImpersonificato);
|
|
|
|
utenteImpersonificatoString = HttpUtility.UrlDecode(utenteImpersonificatoString.TrimStart().TrimEnd());
|
|
Session.Add("UtenteImpersonificatoDiSessione", utenteImpersonificatoString);
|
|
|
|
#endregion
|
|
}
|
|
else
|
|
{
|
|
AbilitazionePrimaria = string.Empty;
|
|
if (utenteLoggato != null)
|
|
if (utenteLoggato.AbilitazionePrimaria != null)
|
|
AbilitazionePrimaria = utenteLoggato.AbilitazionePrimaria;
|
|
|
|
Response.Redirect("error.aspx?UtenteWindows=" + userName + "&UtentePB=" + codiceUtenteQueryString + "&CodiceApplicazione=" + WebConfigParameter.getParameter("CODICEAPPLICAZIONE") + "&VersioneSIMPB=" + token.ToString() + "&AbilitazionePrimaria=" + AbilitazionePrimaria);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
AbilitazionePrimaria = string.Empty;
|
|
if (utenteLoggato != null)
|
|
if (utenteLoggato.AbilitazionePrimaria != null)
|
|
AbilitazionePrimaria = utenteLoggato.AbilitazionePrimaria;
|
|
|
|
Response.Redirect("error.aspx?UtenteWindows=" + userName + "&UtentePB=" + codiceUtenteQueryString + "&CodiceApplicazione=" + WebConfigParameter.getParameter("CODICEAPPLICAZIONE") + "&VersioneSIMPB=" + token.ToString() + "&AbilitazionePrimaria=" + AbilitazionePrimaria + "&UtenteAutorizzato=" + utenteLoggato_WS.UtenteAutorizzatoApplicazione.ToString());
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |