103 lines
4.7 KiB
C#

using System.Web.Services;
using Consulenza.Base.Business;
namespace Consulenza.Base.Services
{
/// <summary>
/// Summary description for WSProposta
/// </summary>
[WebService(Namespace = "http://it.bancafideuram.report.propostaservice/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class WSProposta : System.Web.Services.WebService
{
#region PROPOSTA BASE CB
/// <summary>
/// Crea il report di Proposta per ConsulenzaBase.
/// </summary>
/// <param name="chiaveCliente">Chiave del cliente</param>
/// <param name="chiaveProposta">Chiave della proposta</param>
/// <returns></returns>
[WebMethod(MessageName = "CreaReport_ConsulenzaBase_Proposta_ChiaveCliente")]
public byte[] CreaReport_ConsulenzaBase_Proposta_ChiaveCliente(int chiaveCliente, int chiaveProposta)
{
return GeneratorService.CreaReport_Proposta(chiaveCliente, chiaveProposta, false);
}
/// <summary>
/// Crea il report di Proposta per ConsulenzaBase.
/// </summary>
/// <param name="codiceRete">Codice della Rete cui il PB (Private Banker) è associato</param>
/// <param name="codicePb">Codice del Private Banker</param>
/// <param name="codiceFiscale">Codice Fiscale</param>
/// <param name="partitaIVA">Partita IVA</param>
/// <param name="codiceMandato">Codice Mandato(nel caso di una Fiduciaria)</param>
/// <param name="chiaveProposta">Chiave della proposta</param>
/// <returns></returns>
[WebMethod(MessageName = "CreaReport_ConsulenzaBase_Proposta_CodiceFiscale_PIVA_Mandato")]
public byte[] CreaReport_ConsulenzaBase_Proposta_CodiceFiscale_PIVA_Mandato(string codiceRete, string codicePb, string codiceFiscale, string partitaIVA, string codiceMandato, int chiaveProposta)
{
return GeneratorService.CreaReport_Proposta(codiceRete, codicePb, codiceFiscale, partitaIVA, codiceMandato, chiaveProposta, false);
}
/// <summary>
/// Crea e salva il report di Proposta per ConsulenzaBase nel database.
/// </summary>
/// <param name="chiaveCliente">Chiave del cliente</param>
/// <param name="chiaveProposta">Chiave della proposta</param>
/// <returns></returns>
[WebMethod(MessageName = "SalvaReport_ConsulenzaBase_Proposta_ChiaveCliente")]
public bool SalvaReport_ConsulenzaBase_Proposta_ChiaveCliente(int chiaveCliente, int chiaveProposta)
{
// Recupero il flusso dati del report
byte[] report = CreaReport_ConsulenzaBase_Proposta_ChiaveCliente(chiaveCliente, chiaveProposta);
//Inserire il flusso dati sul database.
if (report == null)
return false;
else
{
if (report.Length > 0)
return DataService.SalvaReport(chiaveCliente, chiaveProposta, "PROPOSTA", report, false);
else
return false;
}
}
#endregion
[WebMethod(MessageName = "CreaReport_ConsulenzaBaseCU_Proposta_ChiaveCliente")]
public byte[] CreaReport_ConsulenzaBaseCU_Proposta_ChiaveCliente(int chiaveCliente, int chiaveProposta)
{
return GeneratorService.CreaReport_Proposta(chiaveCliente, chiaveProposta, true);
}
[WebMethod(MessageName = "CreaReport_CU_Proposta_CodiceFiscale_PIVA_Mandato")]
public byte[] CreaReport_CU_Proposta_CodiceFiscale_PIVA_Mandato(string codiceRete, string codicePb, string codiceFiscale, string partitaIVA, string codiceMandato, int chiaveProposta)
{
return GeneratorService.CreaReport_Proposta(codiceRete, codicePb, codiceFiscale, partitaIVA, codiceMandato, chiaveProposta, true);
}
[WebMethod(MessageName = "SalvaReport_ConsulenzaBaseCU_Proposta_ChiaveCliente")]
public bool SalvaReport_ConsulenzaBaseCU_Proposta_ChiaveCliente(int chiaveCliente, int chiaveProposta)
{
// Recupero il flusso dati del report
byte[] report = CreaReport_ConsulenzaBaseCU_Proposta_ChiaveCliente(chiaveCliente, chiaveProposta);
//Inserire il flusso dati sul database.
if (report == null)
return false;
else
{
if (report.Length > 0)
return DataService.SalvaReport(chiaveCliente, chiaveProposta, "PROPOSTA", report, true);
else
return false;
}
}
}
}