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; namespace Consulenza.Web { public partial class Diagnosi : System.Web.UI.Page { private Dictionary _elencoSezioni = new Dictionary(); public Dictionary ElencoSezioni { get { return _elencoSezioni; } set { _elencoSezioni = value; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //caricaElencoSezioni(); } } //protected void ck_report_PreRender(object sender, EventArgs e) //{ // int i = 1; // foreach (ListItem item in chklstSezioni.Items) // { // item.Attributes.Add("title", item.Text); // string value = item.Text.Substring(0, 4); // item.Text = value; // i++; // } //} /// /// Mette in sessione il cliente /// /// /// 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(); // Non so perché ma va fatto 2 volte!!!! for (int i = 0; i < 2; i++) { 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; } /// /// Crea il report Diagnosi /// /// /// protected void Button1_Click(object sender, EventArgs e) { var reportManager = new ReportManager(); reportManager.Timeout = 60000 * 10; //10 minuti var chiaveClientePb = tx_chiave.Text != "" ? int.Parse(tx_chiave.Text) : 0; #region Template costruito var template = new Template { CodicePb = "", IdModello = 1, //1(Fideuram), 2(SanPaolo) IsDefault = "N", Options = new[] { new Option { Key = "Opzione1", Value = "{'anonimo':'N'}" }, //new Option { Key = "Opzione2", Value = "{'proposta':'1234567'}" } }, Schede = new[] { //new SchedaTemplate { // Id = 1000, // Options = new Option[0] //}, //new SchedaTemplate { // Id = 2000, // Options = new Option[0] //}, //new SchedaTemplate { // Id = 4000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" } // } //}, //new SchedaTemplate { // Id = 5000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 6000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'N'}" } // Includi cc in monetario // } //}, // new SchedaTemplate { // Id = 7000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" } // } //}, //new SchedaTemplate { // Id = 8000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" } // } //}, //new SchedaTemplate { // Id = 9000, // Options = new[] // { // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra tabella progetti investimento // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella progetti previdenza // } // }, //new SchedaTemplate { // Id = 11000, // Options = new[] // { // new Option { Key = "Opzione4", Value = "{'visualizzazione':'S'}" } // } //}, //new SchedaTemplate { // Id = 12000, // Options = new[] // { // new Option { Key = "Opzione5", Value = "{'raggruppamento':'AB'}" } // } //}, // new SchedaTemplate { // Id = 13000, // Options = new Option[0] //}, //new SchedaTemplate { // Id = 15000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" }, // Visualizzazione per controvalore/percentuale // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" }, //Mostra tabella // new Option { Key = "Opzione4_3", Value = "{'visualizzazione':'S'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 16000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // Visualizzazione per controvalore/percentuale // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'N'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 17000, // Options = new[] // { // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'N'}" }, //Mostra tutte le valute // new Option { Key = "Opzione4_3", Value = "{'visualizzazione':'S'}" }, //Mostra tabella // new Option { Key = "Opzione4_4", Value = "{'visualizzazione':'N'}" } // Includi cc in monetario // } // }, //new SchedaTemplate { // Id = 18000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } // }, //new SchedaTemplate { // Id = 19000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } //}, // new SchedaTemplate { // Id = 20000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } // }, // new SchedaTemplate { // Id = 21000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } // }, // new SchedaTemplate { // Id = 22000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } //}, //new SchedaTemplate { // Id = 23000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } //// }, //new SchedaTemplate { // Id = 24000, // Options = new[] // { // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'N'}" }, //Mostra tabella asset // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" }, //Mostra tabella valute // new Option { Key = "Opzione4_3", Value = "{'visualizzazione':'S'}" }, //Mostra tabella rendimenti // } //}, //new SchedaTemplate { // Id = 25000, // Options = new[] // { // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra tabella progetti investimento // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella progetti previdenza // } // }, // new SchedaTemplate { // Id = 26000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'M'}" }, //Macro asset class o Asset class // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'N'}" }, //Mostra colonna valore intermedio // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'N'}" }, //Mostra tabella statistiche // } //}, // new SchedaTemplate { // Id = 27000, // Options = new[] // { // new Option { Key = "Opzione3_1", Value = "{'visualizzazione':'A'}" }, //Macro asset class o Asset class // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, //Mostra controvalore o percentuale // } //}, new SchedaTemplate { Id = 28000, Options = new[] { new Option { Key = "Opzione3", Value = "{'visualizzazione':'A'}" }, //Macro asset class o Asset class new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra colonna valore intermedio new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" }, //Mostra tabella statistiche } }, new SchedaTemplate { Id = 29000, Options = new[] { new Option { Key = "Opzione3", Value = "{'visualizzazione':'A'}" }, //Macro asset class o Asset class new Option { Key = "Opzione4", Value = "{'visualizzazione':'C'}" }, //Mostra controvalore o percentuale } }, //new SchedaTemplate { // Id = 30000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // } // }, //new SchedaTemplate { // Id = 32000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // Visualizzazione per controvalore/percentuale // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" }, //Mostra tabella // new Option { Key = "Opzione4_3", Value = "{'visualizzazione':'S'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 33000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" }, // Visualizzazione per controvalore/percentuale // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 34000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } //}, //new SchedaTemplate { // Id = 35000, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } //}, //new SchedaTemplate { // Id = 36000, // Options = new Option[0] //}, //new SchedaTemplate { // Id = 37000, // Options = new Option[0] //}, //new SchedaTemplate { // Id = 38000, // Options = new Option[0] //}, //new SchedaTemplate { // Id = 39000, // Options = new Option[0] //}, } }; #endregion #region Template preso da DB //template = new Template { IdModello = -1, Nome = "Car_51_2" }; //lindaprop2 -linda62 lindaprop55 - lindaMon - //template = new Template { IdModello = -1, Nome = "Car_S13_Roncu" }; //lindaprop2 -linda62 lindaprop55 - lindaMon - //var imagePdf = reportManager.CreaReport("014296", "RNCRRT45T28H199A", "", "F", 175615, template, new ConsulenzaUnicaWS.Parametro[0]); // codiceAgente=009766 codiceFiscale=CRCLDJ53H06F381S codiceMandato= codiceRete=F chiave=95666 //template = new Template { IdModello = -1, Nome = "SavingMapNote3" }; //lindaprop2 -linda62 lindaprop55 - lindaMon - // codiceAgente=009766 codiceFiscale=CRCLDJ53H06F381S codiceMandato= codiceRete=F chiave=95666 //var imagePdf = reportManager.CreaReport("009766", "CRCLDJ53H06F381S", "", "F", 95666, template, new ConsulenzaUnicaWS.Parametro[0]); //template = new Template { IdModello = -1, Nome = "Test_DiagnosiProQuota3" }; //lindaprop2 -linda62 lindaprop55 - lindaMon - template = new Template { IdModello = -1, Nome = "DiagnosiSavingMap" }; //var imagePdf = reportManager.CreaReport("015312", "DMECST71D10H501E", "", "F", 1372762, template, new ConsulenzaUnicaWS.Parametro[0]); var imagePdf = reportManager.CreaReport("014081", "CNTFRC76L15F205H", "", "F", 520196, template, new ConsulenzaUnicaWS.Parametro[0]); //var imagePdf = reportManager.CreaReport("015312", "CLMFNC71D10L892C", "", "F", 50006258, template, new ConsulenzaUnicaWS.Parametro[0]); // Collaudo //template = new Template { IdModello = -1, Nome = "Car_AllDiag" }; //var imagePdf = reportManager.CreaReport("008203", "01816151003", "383", "F", 1735045, template, new ConsulenzaUnicaWS.Parametro[0]); #endregion //var imagePdf = reportManager.CreaReport("012057", "DNDMCL54A11L551Z", "", "F", 19000002, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("015460", "GRCFRZ51A14C351K", "", "F", 29470952, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("015312", "SPSPQL64R29F839N", "", "F", 2310750, template, new ConsulenzaUnicaWS.Parametro[0]); //var imagePdf = reportManager.CreaReport("010642", "PRNDRN56B10H622K", "", "F", 72737, template, new ConsulenzaUnicaWS.Parametro[0]); //CAR_51_2 //var imagePdf = reportManager.CreaReport("012278", "GFFSLL50T44F205Z", "", "F", 72737, template, new ConsulenzaUnicaWS.Parametro[0]); //"Car_51_3" test 1 // var imagePdf = reportManager.CreaReport("012225", "QGLLND58R42E897H", "", "F", 72737, template, new ConsulenzaUnicaWS.Parametro[0]); //"Car_51_3" test 2 //var imagePdf = reportManager.CreaReport("006803", "BDNFNC35C05G999H", "", "F", 72737, template, new ConsulenzaUnicaWS.Parametro[0]); //var imagePdf = reportManager.CreaReport("013804", "CTSLRA66L41L219S", "", "F", 29479222, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("015312", "DMECST71D10H501E", "", "F", 19000525, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("011246", "MRNBNC27C42H264B", "", "F", 9397755, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("014824", "BRRGCM60T18H501N", "", "F", 19010977, template, new ConsulenzaUnicaWS.Parametro[0]); //var imagePdf = reportManager.CreaReport("011717", "BCCGMR41P70A163E", "", "F", 1210, template, new ConsulenzaUnicaWS.Parametro[0]); //var imagePdf = reportManager.CreaReport("009510", "BBDGNN64A17A056C", "", "F", 1014, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("015312", "DMECST71D10H501E", "", "F", 1372762, template, new ConsulenzaUnicaWS.Parametro[0]); //var imagePdf = reportManager.CreaReport("003183", "FLCCRL58C46D883C", "", "S", 19000775, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("012896", "BLFCRN27P54I673J", "", "F", 19000760, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("000955", "BNCMNL72S15F205Z", "", "S", 19000216, template, new ConsulenzaUnicaWS.Parametro[0]); //var imagePdf = reportManager.CreaReport("013297", "NNNPLA60P52F839S", "", "F", 1384268, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("011523", "GRNTLI44R53I914Z", "", "F", 19000391, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("002317", "RBNMLV60D45H294F", "", "F", 1728493, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("006803", "MNTLRN30M63F551I", "", "F", 19000442, template, new ConsulenzaUnicaWS.Parametro[0]); // var imagePdf = reportManager.CreaReport("008500", "", "", "F", 8509, template, new ConsulenzaUnicaWS.Parametro[0]); if (imagePdf == null) return; Session["pdf"] = imagePdf; Response.Redirect("Report.aspx", false); } /// /// Crea il report Monitoraggio /// /// /// protected void btn_Monitoraggio_Click(object sender, EventArgs e) { var reportManager = new ReportManager(); reportManager.Timeout = 60000 * 10; //10 minuti var chiaveClientePb = tx_chiave.Text != "" ? int.Parse(tx_chiave.Text) : 0; #region Template costruito var template = new Template { CodicePb = "", IdModello = 5, //5(Fideuram), 6(SanPaolo) 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] //}, //new SchedaTemplate { // Id = 2002, // Options = new Option[0] //}, // new SchedaTemplate { // Id = 4002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" } // } //}, //new SchedaTemplate { // Id = 5002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 6002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'N'}" } // Includi cc in monetario // } //}, // new SchedaTemplate { // Id = 7002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" } // } //}, //new SchedaTemplate { // Id = 8002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" } // } //}, //new SchedaTemplate { // Id = 9002, // Options = new[] // { // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra tabella progetti investimento // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella progetti previdenza // } // }, //new SchedaTemplate { // Id = 11002, // Options = new[] // { // new Option { Key = "Opzione4", Value = "{'visualizzazione':'S'}" } // } //}, //new SchedaTemplate { // Id = 15002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" }, // Visualizzazione per controvalore/percentuale // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" }, //Mostra tabella // new Option { Key = "Opzione4_3", Value = "{'visualizzazione':'S'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 16002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // Visualizzazione per controvalore/percentuale // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'N'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 17002, // Options = new[] // { // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'N'}" }, //Mostra tutte le valute // new Option { Key = "Opzione4_3", Value = "{'visualizzazione':'S'}" }, //Mostra tabella // new Option { Key = "Opzione4_4", Value = "{'visualizzazione':'N'}" } // Includi cc in monetario // } // }, //new SchedaTemplate { // Id = 18002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } // }, // new SchedaTemplate { // Id = 20002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } // }, // new SchedaTemplate { // Id = 21002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } // }, // new SchedaTemplate { // Id = 22002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } //}, //new SchedaTemplate { // Id = 23002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } //// }, //new SchedaTemplate { // Id = 24002, // Options = new[] // { // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'N'}" }, //Mostra tabella asset // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" }, //Mostra tabella valute // new Option { Key = "Opzione4_3", Value = "{'visualizzazione':'S'}" }, //Mostra tabella rendimenti // } //}, //new SchedaTemplate { // Id = 25002, // Options = new[] // { // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra tabella progetti investimento // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella progetti previdenza // } // }, //new SchedaTemplate { // Id = 32002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // Visualizzazione per controvalore/percentuale // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" }, //Mostra tabella // new Option { Key = "Opzione4_3", Value = "{'visualizzazione':'S'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 33002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'P'}" }, // Visualizzazione per controvalore/percentuale // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" } // Includi cc in monetario // } //}, //new SchedaTemplate { // Id = 34002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } //}, //new SchedaTemplate { // Id = 35002, // Options = new[] // { // new Option { Key = "Opzione3", Value = "{'visualizzazione':'C'}" }, // new Option { Key = "Opzione4_1", Value = "{'visualizzazione':'S'}" }, //Mostra grafico a barre // new Option { Key = "Opzione4_2", Value = "{'visualizzazione':'S'}" } //Mostra tabella // } //}, //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 = 66002, // Options = new[] // { // new Option { Key = "Opzione4_1", Value = "{'param':'N'}" }, // Mostra rendimento da avvio monitoraggio delle aree di bisogno / progetti di investimento // new Option { Key = "Opzione4_2", Value = "{'param':'S'}" } // Mostra colonna allocazione modello // } //}, new SchedaTemplate { Id = 67002, Options = new[] { new Option { Key = "Opzione4", Value = "{'param':'S'}" }, // Mostra grafico andamentale } }, // 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] //}, } }; #endregion #region Template preso da DB template = new Template { IdModello = -1, Nome = "Car_S13Bis" }; #endregion //var imagePdf = reportManager.CreaReportOld(chiaveClientePb, template, new ConsulenzaUnicaWS.Parametro[0]); // DONA' DELLE ROSE //var imagePdf = reportManager.CreaReport("014296", "RNCRRT45T28H199A", "", "F", 127235, template, new ConsulenzaUnicaWS.Parametro[0]); var imagePdf = reportManager.CreaReport("002317", "CRDMRC67M14C261K", "", "F", 20585, template, new ConsulenzaUnicaWS.Parametro[0]); //var imagePdf = reportManager.CreaReport("002317", "SVLPLA53T07D434X", "", "F", 530953, template, new ConsulenzaUnicaWS.Parametro[0]); if (imagePdf == null) return; Session["pdf"] = imagePdf; Response.Redirect("Report.aspx", false); } private void caricaCheckboxList(Dictionary 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 lista = new List(); // Dictionary listatemp = new Dictionary(); // 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)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 } public class CookieWebClient : WebClient { public CookieContainer CookieContainer { get; private set; } /// /// This will instanciate an internal CookieContainer. /// public CookieWebClient() { this.CookieContainer = new CookieContainer(); } /// /// Use this if you want to control the CookieContainer outside this class. /// 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; } } } }