630 lines
26 KiB
C#
630 lines
26 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Net;
|
|
using System.Threading;
|
|
using Consulenza.Web.ConsulenzaUnicaWS;
|
|
using System.Linq;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Consulenza.Web
|
|
{
|
|
public partial class Monitoraggio : System.Web.UI.Page
|
|
{
|
|
private Dictionary<int, string> _elencoSezioni = new Dictionary<int, string>();
|
|
public Dictionary<int, string> ElencoSezioni
|
|
{
|
|
get { return _elencoSezioni; }
|
|
set { _elencoSezioni = value; }
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
//caricaElencoSezioni();
|
|
}
|
|
}
|
|
|
|
protected void Button1_Click(object sender, EventArgs e)
|
|
{
|
|
var reportManager = new ReportManager();
|
|
|
|
var chiaveClientePb = tx_chiave.Text != "" ? int.Parse(tx_chiave.Text) : 0;
|
|
|
|
#region Template costruito
|
|
//1,2,4,5,6,7,8,11,15,16,17,18 schede attive 22-01-2016
|
|
var template = new Template
|
|
{
|
|
CodicePb = "",
|
|
IdModello = 5, //rete F, 6 rete S
|
|
IsDefault = "N",
|
|
Options = new[]
|
|
{
|
|
new Option { Key = "Opzione1", Value = "{'anonimo':'N'}" },
|
|
//new Option { Key = "Opzione2", Value = "{'proposta':'1234567'}" }
|
|
},
|
|
Schede = new[]
|
|
{
|
|
new SchedaTemplate {
|
|
Id = 1002,
|
|
Options = new Option[0]
|
|
},
|
|
#region schede commentate
|
|
//new SchedaTemplate {
|
|
// Id = 2002,
|
|
// Options = new Option[0]
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 4002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 5002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 6002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 7002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 8002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 9002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
|
|
//new SchedaTemplate {
|
|
// Id = 11002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 12002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 13002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 14002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 15002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 16002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 17002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 18002,
|
|
// Options = new Option[0]
|
|
//},
|
|
|
|
//new SchedaTemplate {
|
|
// Id = 19002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 20002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 21002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
|
|
//new SchedaTemplate { //danilo:sviluppo in corso?
|
|
// Id = 22002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate { //danilo:sviluppo in corso?
|
|
// Id = 23002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 24002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 27002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 29002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 30002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 31002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 32002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 33002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 34002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 35002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 36002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 37002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 38002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 39002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 40002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id =41002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 42002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 43002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 44002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 45002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 46002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 47002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
#endregion
|
|
|
|
//new SchedaTemplate {
|
|
// Id = 48002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 49002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 50002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//LE TRE SEGUENTI SONO DA FARE
|
|
//new SchedaTemplate {
|
|
// Id = 51002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 52002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 53002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 66002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 67002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 68002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 69002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 70002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
// new SchedaTemplate {
|
|
// Id = 71002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 72002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
|
|
//new SchedaTemplate {
|
|
// Id = 73002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 74002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
//new SchedaTemplate {
|
|
// Id = 75002,
|
|
// Options = new Option[0]
|
|
|
|
//},
|
|
}
|
|
};
|
|
#endregion
|
|
|
|
#region Template preso da DB
|
|
//template = new Template { IdModello = -1, Nome = "Test_Mon_Salvi" };
|
|
//template = new Template { IdModello = -1, Nome = "Test_PreRilascio" };
|
|
//var imagePdf = reportManager.CreaReport("012057", "FSTTLI43L07L840O", "", "F", 1044379, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
#endregion
|
|
template = new Template { IdModello = -1, Nome = "MonitoraggioSavingMap" }; //lindaprop2 -linda62 lindaprop55 - lindaMon -
|
|
var imagePdf = reportManager.CreaReport("014803", "MNTPRI49R57G273T", "", "F", 577582, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
|
|
|
|
//var imagePdf = reportManager.CreaReportOld(chiaveClientePb, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
//var imagePdf = reportManager.CreaReport("002317", "PRZRNZ44S14B025B", "", "F", 74139, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
// DONA' DELLE ROSE S11 - S18
|
|
//var imagePdf = reportManager.CreaReport("012057", "DNDMCL54A11L551Z", "", "F", 127235, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
// BELLANTE
|
|
//var imagePdf = reportManager.CreaReport("011974", "RSSLEI43C14C006H", "", "F", 428064, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
//var imagePdf = reportManager.CreaReport("005199", "RMRLGU42L24B101X", "", "F", 79807, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
|
|
// Luigi DI CLERICO S45 S46 S47
|
|
//var imagePdf = reportManager.CreaReport("015104", "DCLLGU40H05H320L", "", "F", 123703, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
// TISEO Marcello
|
|
//var imagePdf = reportManager.CreaReport("003839", "TSIMCL67T05A818L", "", "S", 94817, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
// BLOCCO 69
|
|
//var imagePdf = reportManager.CreaReport("015238", "LRNGDE63T23F012H", "", "F", 50539, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
// var imagePdf = reportManager.CreaReport("015874", "SLVGPP74R18B963L", "", "F", 1702400, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
//var imagePdf = reportManager.CreaReport("016314", "DVCWTR35S02L781V", "", "F", 1426463, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
//var imagePdf = reportManager.CreaReport("012225", "QGLLND58R42E897H", "", "F", 172049, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
// Paolo Savoldelli S20 - S22
|
|
//var imagePdf = reportManager.CreaReport("002317", "SVLPLA53T07D434X", "", "F", 530953, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
//var imagePdf = reportManager.CreaReport("013739", "CCCCRL58D30B300W", "", "F", 608693, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
// s21
|
|
//var imagePdf = reportManager.CreaReport("014818", "PRCMRA64P13D286C", "", "F", 363274, template, new ConsulenzaUnicaWS.Parametro[0]);
|
|
|
|
|
|
if (imagePdf == null) return;
|
|
|
|
Session["pdf"] = imagePdf;
|
|
Response.Redirect("Report.aspx", false);
|
|
}
|
|
|
|
private void caricaCheckboxList(Dictionary<int, string> elenco)
|
|
{
|
|
|
|
//chklstSezioni.DataSource = elenco;
|
|
//chklstSezioni.DataValueField = "Key";
|
|
//chklstSezioni.DataTextField = "Value";
|
|
//chklstSezioni.DataBind();
|
|
//chkAll.Visible = true;
|
|
}
|
|
//protected void ddl_report_SelectedIndexChanged(object sender, EventArgs e)
|
|
//{
|
|
// int[] elencosezioni =null;
|
|
// List<int> lista = new List<int>();
|
|
// Dictionary<int, string> listatemp = new Dictionary<int, string>();
|
|
|
|
// switch (ddl_report.SelectedItem.Text)
|
|
// {
|
|
|
|
// case "Diagnosi":
|
|
// for (int i = 44; i < 91; i++) lista.Add(i);
|
|
// elencosezioni = new int[] { 105, 107, 111, 112, 113, 114, 115 };
|
|
// lista.AddRange(elencosezioni.ToList());
|
|
// break;
|
|
// case "Monitoraggio":
|
|
// for (int i =1 ; i < 47; i++) lista.Add(i);
|
|
// lista.Remove(11);
|
|
// elencosezioni = new int[] { 57,58,59,60,61,63,65,66,67,68,69,70,71,72 };
|
|
// lista.AddRange(elencosezioni.ToList());
|
|
// break;
|
|
// case "Proposta":
|
|
// elencosezioni = new int[] { 1, 2, 3, 4, 10, 11, 12,13, 14, 15, 16, 47,48,49, 50, 51,52,53,54,55, 56,62,64, 73 };
|
|
// lista.AddRange(elencosezioni.ToList());
|
|
// break;
|
|
// case "Nucleo":
|
|
// elencosezioni = new int[] { 1, 2, 3};
|
|
// lista.AddRange(elencosezioni.ToList());
|
|
// for (int i = 5; i < 47; i++) lista.Add(i);
|
|
// lista.Remove(10);
|
|
// lista.Remove(11);
|
|
// lista.Remove(12);
|
|
// lista.Remove(13);
|
|
// lista.Remove(14);
|
|
// lista.Remove(32);
|
|
// lista.Remove(39);
|
|
// lista.Remove(41);
|
|
// elencosezioni = new int[] { 68,69,70,71,72,74,75,76,77,78 };
|
|
// lista.AddRange(elencosezioni.ToList());
|
|
// break;
|
|
// }
|
|
// ElencoSezioni = (Dictionary<int,string>)Session["elenco"];
|
|
// listatemp = ElencoSezioni.Where(p => lista.Contains(p.Key)).ToDictionary(p => p.Key, p => p.Value);
|
|
// caricaCheckboxList(listatemp);
|
|
//}
|
|
|
|
|
|
private void caricaElencoSezioni()
|
|
{
|
|
try
|
|
{
|
|
|
|
var dt = DataAccess.ExecuteDataTableSqlStatement(
|
|
DBProvider.SqlServerConsulenzaEvoluta
|
|
, "SELECT ID, Descrizione FROM ReportModeler2..Sezioni WHERE id>=44 and id<=121", null);
|
|
|
|
foreach (DataRow r in dt.Rows)
|
|
_elencoSezioni.Add(int.Parse(r["ID"].ToString()), r["Descrizione"].ToString());
|
|
Session["elenco"] = _elencoSezioni;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new Exception(ex.Message);
|
|
}
|
|
#region follia
|
|
//_elencoSezioni.Add(1, "Copertina");
|
|
//_elencoSezioni.Add(2, "Glossario");
|
|
//_elencoSezioni.Add(3, "Avvertenze");
|
|
//_elencoSezioni.Add(4, "Sintesi Cliente");
|
|
//_elencoSezioni.Add(5, "Patrimonio finanziario: rappresentazione per intermediario");
|
|
//_elencoSezioni.Add(6, "Patrimonio finanziario: rappresentazione per macro asset class");
|
|
//_elencoSezioni.Add(7, "Patrimonio finanziario: rappresentazione per asset class");
|
|
//_elencoSezioni.Add(8, "Patrimonio finanziario: macro categoria di prodotto");
|
|
//_elencoSezioni.Add(9, "Patrimonio finanziario: categoria di prodotto");
|
|
//_elencoSezioni.Add(10, "Patrimonio Banca Fideuram: piramide dei bisogni");
|
|
//_elencoSezioni.Add(11, "Pianificazione: piramide dei bisogni");
|
|
//_elencoSezioni.Add(12, "Pianificazione: dettaglio prodotti");
|
|
//_elencoSezioni.Add(13, "Progetto 'nome progetto': dettaglio portafoglio modello");
|
|
//_elencoSezioni.Add(14, "Riserva: dettaglio portafoglio modello");
|
|
//_elencoSezioni.Add(15, "Patrimonio Banca Fideuram: dettaglio contratti");
|
|
//_elencoSezioni.Add(16, "Patrimonio Banca Fideuram: dettaglio prodotti");
|
|
//_elencoSezioni.Add(17, "Patrimonio Banca Fideuram: rappresentazione per macro asset class");
|
|
//_elencoSezioni.Add(18, "Patrimonio Banca Fideuram: rappresentazione per asset class");
|
|
//_elencoSezioni.Add(19, "Patrimonio Banca Fideuram: rappresentazione per valute");
|
|
//_elencoSezioni.Add(20, "Patrimonio Banca Fideuram: macro categoria prodotto");
|
|
//_elencoSezioni.Add(21, "Patrimonio Banca Fideuram: categoria prodotto");
|
|
//_elencoSezioni.Add(22, "Patrimonio Banca Fideuram: rappresentazione per rating");
|
|
//_elencoSezioni.Add(23, "Patrimonio Banca Fideuram: rappresentazione per emittenti");
|
|
//_elencoSezioni.Add(24, "Patrimonio Banca Fideuram: rappresentazione per scadenze");
|
|
//_elencoSezioni.Add(25, "Patrimonio Banca Fideuram: rappresentazione per tassi");
|
|
//_elencoSezioni.Add(26, "Patrimonio altri Istituti: distribuzione per intermediario");
|
|
//_elencoSezioni.Add(27, "Patrimonio altri Istituti: dettaglio prodotti");
|
|
//_elencoSezioni.Add(28, "Patrimonio altri Istituti: rappresentazione per macro asset class");
|
|
//_elencoSezioni.Add(29, "Patrimonio altri Istituti: rappresentazione per asset class");
|
|
//_elencoSezioni.Add(30, "Patrimonio altri Istituti: macro categoria prodotto");
|
|
//_elencoSezioni.Add(31, "Copertina");
|
|
//_elencoSezioni.Add(32, "Copertina");
|
|
//_elencoSezioni.Add(33, "Copertina");
|
|
//_elencoSezioni.Add(34, "Copertina");
|
|
//_elencoSezioni.Add(35, "Copertina");
|
|
//_elencoSezioni.Add(36, "Copertina");
|
|
//_elencoSezioni.Add(37, "Copertina");
|
|
//_elencoSezioni.Add(38, "Copertina");
|
|
//_elencoSezioni.Add(39, "Copertina");
|
|
//_elencoSezioni.Add(40, "Copertina");
|
|
//_elencoSezioni.Add(41, "Copertina");
|
|
//_elencoSezioni.Add(42, "Copertina");
|
|
//_elencoSezioni.Add(43, "Copertina");
|
|
//_elencoSezioni.Add(44, "Copertina");
|
|
//_elencoSezioni.Add(45, "Copertina");
|
|
//_elencoSezioni.Add(46, "Copertina");
|
|
//_elencoSezioni.Add(47, "Copertina");
|
|
//_elencoSezioni.Add(48, "Copertina");
|
|
//_elencoSezioni.Add(49, "Copertina");
|
|
//_elencoSezioni.Add(50, "Copertina");
|
|
//_elencoSezioni.Add(51, "Copertina");
|
|
//_elencoSezioni.Add(52, "Copertina");
|
|
//_elencoSezioni.Add(53, "Copertina");
|
|
//_elencoSezioni.Add(54, "Copertina");
|
|
//_elencoSezioni.Add(55, "Copertina");
|
|
//_elencoSezioni.Add(56, "Copertina");
|
|
//_elencoSezioni.Add(57, "Copertina");
|
|
//_elencoSezioni.Add(58, "Copertina");
|
|
//_elencoSezioni.Add(59, "Copertina");
|
|
//_elencoSezioni.Add(60, "Copertina");
|
|
//_elencoSezioni.Add(61, "Copertina");
|
|
//_elencoSezioni.Add(62, "Copertina");
|
|
//_elencoSezioni.Add(63, "Copertina");
|
|
//_elencoSezioni.Add(64, "Copertina");
|
|
//_elencoSezioni.Add(65, "Copertina");
|
|
//_elencoSezioni.Add(66, "Copertina");
|
|
//_elencoSezioni.Add(67, "Copertina");
|
|
//_elencoSezioni.Add(68, "Copertina");
|
|
//_elencoSezioni.Add(69, "Copertina");
|
|
//_elencoSezioni.Add(70, "Copertina");
|
|
//_elencoSezioni.Add(71, "Copertina");
|
|
//_elencoSezioni.Add(72, "Copertina");
|
|
//_elencoSezioni.Add(73, "Copertina");
|
|
//_elencoSezioni.Add(74, "Copertina");
|
|
//_elencoSezioni.Add(75, "Copertina");
|
|
//_elencoSezioni.Add(76, "Copertina");
|
|
//_elencoSezioni.Add(77, "Copertina");
|
|
//_elencoSezioni.Add(78, "Copertina");
|
|
#endregion
|
|
}
|
|
|
|
protected void Button2_Click(object sender, EventArgs e)
|
|
{
|
|
var dt = DataAccess.ExecuteDataTableSqlStatement(DBProvider.SqlServerConsulenzaUnica, "select * from vInfoCliente WHERE chiaveclientePb=" + tx_chiave.Text, null);
|
|
|
|
var agente = dt.Rows[0]["agente"].ToString();
|
|
var rete = dt.Rows[0]["rete"].ToString();
|
|
var mandato = dt.Rows[0]["codman"].ToString();
|
|
var codfiscale = dt.Rows[0]["codfis"].ToString();
|
|
var prefisso = rete.Equals("F") ? "R" : "P";
|
|
var cliente = string.Format("{0} {1}", dt.Rows[0]["nomecliente"].ToString(), dt.Rows[0]["cognomecliente"].ToString());
|
|
var privatebancker = string.Format("{0} {1}", dt.Rows[0]["nomepb"].ToString(), dt.Rows[0]["cognomepb"].ToString());
|
|
|
|
var url = ConfigurationManager.AppSettings["UrlAPI"];
|
|
|
|
var stringUrl1 = string.Format("{0}/api/login/main", url);
|
|
var stringUrl2 = string.Format("{0}/api/login/home", url);
|
|
var stringUrl3 = string.Format("{0}/api/cliente/load/customer", url);
|
|
|
|
using (var client = new CookieWebClient())
|
|
{
|
|
client.Headers.Clear();
|
|
client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
|
|
var dataString1 = "{\"mainUserId\":\"" + prefisso + agente + "\"}";
|
|
client.UploadString(new Uri(stringUrl1), "POST", dataString1);
|
|
|
|
|
|
client.Headers.Clear();
|
|
client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
|
|
var dataString2 = "{\"impersonificatedAgentCode\":\"" + agente + "\"}";
|
|
client.UploadString(new Uri(stringUrl2), "POST", dataString2);
|
|
|
|
|
|
client.Headers.Clear();
|
|
client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
|
|
var dataString3 = "{\"codiceFiscale\":\"" + codfiscale + "\",\"codiceMandato\":\"\",\"codiceAgente\": \"" + agente + "\",\"codiceRete\": \"" + rete + "\"}";
|
|
client.UploadString(new Uri(stringUrl3), "POST", dataString3);
|
|
}
|
|
|
|
lblAgente.Text = "Agente: " + agente;
|
|
lblCodiceFiscale.Text = "CodiceFiscale: " + codfiscale;
|
|
lblRete.Text = "Rete: " + rete;
|
|
lblMandato.Text = "Mandato: " + mandato;
|
|
lblCliente.Text = "Cliente: " + cliente;
|
|
lblPb.Text = "Private Bancker: " + privatebancker;
|
|
|
|
}
|
|
|
|
|
|
public class CookieWebClient : WebClient
|
|
{
|
|
public CookieContainer CookieContainer { get; private set; }
|
|
|
|
/// <summary>
|
|
/// This will instanciate an internal CookieContainer.
|
|
/// </summary>
|
|
public CookieWebClient()
|
|
{
|
|
this.CookieContainer = new CookieContainer();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Use this if you want to control the CookieContainer outside this class.
|
|
/// </summary>
|
|
public CookieWebClient(CookieContainer cookieContainer)
|
|
{
|
|
this.CookieContainer = cookieContainer;
|
|
}
|
|
|
|
protected override WebRequest GetWebRequest(Uri address)
|
|
{
|
|
var request = base.GetWebRequest(address) as HttpWebRequest;
|
|
if (request == null) return base.GetWebRequest(address);
|
|
request.CookieContainer = CookieContainer;
|
|
return request;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|