964 lines
44 KiB
C#
964 lines
44 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
using System.ServiceModel;
|
|
using System.Text;
|
|
using ULA.Cathay.IntegracionesSAP.EstructuraSAP;
|
|
using Ultimus.Utilitarios;
|
|
|
|
namespace ULA.Cathay.IntegracionesSAP
|
|
{
|
|
public class IntegracionesSAP : IIntegracionesSAP
|
|
{
|
|
private UltimusLogs logs = new UltimusLogs("IntegracionesSAP");
|
|
|
|
public BpResponse ConsultaBP(string COD_CLIENTE, string ID, int TipoConsulta, bool? EsResumen = null)
|
|
{
|
|
logs.Trace("Inicia Método: Consulta BP " + COD_CLIENTE + " ID: " + ID);
|
|
BpResponse Respuesta = new BpResponse();
|
|
ZConsultaBpResponse Res = new ZConsultaBpResponse();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: COD_CLIENTE: " + COD_CLIENTE + " ID: " + ID);
|
|
Res = Conn.ConsultaBP(COD_CLIENTE, ID);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Res != null)
|
|
{
|
|
Respuesta = new BpResponse()
|
|
{
|
|
PrimerApellido = Res.Apellido_1,
|
|
SegundoApellido = Res.Apellido_2,
|
|
CategoriaRiesgo = Res.CategoriaRiesgo,
|
|
CodEjecutivoActivo = Res.CodEjecutivoActivo,
|
|
CodGeneraMonedaExtrangera = Res.CodGeneraMonedaExtrangera,
|
|
CodNivelCapacidadPago = Res.CodNivelCapacidadPago,
|
|
CodProfesion = Res.CodProfesion,
|
|
CodRiesgoCambiario = Res.CodRiesgoCambiario,
|
|
CodSectorEconomico = Res.CodSectorEconomico,
|
|
CodTipoGie = Res.CodTipoGie,
|
|
CodigoCiiu = Res.CodigoCiiu,
|
|
DescEjecutivoActivo = Res.DescEjecutivoActivo,
|
|
DescGeneraMonedaExtrangera = Res.DescGeneraMonedaExtrangera,
|
|
DescNivelCapacidadPago = Res.DescNivelCapacidadPago,
|
|
DescProfesion = Res.DescProfesion,
|
|
DescRiesgoCambiario = Res.DescRiesgoCambiario,
|
|
DescTipoGie = Res.DescTipoGie,
|
|
Direccion = Res.Direccion,
|
|
Estado = Res.Estado,
|
|
EstadoCivil = Res.EstadoCivil,
|
|
Identificacion = Res.Identificacion,
|
|
Nombre = Res.Nombre,
|
|
NumCliente = Res.NumCliente,
|
|
SectorEconomico = Res.SectorEconomico,
|
|
CorreoElectronico = Res.CorreoElectronico,
|
|
BPExterno = Res.BpExterno,
|
|
NivelCHP = Res.NivelChp,
|
|
DiasAtraso = Res.DiasAtraso
|
|
};
|
|
|
|
if (EsResumen == null || EsResumen == false)
|
|
Respuesta.Operacion = ConsultaOperacionesCliente(Res.NumCliente, TipoConsulta);
|
|
|
|
else if (EsResumen == true)
|
|
Respuesta.Operacion = ResumenOperacionesCliente(Res.NumCliente);
|
|
|
|
Respuesta.Linea = ConsultaLineasCliente(Res.NumCliente);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
Res = null;
|
|
}
|
|
logs.Trace("Finaliza ejecución del método Consulta BP " + COD_CLIENTE + " ID: " + ID);
|
|
return Respuesta;
|
|
}
|
|
|
|
public BpResponse ConsultaNumeroBP(string COD_CLIENTE, string ID)
|
|
{
|
|
logs.Trace("Inicia Método: Consulta BP " + COD_CLIENTE + " ID: " + ID);
|
|
BpResponse Respuesta = new BpResponse();
|
|
ZConsultaBpResponse Res = new ZConsultaBpResponse();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: COD_CLIENTE: " + COD_CLIENTE + " ID: " + ID);
|
|
Res = Conn.ConsultaBP(COD_CLIENTE, ID);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Res != null)
|
|
{
|
|
Respuesta = new BpResponse()
|
|
{
|
|
PrimerApellido = Res.Apellido_1,
|
|
SegundoApellido = Res.Apellido_2,
|
|
CategoriaRiesgo = Res.CategoriaRiesgo,
|
|
CodEjecutivoActivo = Res.CodEjecutivoActivo,
|
|
CodGeneraMonedaExtrangera = Res.CodGeneraMonedaExtrangera,
|
|
CodNivelCapacidadPago = Res.CodNivelCapacidadPago,
|
|
CodProfesion = Res.CodProfesion,
|
|
CodRiesgoCambiario = Res.CodRiesgoCambiario,
|
|
CodSectorEconomico = Res.CodSectorEconomico,
|
|
CodTipoGie = Res.CodTipoGie,
|
|
CodigoCiiu = Res.CodigoCiiu,
|
|
DescEjecutivoActivo = Res.DescEjecutivoActivo,
|
|
DescGeneraMonedaExtrangera = Res.DescGeneraMonedaExtrangera,
|
|
DescNivelCapacidadPago = Res.DescNivelCapacidadPago,
|
|
DescProfesion = Res.DescProfesion,
|
|
DescRiesgoCambiario = Res.DescRiesgoCambiario,
|
|
DescTipoGie = Res.DescTipoGie,
|
|
Direccion = Res.Direccion,
|
|
Estado = Res.Estado,
|
|
EstadoCivil = Res.EstadoCivil,
|
|
Identificacion = Res.Identificacion,
|
|
Nombre = Res.Nombre,
|
|
NumCliente = Res.NumCliente,
|
|
SectorEconomico = Res.SectorEconomico,
|
|
CorreoElectronico = Res.CorreoElectronico,
|
|
BPExterno = Res.BpExterno,
|
|
NivelCHP = Res.NivelChp,
|
|
DiasAtraso = Res.DiasAtraso
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
Res = null;
|
|
}
|
|
logs.Trace("Finaliza ejecución del método Consulta BP " + COD_CLIENTE + " ID: " + ID);
|
|
return Respuesta;
|
|
}
|
|
|
|
public CapitalAjustadoResponse ConsultaCapitalAjustado()
|
|
{
|
|
logs.Trace("Inicia Método: ConsultaCapitalAjustado");
|
|
CapitalAjustadoResponse Respuesta = new CapitalAjustadoResponse();
|
|
ZConsultaCapitalAjustadoResponse Res = new ZConsultaCapitalAjustadoResponse();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
Res = Conn.ConsultaCapitalAjustado();
|
|
|
|
}
|
|
|
|
if (Res != null)
|
|
Respuesta = new CapitalAjustadoResponse()
|
|
{
|
|
FechaReferencia = string.IsNullOrWhiteSpace(Res.FechaReferencia) ? DateTime.MinValue : new DateTime(int.Parse(Res.FechaReferencia.Substring(0, 4)), int.Parse(Res.FechaReferencia.Substring(4, 2)), int.Parse(Res.FechaReferencia.Substring(6, 2))),
|
|
MontoPatrimonio = Res.MontoPatrimonio
|
|
};
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
Res = null;
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ConsultaCapitalAjustado");
|
|
return Respuesta;
|
|
}
|
|
|
|
public LineaResponse ConsultaLinea(string NumeroLinea)
|
|
{
|
|
logs.Trace("Inicia Método: ConsultaLinea " + NumeroLinea);
|
|
LineaResponse Respuesta = new LineaResponse();
|
|
ZConsultaLineaResponse Res = new ZConsultaLineaResponse();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: NumeroLinea: " + NumeroLinea);
|
|
Res = Conn.ConsultaLinea(NumeroLinea);
|
|
|
|
}
|
|
|
|
|
|
Respuesta = new LineaResponse()
|
|
{
|
|
Apellido_1 = Res.Apellido_1,
|
|
Apellido_2 = Res.Apellido_2,
|
|
Identificacion = Res.Identificacion,
|
|
Moneda = Res.Moneda,
|
|
Monto = Res.Monto,
|
|
Nombre = Res.Nombre,
|
|
NumCliente = Res.NumCliente
|
|
};
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
Res = null;
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ConsultaLinea " + NumeroLinea);
|
|
return Respuesta;
|
|
}
|
|
|
|
public int ConsultaMorosidadCCSS(string Identificacion)
|
|
{
|
|
logs.Trace("Inicia Método: ConsultaMorosidadCCSS " + Identificacion);
|
|
int Respuesta = -1;
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: NumeroLinea: " + Identificacion);
|
|
Respuesta = Conn.ConsultaMorosidadCCSS(Identificacion);
|
|
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ConsultaMorosidadCCSS" + Identificacion);
|
|
return Respuesta;
|
|
}
|
|
|
|
public List<Operaciones> ConsultaOperacionesCliente(string Cod_Cliente, int TipoConsulta)
|
|
{
|
|
logs.Trace("Inicia Método: ConsultaOperacionesCliente " + Cod_Cliente + " TipoConsulta: " + TipoConsulta.ToString());
|
|
List<Operaciones> Respuesta = new List<Operaciones>();
|
|
ZConsultaOperacionesClienteResponse Res = new ZConsultaOperacionesClienteResponse();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: Cod_Cliente: " + Cod_Cliente + " TipoConsulta: " + TipoConsulta.ToString());
|
|
Res = Conn.ConsultaOperacionesCliente(Cod_Cliente, TipoConsulta);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Res != null)
|
|
{
|
|
foreach (ZebOperacion oper in Res.ListaOperaciones)
|
|
{
|
|
Respuesta.Add(new Operaciones()
|
|
{
|
|
Operacion = oper.Operacion,
|
|
Linea = oper.Linea,
|
|
FechaApertura = oper.FechaApertura,
|
|
FechaVencimiento = oper.FechaVencimiento,
|
|
MontoSolicitado = oper.MontoSolicitado,
|
|
TasaInteres = oper.TasaInteresFinal,
|
|
TipoTasaRef = oper.TipoTasaRef,
|
|
ValorTasaRef = oper.ValorTasaRef,
|
|
TasaBaseSpread = oper.TasaBase,
|
|
SaldoPendiente = oper.SaldoPendiente,
|
|
CodEstado = oper.CodEstado,
|
|
DescEstado = oper.DescEstado,
|
|
TipoOperacion = oper.TipoOperacion,
|
|
DescTipoOperacion = oper.DescTipoOperacion,
|
|
Moneda = oper.Moneda,
|
|
Plazo = oper.Plazo,
|
|
TipoNaturalezaGasto = oper.TipoNaturalezaGasto,
|
|
DescNaturalezaGasto = oper.DescNaturalezaGasto,
|
|
TipoDestinoUtilizacion = oper.TipoDestinoUtilizacion,
|
|
DescDestinoUtilizacion = oper.DescDestinoUtilizacion,
|
|
TipoGarantia = oper.TipoGarantia,
|
|
DescTipoGarantia = oper.DescTipoGarantia,
|
|
Comisiones = oper.Comisiones,
|
|
FormasDePago = oper.FormasDePago
|
|
});
|
|
}
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ConsultaOperacionesCliente " + Cod_Cliente + " TipoConsulta: " + TipoConsulta.ToString());
|
|
return Respuesta;
|
|
}
|
|
|
|
public RegistroCivil ConsultaRegistroCivil(string Identificacion)
|
|
{
|
|
logs.Trace("Inicia Método: ConsultaRegistroCivil " + Identificacion);
|
|
|
|
RegistroCivil Respuesta = new RegistroCivil();
|
|
RespuestaRegistroCivil Res = new RespuestaRegistroCivil();
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: Identificacion: " + Identificacion);
|
|
Res = Conn.ConsultaRegistroCivil(Identificacion.Replace("-", ""));
|
|
|
|
}
|
|
if (Res != null)
|
|
{
|
|
Respuesta = new RegistroCivil()
|
|
{
|
|
Nombre = Res.Nombre,
|
|
Apellido1 = Res.Apellido1,
|
|
Apellido2 = Res.Apellido2,
|
|
Defunsion = Res.Defunsion,
|
|
FechaNacimiento = Res.FechaNacimiento
|
|
};
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ConsultaRegistroCivil " + Identificacion);
|
|
return Respuesta;
|
|
}
|
|
|
|
public RegistroNacional ConsultaRegistroNacional(string Identificacion)
|
|
{
|
|
logs.Trace("Inicia Método: ConsultaRegistroNacional " + Identificacion);
|
|
|
|
RegistroNacional Respuesta = new RegistroNacional();
|
|
RespuestaRegistroNacional Res = new RespuestaRegistroNacional();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: Identificacion: " + Identificacion);
|
|
Res = Conn.ConsultaRegistroNacional(Identificacion);
|
|
|
|
}
|
|
if (Res != null)
|
|
{
|
|
Respuesta = new RegistroNacional()
|
|
{
|
|
RazonSocial = Res.RazonSocial,
|
|
Estado = Res.Estado
|
|
};
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ConsultaRegistroNacional " + Identificacion);
|
|
return Respuesta;
|
|
}
|
|
|
|
public TipoCambioContable ObtenerTipoCambioContable()
|
|
{
|
|
logs.Trace("Inicia Método: ObtenerTipoCambioContable");
|
|
TipoCambioContable Respuesta = new TipoCambioContable();
|
|
OBTENER_TIPO_CAMBIO_CONTABLEResponse Res = new OBTENER_TIPO_CAMBIO_CONTABLEResponse();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
Res = Conn.ObtenerTipoCambioContable();
|
|
|
|
}
|
|
if (Res != null)
|
|
Respuesta = new TipoCambioContable() { TipoCambio = Res.TIPO_CAMBIO };
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ObtenerTipoCambioContable");
|
|
return Respuesta;
|
|
}
|
|
|
|
public SolicitudSAP ConsultaSolicitud(string NUM_SOLICITUD)
|
|
{
|
|
logs.Trace("Inicia Método: ConsultaSolicitud " + NUM_SOLICITUD);
|
|
SolicitudSAP Respuesta = new SolicitudSAP();
|
|
ZConsultaSolicitudResponse Res = new ZConsultaSolicitudResponse();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: NUM_SOLICITUD: " + NUM_SOLICITUD);
|
|
Res = Conn.ConsultaSolicitud(NUM_SOLICITUD);
|
|
|
|
}
|
|
|
|
Respuesta = new SolicitudSAP()
|
|
{
|
|
ClaseProducto = Res.ClaseProducto,
|
|
CodCliente = Res.CodCliente,
|
|
Monto = Res.Monto,
|
|
MontoCuota = Res.MontoCuota,
|
|
NumeroLineaAsoc = Res.NumeroLineaAsoc,
|
|
Plazo = Res.Plazo,
|
|
TasaBase = Res.TasaBase,
|
|
TasaFinal = Res.TasaFinal,
|
|
TipoTasaRef = Res.TipoTasaRef,
|
|
ValorTasaRef = Res.ValorTasaRef,
|
|
};
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ConsultaSolicitud " + NUM_SOLICITUD);
|
|
return Respuesta;
|
|
}
|
|
|
|
public List<Lineas> ConsultaLineasCliente(string Cod_Cliente)
|
|
{
|
|
logs.Trace("Inicia Método: ConsultaLineasCliente " + Cod_Cliente);
|
|
List<Lineas> Respuesta = new List<Lineas>();
|
|
ZConsultaLineasClienteResponse Res = new ZConsultaLineasClienteResponse();
|
|
Lineas LineaActual;
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: Cod_Cliente: " + Cod_Cliente);
|
|
Res = Conn.ConsultaLineasCliente(Cod_Cliente);
|
|
|
|
}
|
|
if (Res != null)
|
|
{
|
|
foreach (ZebLineas line in Res.Lineas)
|
|
{
|
|
LineaActual = new Lineas();
|
|
LineaActual.NumeroLinea = line.NumeroLinea;
|
|
LineaActual.TipoClaseLinea = line.TipoClaseLinea;
|
|
LineaActual.DescClaseLinea = line.DescClaseLinea;
|
|
LineaActual.FechaApertura = line.FechaApertura;
|
|
LineaActual.FechaVencimiento = line.FechaVencimiento;
|
|
LineaActual.Monto = line.Monto;
|
|
LineaActual.MontoDisponible = line.MontoDisponible;
|
|
LineaActual.MontoUtilizado = line.MontoUtilizado;
|
|
LineaActual.MontoSobreGiro = line.MontoSobregiro;
|
|
LineaActual.TipoNaturalezaGasto = line.TipoNaturalezaGasto;
|
|
LineaActual.DescNaturalezaGasto = line.DescNaturalezaGasto;
|
|
LineaActual.Moneda = line.Moneda;
|
|
LineaActual.Plazo = line.Plazo;
|
|
LineaActual.Garantias = line.Garantias;
|
|
|
|
LineaActual.Fiadores = new List<Bp>();
|
|
|
|
foreach (ZebBp q in line.Fiadores)
|
|
{
|
|
LineaActual.Fiadores.Add(new Bp()
|
|
{
|
|
CodCliente = q.CodCliente,
|
|
Nombre = q.Nombre,
|
|
});
|
|
}
|
|
|
|
LineaActual.Aprobadores = new List<Aprobador>();
|
|
foreach (ZebAprobador q in line.Aprobadores)
|
|
{
|
|
LineaActual.Aprobadores.Add(new Aprobador()
|
|
{
|
|
IdUsuario = q.IdUsuario,
|
|
NombreUsuario = q.NombreUsuario,
|
|
Codigojerarquia = q.Codigojerarquia,
|
|
DescJerarquia = q.DescJerarquia,
|
|
IdRango = q.IdRango,
|
|
});
|
|
}
|
|
|
|
LineaActual.Sublimites = new List<Sublimite>();
|
|
foreach (ZebSublimite q in line.Sublimites)
|
|
{
|
|
LineaActual.Sublimites.Add(new Sublimite()
|
|
{
|
|
Clasesublimite = q.Clasesublimite,
|
|
Tasabaseinteres = q.Tasabaseinteres,
|
|
ValorTasaRef = q.ValorTasaRef,
|
|
Vartasaint = q.Vartasaint,
|
|
Tasabasemoratori = q.Tasabasemoratori,
|
|
Vartasamora = q.Vartasamora,
|
|
Comision = q.Comision,
|
|
Comisionminima = q.Comisionminima,
|
|
Plazomininteres = q.Plazomininteres,
|
|
Montomaxlimite = q.Montomaxlimite,
|
|
Tasaintfijo = q.Tasaintfijo,
|
|
Tasaintfijomora = q.Tasaintfijomora,
|
|
Moneda = q.Moneda,
|
|
Usuario = q.Usuario,
|
|
TasaintfijoMd = q.TasaintfijoMd,
|
|
TasabaseinterMd = q.TasabaseinterMd,
|
|
VartasaintMd = q.VartasaintMd,
|
|
TasabasemoraMd = q.TasabasemoraMd,
|
|
VartasamoraMd = q.VartasamoraMd,
|
|
TasaintfijomoraMd = q.TasaintfijomoraMd,
|
|
FechaAprobacion = q.FechaAprobacion,
|
|
Numcaratula = q.Numcaratula,
|
|
Formapago = q.Formapago,
|
|
Observaciones = q.Observaciones,
|
|
Disponible=q.Disponible
|
|
|
|
});
|
|
}
|
|
|
|
Respuesta.Add(LineaActual);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
|
|
finally
|
|
{
|
|
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ConsultaLineasCliente " + Cod_Cliente);
|
|
return Respuesta;
|
|
}
|
|
|
|
public TasaBase ObtenerTasasBase()
|
|
{
|
|
logs.Trace("Inicia Método: ObtenerTasasBase");
|
|
TasaBase Respuesta = new TasaBase();
|
|
ZConsultaTasaBaseResponse Res = new ZConsultaTasaBaseResponse();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
Res = Conn.ObtenerTasasBase();
|
|
|
|
}
|
|
|
|
if (Res != null)
|
|
Respuesta = new TasaBase()
|
|
{
|
|
TasaBasePasiva = Res.TasaBasePasiva,
|
|
TasaBasePrime = Res.TasaBasePrime
|
|
};
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
Res = null;
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ObtenerTasasBase");
|
|
return Respuesta;
|
|
}
|
|
|
|
public List<Catalogo> Catalogos(TiposCatalgo Tipo)
|
|
{
|
|
List<Catalogo> Respuesta = new List<Catalogo>();
|
|
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
switch (Tipo)
|
|
{
|
|
case TiposCatalgo.ClaseProducto:
|
|
logs.Trace("Inicia Método: CatalogoClaseProducto");
|
|
ZCatalogoClaseProductoResponse ClaseProducto = Conn.CatalogoClaseProducto();
|
|
|
|
if (ClaseProducto != null)
|
|
Respuesta = (from q in ClaseProducto.ClasesProducto
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.ClaseProducto,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoClaseProducto");
|
|
|
|
break;
|
|
case TiposCatalgo.DestinoUtilizacion:
|
|
logs.Trace("Inicia Método: CatalogoDestinoUtilizacion");
|
|
ZCatalogoDestinoUtilizacionResponse DestinoUtilizacion = Conn.CatalogoDestinoUtilizacion();
|
|
|
|
if (DestinoUtilizacion != null)
|
|
Respuesta = (from q in DestinoUtilizacion.DestinoUtilizacion
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.CodigoDestino,
|
|
descripcion = q.Descripcion,
|
|
CodigoDependencia = q.CodigoHomologacion,
|
|
descripcionDependencia = q.DescHomologacion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoDestinoUtilizacion");
|
|
break;
|
|
case TiposCatalgo.EstadoOperacion:
|
|
logs.Trace("Inicia Método: CatalogoEstadoOperacion");
|
|
ZCatalogoEstadoOperacionResponse EstadoOperacion = Conn.CatalogoEstadoOperacion();
|
|
|
|
if (EstadoOperacion != null)
|
|
Respuesta = (from q in EstadoOperacion.CodigosEstado
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.CodEstado,
|
|
descripcion = q.Descripcion,
|
|
CodigoDependencia = q.ClaseProducto
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoEstadoOperacion");
|
|
break;
|
|
case TiposCatalgo.GIE:
|
|
logs.Trace("Inicia Método: CatalogoGIE");
|
|
ZCatalogoGieResponse GIE = Conn.CatalogoGIE();
|
|
|
|
if (GIE != null)
|
|
Respuesta = (from q in GIE.TiposGie
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.TipoGie,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoGIE");
|
|
break;
|
|
case TiposCatalgo.JerarquiaAutorizacion:
|
|
logs.Trace("Inicia Método: CatalogoJerarquiaAutorizacion");
|
|
ZCatalogoJerarquiaAproResponse JerarquiaAutorizacion = Conn.CatalogoJerarquiaAutorizacion();
|
|
|
|
if (JerarquiaAutorizacion != null)
|
|
Respuesta = (from q in JerarquiaAutorizacion.JerarquiasAprobacion
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.CodJerarquia,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoJerarquiaAutorizacion");
|
|
break;
|
|
case TiposCatalgo.NaturalezaGasto:
|
|
logs.Trace("Inicia Método: CatalogoNaturalezaGasto");
|
|
ZCatalogoNaturalezaGastoResponse NaturalezaGasto = Conn.CatalogoNaturalezaGasto();
|
|
|
|
if (NaturalezaGasto != null)
|
|
Respuesta = (from q in NaturalezaGasto.TiposNaturalezaGasto
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.TipoNaturGasto,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoNaturalezaGasto");
|
|
break;
|
|
case TiposCatalgo.TipoGarantia:
|
|
logs.Trace("Inicia Método: CatalogoTipoGarantia");
|
|
ZCatalogoTipoGarantiaResponse TipoGarantia = Conn.CatalogoTipoGarantia();
|
|
|
|
if (TipoGarantia != null)
|
|
Respuesta = (from q in TipoGarantia.TiposGarantia
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.TipoGarantia,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoTipoGarantia");
|
|
break;
|
|
case TiposCatalgo.ClaseLinea:
|
|
logs.Trace("Inicia Método: CatalogoClaseLinea");
|
|
ZCatalogoClaseLineaResponse ClaseLinea = Conn.CatalogoClaseLinea();
|
|
|
|
if (ClaseLinea != null)
|
|
Respuesta = (from q in ClaseLinea.ClasesLinea
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.ClaseLinea,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoClaseLinea");
|
|
break;
|
|
case TiposCatalgo.CapacidadPago:
|
|
logs.Trace("Inicia Método: CatalogoCapacidadPago");
|
|
ZCatalogoCapacidadPagoResponse CapacidadPago = Conn.CatalogoCapacidadPago();
|
|
|
|
if (CapacidadPago != null)
|
|
Respuesta = (from q in CapacidadPago.CapacidadDePago
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.CodCapacidadPago,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoCapacidadPago");
|
|
break;
|
|
case TiposCatalgo.CategoriaRiesgo:
|
|
logs.Trace("Inicia Método: CatalogoCategoriaRiesgo");
|
|
ZCatalogoCategoriaRiesgoResponse CategoriaRiesgo = Conn.CatalogoCategoriaRiesgo();
|
|
|
|
if (CategoriaRiesgo != null)
|
|
Respuesta = (from q in CategoriaRiesgo.CategoriaRiesgo
|
|
select new Catalogo()
|
|
{
|
|
codigo = q,
|
|
descripcion = q
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoCategoriaRiesgo");
|
|
break;
|
|
case TiposCatalgo.GeneradorMonedaExtrangera:
|
|
logs.Trace("Inicia Método: CatalogoGeneradorMonedaExtrangera");
|
|
ZCatalogoGenMonedaExtrangeResponse MonedaExtrangera = Conn.CatalogoGeneradorMonedaExtrangera();
|
|
|
|
if (MonedaExtrangera != null)
|
|
Respuesta = (from q in MonedaExtrangera.GeneraMonedaExtrangera
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.CodGeneraMonedaExtrange,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoGeneradorMonedaExtrangera");
|
|
break;
|
|
case TiposCatalgo.Profesion:
|
|
logs.Trace("Inicia Método: CatalogoProfesion");
|
|
ZCatalogoProfesionResponse Profesion = Conn.CatalogoProfesion();
|
|
|
|
if (Profesion != null)
|
|
Respuesta = (from q in Profesion.Profesion
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.CodProfesion,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoProfesion");
|
|
break;
|
|
case TiposCatalgo.SectorEconomico:
|
|
logs.Trace("Inicia Método: CatalogoSectorEconomico");
|
|
ZCatalogoSectorEconomicoResponse SectorEconomico = Conn.CatalogoSectorEconomico();
|
|
|
|
if (SectorEconomico != null)
|
|
Respuesta = (from q in SectorEconomico.SectorEconomico
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.CodSectorEconomico,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoSectorEconomico");
|
|
break;
|
|
case TiposCatalgo.RiesgoCambiario:
|
|
logs.Trace("Inicia Método: CatalogoRiesgoCambiario");
|
|
ZCatalogoRiesgoCambiarioResponse RiesgoCambiario = Conn.CatalogoRiesgoCambiario();
|
|
if (RiesgoCambiario != null)
|
|
Respuesta = (from q in RiesgoCambiario.RiesgoCambiario
|
|
select new Catalogo()
|
|
{
|
|
codigo = q.CodRiesgoCambiario,
|
|
descripcion = q.Descripcion
|
|
}).ToList();
|
|
logs.Trace("Finaliza ejecución del método CatalogoRiesgoCambiario");
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
}
|
|
return Respuesta;
|
|
}
|
|
|
|
public List<UsuariosAprobadores> ObtenerUsuariosAprobadores()
|
|
{
|
|
logs.Trace("Inicia Método: CatalogoRiesgoCambiario");
|
|
List<UsuariosAprobadores> respuesta = new List<UsuariosAprobadores>();
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
|
|
ZCatalogoUsuarioAprobadorResponse UsuarioAprobadorResponse = Conn.CatalogoUsuarioAprobador();
|
|
respuesta = (from u in UsuarioAprobadorResponse.UsuariosAprobadores
|
|
select new UsuariosAprobadores()
|
|
{
|
|
Tipolineacredito = u.Tipolineacredito,
|
|
Desctipolineacredito = u.Desctipolineacredito,
|
|
Idusuario = u.Idusuario,
|
|
Nombre = u.Nombre,
|
|
Codigojerarquia = u.Codigojerarquia,
|
|
DescJerarquia = u.DescJerarquia,
|
|
Idrango = u.Idrango,
|
|
Limiteinferior = u.Limiteinferior,
|
|
Limitesuperior = u.Limitesuperior,
|
|
Moneda = u.Moneda
|
|
}).ToList();
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
}
|
|
logs.Trace("Finaliza ejecución del método CatalogoUsuarioAprobador");
|
|
return respuesta;
|
|
}
|
|
|
|
public ConsultaContrato ObtenerContrato(string NumeroOperacion)
|
|
{
|
|
logs.Trace("Inicia Método: ConsultaContrato " + NumeroOperacion);
|
|
ConsultaContrato respuesta = null;
|
|
try
|
|
{
|
|
using (EntidadBPMSoapClient Conn = new EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: NumeroOperacion: " + NumeroOperacion);
|
|
ZConsultaContratoResponse ConsultaContratoResponse = Conn.ConsultaContrato(NumeroOperacion);
|
|
respuesta = new ConsultaContrato()
|
|
{
|
|
CargoAvaluo = ConsultaContratoResponse.CargoAvaluo,
|
|
CargoPoliza = ConsultaContratoResponse.CargoPoliza,
|
|
CodigoEstado = ConsultaContratoResponse.CodigoEstado,
|
|
CodigoEstadoPago = ConsultaContratoResponse.CodigoEstadoPago,
|
|
Comision = ConsultaContratoResponse.Comision,
|
|
Estado = ConsultaContratoResponse.Estado,
|
|
EstadoPago = ConsultaContratoResponse.EstadoPago,
|
|
EstudioRegistro = ConsultaContratoResponse.EstudioRegistro,
|
|
GastosLegales = ConsultaContratoResponse.GastosLegales,
|
|
HonorariosLegales = ConsultaContratoResponse.HonorariosLegales,
|
|
PolizaDeVida = ConsultaContratoResponse.PolizaDeVida,
|
|
PolizaDesempleo = ConsultaContratoResponse.PolizaDesempleo,
|
|
PrimaPoliza = ConsultaContratoResponse.PrimaPoliza,
|
|
CodigoBP = ConsultaContratoResponse.CodCliente
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ConsultaContrato " + NumeroOperacion);
|
|
return respuesta;
|
|
}
|
|
|
|
public List<Operaciones> ResumenOperacionesCliente(string Cod_Cliente)
|
|
{
|
|
logs.Trace("Inicia Método: ResumenOperacionesCliente " + Cod_Cliente);
|
|
List<Operaciones> Respuesta = new List<Operaciones>();
|
|
ZResumenOperacionesClienteResponse Res = new ZResumenOperacionesClienteResponse();
|
|
try
|
|
{
|
|
using (EstructuraSAP.EntidadBPMSoapClient Conn = new EstructuraSAP.EntidadBPMSoapClient())
|
|
{
|
|
|
|
logs.Trace("Parametros de Entrada: Cod_Cliente: " + Cod_Cliente);
|
|
Res = Conn.ResumenOperacionesCliente(Cod_Cliente);
|
|
|
|
|
|
}
|
|
if (Res != null)
|
|
{
|
|
foreach (ZebOperacion oper in Res.ListaOperaciones)
|
|
{
|
|
Respuesta.Add(new Operaciones()
|
|
{
|
|
Operacion = oper.Operacion,
|
|
Linea = oper.Linea,
|
|
FechaApertura = oper.FechaApertura,
|
|
FechaVencimiento = oper.FechaVencimiento,
|
|
MontoSolicitado = oper.MontoSolicitado,
|
|
TasaInteres = oper.TasaInteresFinal,
|
|
TipoTasaRef = oper.TipoTasaRef,
|
|
ValorTasaRef = oper.ValorTasaRef,
|
|
TasaBaseSpread = oper.TasaBase,
|
|
SaldoPendiente = oper.SaldoPendiente,
|
|
CodEstado = oper.CodEstado,
|
|
DescEstado = oper.DescEstado,
|
|
TipoOperacion = oper.TipoOperacion,
|
|
DescTipoOperacion = oper.DescTipoOperacion,
|
|
Moneda = oper.Moneda,
|
|
Plazo = oper.Plazo,
|
|
TipoNaturalezaGasto = oper.TipoNaturalezaGasto,
|
|
DescNaturalezaGasto = oper.DescNaturalezaGasto,
|
|
TipoDestinoUtilizacion = oper.TipoDestinoUtilizacion,
|
|
DescDestinoUtilizacion = oper.DescDestinoUtilizacion,
|
|
TipoGarantia = oper.TipoGarantia,
|
|
DescTipoGarantia = oper.DescTipoGarantia,
|
|
Comisiones = oper.Comisiones,
|
|
FormasDePago = oper.FormasDePago
|
|
});
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
logs.Trace("Finaliza ejecución del método ResumenOperacionesCliente " + Cod_Cliente);
|
|
return Respuesta;
|
|
|
|
}
|
|
}
|
|
}
|