953 lines
54 KiB
C#
953 lines
54 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web.Http;
|
|
using Ultimus.Utilitarios;
|
|
using ULA.Cathay.Credito.ServicioEPower;
|
|
using ULA.Cathay.CreditoModel.Credito;
|
|
using ULA.Cathay.CreditoModel.DAL.Credito;
|
|
using ULA.Cathay.Credito.Json;
|
|
using Ultimus.Interfaces;
|
|
using System.IO;
|
|
using ULA.Cathay.CreditoModel.Entidades;
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
namespace ULA.Cathay.Credito.ControllersWebApi
|
|
{
|
|
public class EPowerServicioIntegracionAPIController : ApiController
|
|
{
|
|
private UltimusLogs logs = new UltimusLogs("EPowerServicioIntegracionAPI");
|
|
|
|
private System.ServiceModel.BasicHttpBinding BindingSAP;
|
|
private System.ServiceModel.EndpointAddress EndpointSAP;
|
|
|
|
|
|
public EPowerServicioIntegracionAPIController()
|
|
{
|
|
try
|
|
{
|
|
GlobalAPIController.SetRegionalConfig();
|
|
|
|
EndpointSAP = new System.ServiceModel.EndpointAddress(new ObtieneParametros().GetValueKeyRegedit("EPower.IntegracionesEPowerUrl", false));
|
|
|
|
BindingSAP = new System.ServiceModel.BasicHttpBinding();
|
|
BindingSAP.MaxReceivedMessageSize = int.MaxValue;
|
|
BindingSAP.MaxBufferPoolSize = int.MaxValue;
|
|
System.ServiceModel.HttpTransportSecurity security = new System.ServiceModel.HttpTransportSecurity();
|
|
security.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None;
|
|
BindingSAP.Security.Transport = security;
|
|
|
|
BindingSAP.OpenTimeout = new TimeSpan(1, 0, 0);
|
|
BindingSAP.CloseTimeout = new TimeSpan(1, 0, 0);
|
|
BindingSAP.SendTimeout = new TimeSpan(1, 0, 0);
|
|
BindingSAP.ReceiveTimeout = new TimeSpan(1, 0, 0);
|
|
|
|
BindingSAP.MaxBufferPoolSize = 2147483647;
|
|
BindingSAP.MaxReceivedMessageSize = 2147483647;
|
|
BindingSAP.MaxBufferSize = 2147483647;
|
|
|
|
BindingSAP.ReaderQuotas.MaxDepth = 10487760;
|
|
BindingSAP.ReaderQuotas.MaxStringContentLength = 10487760;
|
|
BindingSAP.ReaderQuotas.MaxArrayLength = 16384;
|
|
BindingSAP.ReaderQuotas.MaxBytesPerRead = 10487760;
|
|
BindingSAP.ReaderQuotas.MaxNameTableCharCount = 10487760;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[HttpPost]
|
|
public JsonSolicitud ObtenerConsultaEpower(JsonSolicitud model)
|
|
{
|
|
ConsultaEpowerDAL ConsultaEpowerDal = new ConsultaEpowerDAL();
|
|
|
|
try
|
|
{
|
|
|
|
logs.Trace("Inicia ObtenerConsultaEpower:");
|
|
foreach (Solicitante ModeloSolicitante in model.Solicitud.Solicitante)
|
|
{
|
|
if (ModeloSolicitante.Cliente.BitacoraDocumentosCliente != null && ModeloSolicitante.Cliente.BitacoraDocumentosCliente.Count > 0)
|
|
{
|
|
ModeloSolicitante.Cliente.BitacoraDocumentosCliente = ConsultaEpowerDal.ObtenerRutaConsulta(ModeloSolicitante.Cliente.BitacoraDocumentosCliente.ToList(), model.Solicitud.IdSolicitud);
|
|
|
|
// logs.Trace("solicitante:" + ModeloSolicitante.Cliente.IdCliente + " documentos:" + ModeloSolicitante.Cliente.BitacoraDocumentosCliente.Count);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
ConsultaEpowerDal = null;
|
|
}
|
|
|
|
return model;
|
|
}
|
|
|
|
|
|
|
|
[HttpPost]
|
|
public UltimusJson RegistrarDocumentosEpower(int IdSolicitud, string ProcessName, int Incidente)
|
|
{
|
|
UltimusJson res = new UltimusJson();
|
|
DocumentosAPIController DocumentosApi = new DocumentosAPIController();
|
|
|
|
try
|
|
{
|
|
#region Consultas y Validaciones
|
|
|
|
#region Solicitantes
|
|
List<Solicitante> ListaSolicitante = new SolicitanteDAL().ObtenerSolicitantes(IdSolicitud);
|
|
|
|
if (ListaSolicitante == null || ListaSolicitante.Count() == 0)
|
|
{
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
res.DescripcionRespuesta = "No se pudo obtener la información de los solicitantes";
|
|
return res;
|
|
}
|
|
#endregion
|
|
|
|
#region Solicitante Principal
|
|
Solicitante SolicitantePrincipal = ListaSolicitante.Where(x => x.EsPrincipal == true).FirstOrDefault();
|
|
|
|
if (SolicitantePrincipal == null)
|
|
{
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
res.DescripcionRespuesta = "No se pudo obtener la información del solicitante principal del crédito";
|
|
return res;
|
|
}
|
|
#endregion
|
|
|
|
#region Caratula
|
|
|
|
CaratulaCredito CaratulaSolicitud = new CaratulaCreditoDAL().Obtener(IdSolicitud);
|
|
|
|
#endregion
|
|
|
|
|
|
#region Documentos Adjuntos
|
|
DocumentosAdjuntosCategoriaJSON DocAdjuntosJSON = DocumentosApi.CargarDocumentosAdjuntos(new JsonSolicitud()
|
|
{
|
|
Solicitud = new Solicitud() { IdSolicitud = IdSolicitud },
|
|
UltimusProcess = ProcessName
|
|
});
|
|
|
|
if (DocAdjuntosJSON.CodigoRespuesta == TipoCodigoRespuesta.ERROR.ToString())
|
|
{
|
|
res.CodigoRespuesta = DocAdjuntosJSON.CodigoRespuesta;
|
|
res.DescripcionRespuesta = "Ocurrio un problema al obtener la información de documentos adjuntos desde el Ultimus Complement";
|
|
return res;
|
|
}
|
|
#endregion
|
|
|
|
#region Ultima Aprobacion
|
|
|
|
AprobacionesComite UltimaAprobacion = new CaratulaCreditoDAL().ObtenerUltimaAprobacion(IdSolicitud, null);
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region Registrar Epower Bitacora Documentos Cliente
|
|
foreach(var solicitante in ListaSolicitante)
|
|
{
|
|
string CodigoBPPrincipal = SolicitantePrincipal.Cliente.CodigoBP;
|
|
if(solicitante.EsPrincipal!= true)
|
|
{
|
|
solicitante.Cliente.CodigoBP = CodigoBPPrincipal;
|
|
}
|
|
|
|
var respRegEpowerBitacoraDocCliente = RegistrarDocumentosEpowerBitacoraDocumentosCliente(new DocumentosEpowerJSON()
|
|
{
|
|
IdSolicitud = IdSolicitud,
|
|
SolicitantePrincipal = solicitante,
|
|
CodigoCaratula = CaratulaSolicitud.CodigoCaratula,
|
|
DocumentosAdjuntosCategoriaJSON = DocAdjuntosJSON,
|
|
FechaAprobacionTramite = UltimaAprobacion == null ? DateTime.Now : UltimaAprobacion.Fecha
|
|
});
|
|
|
|
|
|
if (respRegEpowerBitacoraDocCliente.CodigoRespuesta == TipoCodigoRespuesta.ERROR.ToString())
|
|
{
|
|
res.CodigoRespuesta = respRegEpowerBitacoraDocCliente.CodigoRespuesta;
|
|
res.DescripcionRespuesta = respRegEpowerBitacoraDocCliente.DescripcionRespuesta;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region Registrar Epower Bitacora Documentos Formalizacion
|
|
var respRegEpowerBitacoraDocFormalizacion = RegistrarDocumentosEpowerBitacoraDocumentosFormalizacion(new DocumentosEpowerJSON()
|
|
{
|
|
IdSolicitud = IdSolicitud,
|
|
Incident = Incidente,
|
|
IdProceso = EnumProcesos.Formalizacion,
|
|
SolicitantePrincipal = SolicitantePrincipal,
|
|
CodigoCaratula = CaratulaSolicitud.CodigoCaratula,
|
|
DocumentosAdjuntosCategoriaJSON = DocAdjuntosJSON
|
|
});
|
|
|
|
|
|
if (respRegEpowerBitacoraDocFormalizacion.CodigoRespuesta == TipoCodigoRespuesta.ERROR.ToString())
|
|
{
|
|
res.CodigoRespuesta = respRegEpowerBitacoraDocFormalizacion.CodigoRespuesta;
|
|
res.DescripcionRespuesta = respRegEpowerBitacoraDocFormalizacion.DescripcionRespuesta;
|
|
return res;
|
|
}
|
|
#endregion
|
|
|
|
#region Registrar Epower Formalizacion Documentos Legales
|
|
|
|
var respRegEpowerFormalizacionDocumentosLegales = RegistrarDocumentosEpowerFormalizacionDocumentosLegales(new DocumentosEpowerJSON()
|
|
{
|
|
IdSolicitud = IdSolicitud,
|
|
Incident = Incidente,
|
|
IdProceso = EnumProcesos.Formalizacion,
|
|
SolicitantePrincipal = SolicitantePrincipal,
|
|
CodigoCaratula = CaratulaSolicitud.CodigoCaratula,
|
|
DocumentosAdjuntosCategoriaJSON = DocAdjuntosJSON
|
|
});
|
|
|
|
|
|
if (respRegEpowerFormalizacionDocumentosLegales.CodigoRespuesta == TipoCodigoRespuesta.ERROR.ToString())
|
|
{
|
|
res.CodigoRespuesta = respRegEpowerFormalizacionDocumentosLegales.CodigoRespuesta;
|
|
res.DescripcionRespuesta = respRegEpowerFormalizacionDocumentosLegales.DescripcionRespuesta;
|
|
return res;
|
|
}
|
|
#endregion
|
|
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.EXITOSO.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
res.DescripcionRespuesta = ex.ToString();
|
|
|
|
logs.Error(ex);
|
|
}
|
|
|
|
return res;
|
|
}
|
|
|
|
|
|
public DocumentosEpowerJSON ProcesarRegistroDocumentosEpower(DocumentosEpowerJSON DocumentoEpower)
|
|
{
|
|
try
|
|
{
|
|
foreach (DocumentoJSON ItemDocumentoJSON in DocumentoEpower.ListaDocumentos)
|
|
{
|
|
//Si no ha sido registrado en EPower y posee el VB de Calidad de Expediente
|
|
if (ItemDocumentoJSON.RegistradoEpower != true)
|
|
{
|
|
//Si posee un archivo fisico adjunto
|
|
if (ItemDocumentoJSON.CodDocumentoAdjunto != null && ItemDocumentoJSON.CodDocumentoAdjunto != 0)
|
|
{
|
|
bool RespRegistroEpower = false;
|
|
object ReqRegistroEpower = null;
|
|
|
|
try
|
|
{
|
|
#region Validaciones
|
|
|
|
if (!File.Exists(ItemDocumentoJSON.RutaFisica))
|
|
throw new Exception("El archivo adjunto " + ItemDocumentoJSON.RutaFisica + " no existe.");
|
|
|
|
#endregion
|
|
|
|
#region Parammetros
|
|
|
|
Byte[] AdjuntoByteArray = ConvertirAdjutoAByteArray(ItemDocumentoJSON.RutaFisica);
|
|
string ExtensionAdjuntoDocumentoPower = Path.GetExtension(ItemDocumentoJSON.RutaFisica);
|
|
|
|
string EstadoDocumentoEPower = "ACTIVO";
|
|
string FechaVencimientoDocumentoEPower = ItemDocumentoJSON.FechaVencimiento.HasValue ? ItemDocumentoJSON.FechaVencimiento.Value.ToString("dd/MM/yyyy") : DateTime.Now.ToString("dd/MM/yyyy");
|
|
string FechaAprobacionDocumentoEPower = DocumentoEpower.FechaAprobacionTramite.HasValue ? DocumentoEpower.FechaAprobacionTramite.Value.ToString("dd/MM/yyyy") : new DateTime(9999, 12, 31).ToString("dd/MM/yyyy");
|
|
string NombreReferenciaEpower = string.IsNullOrEmpty(ItemDocumentoJSON.TipoDocumento.Descripcion) ? "NO DEFINIDO" : ItemDocumentoJSON.TipoDocumento.Descripcion.Trim();
|
|
NombreReferenciaEpower = NombreReferenciaEpower.Split(new char[] { '-' })[0];
|
|
|
|
string NombreTipoDocumentoEpower = ((ItemDocumentoJSON.TipoDocumento.TipoDocumentoEpower == null) || string.IsNullOrEmpty(ItemDocumentoJSON.TipoDocumento.TipoDocumentoEpower.Descripcion)) ? NombreReferenciaEpower : ItemDocumentoJSON.TipoDocumento.TipoDocumentoEpower.Descripcion.Trim();
|
|
|
|
string FechaClienteEntregaDocumentoEpower = ItemDocumentoJSON.FechaEmision.HasValue ? ItemDocumentoJSON.FechaEmision.Value.ToString("dd/MM/yyyy") : DateTime.Now.ToString("dd/MM/yyyy");
|
|
string AnnoDocumentoEpower = ItemDocumentoJSON.FechaEmision.HasValue ? ItemDocumentoJSON.FechaEmision.Value.ToString("yyyy") : DateTime.Now.ToString("yyyy");
|
|
string MesDocumentoEpower = ItemDocumentoJSON.FechaEmision.HasValue ? ItemDocumentoJSON.FechaEmision.Value.ToString("MM") : DateTime.Now.ToString("MM");
|
|
string CodigoBPCliente = string.IsNullOrEmpty(DocumentoEpower.SolicitantePrincipal.Cliente.CodigoBP) ? "NO DEFINIDO" : DocumentoEpower.SolicitantePrincipal.Cliente.CodigoBP.Trim();
|
|
string TipoAvaluoEpower = string.IsNullOrEmpty(ItemDocumentoJSON.TipoAvaluoEpower) ? "NO DEFINIDO" : ItemDocumentoJSON.TipoAvaluoEpower.Trim();
|
|
string IdentificadorEpower = string.IsNullOrEmpty(ItemDocumentoJSON.IdentificadorEpower) ? "NO DEFINIDO" : ItemDocumentoJSON.IdentificadorEpower.Trim();
|
|
string SeccionEpower = string.IsNullOrEmpty(ItemDocumentoJSON.SeccionEpower) ? "NO DEFINIDO" : ItemDocumentoJSON.SeccionEpower.Trim();
|
|
|
|
|
|
|
|
string IdentificacionCliente = string.Empty;
|
|
//Commons.Utilities.FormatoCedula(, DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion);
|
|
|
|
switch (DocumentoEpower.SolicitantePrincipal.Cliente.IdTipoIdentificacion)
|
|
{
|
|
case EnumTipoIdentificacion.Persona_Fisica_Nacional:
|
|
IdentificacionCliente = DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion == null ? "" : DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion.Trim().Substring(1, DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion.Trim().Length - 1);
|
|
break;
|
|
case EnumTipoIdentificacion.Persona_Juridica_Nacional:
|
|
IdentificacionCliente = DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion == null ? "" : string.Format("{0}-{1}-{2}", DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion.Trim().Substring(0, 1), DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion.Trim().Substring(1, 3), DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion.Trim().Substring(4, DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion.Trim().Length - 4));
|
|
break;
|
|
default:
|
|
IdentificacionCliente = DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion == null ? "" : DocumentoEpower.SolicitantePrincipal.Cliente.NumeroIdentificacion.Trim();
|
|
break;
|
|
}
|
|
|
|
|
|
string TipoPersonaEpower = "NO DEFINIDO";
|
|
string TipoCorrespondenciaEpower = "RECIBIDA";
|
|
string CondicionClienteEpower = "NO DEFINIDO";
|
|
string NumeroCaratulaCredito = DocumentoEpower.CodigoCaratula == null ? "NO DEFINIDO" : DocumentoEpower.CodigoCaratula;
|
|
|
|
string NombreCliente = null;
|
|
switch (DocumentoEpower.SolicitantePrincipal.Cliente.IdTipoCliente)
|
|
{
|
|
case EnumTipoCliente.Fisico:
|
|
var _PNombre = string.IsNullOrEmpty(DocumentoEpower.SolicitantePrincipal.Cliente.PrimerNombre) ? "" : DocumentoEpower.SolicitantePrincipal.Cliente.PrimerNombre.Trim() + " ";
|
|
var _SNombre = string.IsNullOrEmpty(DocumentoEpower.SolicitantePrincipal.Cliente.SegundoNombre) ? "" : DocumentoEpower.SolicitantePrincipal.Cliente.SegundoNombre.Trim() + " ";
|
|
var _PApellido = string.IsNullOrEmpty(DocumentoEpower.SolicitantePrincipal.Cliente.PrimerApellido) ? "" : DocumentoEpower.SolicitantePrincipal.Cliente.PrimerApellido.Trim() + " ";
|
|
var _SApellido = string.IsNullOrEmpty(DocumentoEpower.SolicitantePrincipal.Cliente.SegundoApellido) ? "" : DocumentoEpower.SolicitantePrincipal.Cliente.SegundoApellido.Trim() + " ";
|
|
|
|
NombreCliente = string.Format("{0}{1}{2}{3}", _PNombre, _SNombre, _PApellido, _SApellido);
|
|
TipoPersonaEpower = "FISICO";
|
|
break;
|
|
case EnumTipoCliente.Juridico:
|
|
NombreCliente = string.IsNullOrEmpty(DocumentoEpower.SolicitantePrincipal.Cliente.RazonSocial) ? "NO DEFINIDO" : DocumentoEpower.SolicitantePrincipal.Cliente.RazonSocial.Trim() + " ";
|
|
TipoPersonaEpower = "JURIDICO";
|
|
break;
|
|
}
|
|
|
|
switch (DocumentoEpower.SolicitantePrincipal.IdTipoSolicitante)
|
|
{
|
|
case EnumTipoSolicitante.Deudor:
|
|
CondicionClienteEpower = "DEUDOR";
|
|
break;
|
|
case EnumTipoSolicitante.CoDeudor:
|
|
CondicionClienteEpower = "CODEUDOR";
|
|
break;
|
|
case EnumTipoSolicitante.Fiador:
|
|
CondicionClienteEpower = "FIADOR";
|
|
break;
|
|
case EnumTipoSolicitante.Accionista:
|
|
CondicionClienteEpower = "ACCIONISTA";
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region Invocacion
|
|
|
|
//Segun la ubicación de Epower para el Tipo de Documento al que pertecene el Documento actual
|
|
//se determina culal de los metodos de registro es el que corrresponde
|
|
switch (ItemDocumentoJSON.TipoDocumento.IdUbicacionEp)
|
|
{
|
|
case EnumUbicacionEPower.ExpedientesAprobacion:
|
|
#region EnumUbicacionEPower.ExpedientesAprobacion
|
|
|
|
ReqRegistroEpower = new setNewExpedientes_AprobacionesRequestBody()
|
|
{
|
|
codigo_cliente = CodigoBPCliente,
|
|
cuerpo_referencia = AdjuntoByteArray,
|
|
estado = EstadoDocumentoEPower,
|
|
extencion_referencia = ExtensionAdjuntoDocumentoPower,
|
|
fecha_aprobacion = FechaAprobacionDocumentoEPower,
|
|
fecha_vencimiento = FechaVencimientoDocumentoEPower,
|
|
id_tramite = DocumentoEpower.IdSolicitud.ToString(),
|
|
nombre = NombreCliente,
|
|
nombre_referencia = NombreReferenciaEpower,
|
|
numero_caratula = NumeroCaratulaCredito,
|
|
numero_identificacion = IdentificacionCliente,
|
|
tipo_documento = NombreTipoDocumentoEpower
|
|
};
|
|
|
|
RespRegistroEpower = setNewExpedientes_Aprobaciones((setNewExpedientes_AprobacionesRequestBody)ReqRegistroEpower);
|
|
//if (RespRegistroEpower== true)
|
|
// logs.Trace(string.Format("Resultado del servicio web de registro de Epower:MetodoEpower=>{0}, codigo_cliente=>{1}, estado=>{2}, extencion_referencia=>{3},fecha_aprobacion=>{4},fecha_vencimiento=>{5},id_tramite=>{6},nombre=>{7},nombre_referencia=>{8},numero_caratula=>{9},numero_identificacion=>{10},tipo_documento=>{11}",
|
|
// "setNewExpedientes_Aprobaciones", CodigoBPCliente, EstadoDocumentoEPower, ExtensionAdjuntoDocumentoPower, FechaAprobacionDocumentoEPower,FechaVencimientoDocumentoEPower,DocumentoEpower.IdSolicitud.ToString(),NombreCliente,NombreReferenciaEpower,NumeroCaratulaCredito,IdentificacionCliente,NombreTipoDocumentoEpower));
|
|
#endregion
|
|
break;
|
|
|
|
case EnumUbicacionEPower.InformacionFinanciera:
|
|
#region EnumUbicacionEPower.InformacionFinanciera
|
|
|
|
ReqRegistroEpower = new setNewInformacion_FinancieraRequestBody()
|
|
{
|
|
anno = AnnoDocumentoEpower,
|
|
codigo_cliente = CodigoBPCliente,
|
|
condicion = CondicionClienteEpower,
|
|
cuerpo_referencia = AdjuntoByteArray,
|
|
estado = EstadoDocumentoEPower,
|
|
extencion_referencia = ExtensionAdjuntoDocumentoPower,
|
|
id_tramite = DocumentoEpower.IdSolicitud.ToString(),
|
|
mes = MesDocumentoEpower,
|
|
nombre = NombreCliente,
|
|
nombre_referencia = NombreReferenciaEpower,
|
|
numero_identificacion = IdentificacionCliente,
|
|
tipo_documento = NombreTipoDocumentoEpower,
|
|
tipo_persona = TipoPersonaEpower
|
|
};
|
|
|
|
RespRegistroEpower = setNewInformacion_Financiera((setNewInformacion_FinancieraRequestBody)ReqRegistroEpower);
|
|
//if (RespRegistroEpower == true)
|
|
// logs.Trace(string.Format("Resultado del servicio web de registro de Epower:MetodoEpower=>{0},anno=>{1},codigo_cliente=>{2},condicion=>{3},estado=>{4},extencion_referencia=>{5},id_tramite=>{6},mes=>{7},nombre=>{8},nombre_referencia=>{9},numero_identificacion=>{10},tipo_documento=>{11},tipo_persona=>{12}",
|
|
// "setNewInformacion_Financiera", AnnoDocumentoEpower, CodigoBPCliente, CondicionClienteEpower, EstadoDocumentoEPower, ExtensionAdjuntoDocumentoPower, DocumentoEpower.IdSolicitud.ToString(), MesDocumentoEpower, NombreCliente, NombreReferenciaEpower, IdentificacionCliente, NombreTipoDocumentoEpower, TipoPersonaEpower));
|
|
#endregion
|
|
break;
|
|
|
|
case EnumUbicacionEPower.Facilidades:
|
|
#region EnumUbicacionEPower.Facilidades
|
|
|
|
ReqRegistroEpower = new setNewFacilidadesRequestBody()
|
|
{
|
|
codigo_cliente = CodigoBPCliente,
|
|
cuerpo_referencia = AdjuntoByteArray,
|
|
estado = EstadoDocumentoEPower,
|
|
extencion_referencia = ExtensionAdjuntoDocumentoPower,
|
|
id_tramite = DocumentoEpower.IdSolicitud.ToString(),
|
|
nombre = NombreCliente,
|
|
nombre_referencia = NombreReferenciaEpower,
|
|
numero_documento = "NO DEFINIDO",
|
|
numero_identificacion = IdentificacionCliente,
|
|
numero_operacion = "NO DEFINIDO",
|
|
seccion = SeccionEpower
|
|
};
|
|
|
|
RespRegistroEpower = setNewFacilidades((setNewFacilidadesRequestBody)ReqRegistroEpower);
|
|
//if (RespRegistroEpower == true)
|
|
// logs.Trace(string.Format("Resultado del servicio web de registro de Epower:MetodoEpower=>{0},codigo_cliente=>{1},estado,extencion_referencia=>{2},id_tramite=>{3},nombre=>{4},nombre_referencia=>{5},numero_documento=>{6},numero_identificacion=>{7},numero_operacion=>{8},seccion=>{9}",
|
|
// "setNewFacilidades", CodigoBPCliente, EstadoDocumentoEPower, ExtensionAdjuntoDocumentoPower, DocumentoEpower.IdSolicitud.ToString(), NombreCliente, NombreReferenciaEpower, "NO DEFINIDO", IdentificacionCliente, "NO DEFINIDO", SeccionEpower));
|
|
#endregion
|
|
break;
|
|
|
|
case EnumUbicacionEPower.Garantias:
|
|
#region EnumUbicacionEPower.Garantias
|
|
|
|
ReqRegistroEpower = new setNewGarantiasRequestBody()
|
|
{
|
|
codigo_cliente = CodigoBPCliente,
|
|
cuerpo_referencia = AdjuntoByteArray,
|
|
estado = EstadoDocumentoEPower,
|
|
extencion_referencia = ExtensionAdjuntoDocumentoPower,
|
|
fecha_emision = FechaClienteEntregaDocumentoEpower,
|
|
fecha_vencimiento = FechaVencimientoDocumentoEPower,
|
|
id_tramite = DocumentoEpower.IdSolicitud.ToString(),
|
|
identificador = IdentificadorEpower,
|
|
nombre = NombreCliente,
|
|
nombre_referencia = NombreReferenciaEpower,
|
|
numero_identificacion = IdentificacionCliente,
|
|
seccion = SeccionEpower,
|
|
tipo_avaluo = TipoAvaluoEpower,
|
|
tipo_documento = NombreTipoDocumentoEpower
|
|
};
|
|
|
|
|
|
RespRegistroEpower = setNewGarantias((setNewGarantiasRequestBody)ReqRegistroEpower);
|
|
//if (RespRegistroEpower == true)
|
|
// logs.Trace(string.Format("Resultado del servicio web de registro de Epower:MetodoEpower=>{0},codigo_cliente=>{1},estado=>{2},extencion_referencia=>{3},fecha_emision=>{4},fecha_vencimiento=>{5},id_tramite=>{6},identificador=>{7},nombre=>{8},nombre_referencia=>{9},numero_identificacion=>{10},seccion=>{11},tipo_avaluo=>{12},tipo_documento=>{13}",
|
|
// "setNewGarantias",CodigoBPCliente,EstadoDocumentoEPower,ExtensionAdjuntoDocumentoPower,FechaClienteEntregaDocumentoEpower,FechaVencimientoDocumentoEPower,DocumentoEpower.IdSolicitud.ToString(),IdentificadorEpower,NombreCliente,NombreReferenciaEpower,IdentificacionCliente,SeccionEpower,TipoAvaluoEpower,NombreTipoDocumentoEpower ));
|
|
#endregion
|
|
break;
|
|
|
|
case EnumUbicacionEPower.InformacionGeneralCliente:
|
|
#region EnumUbicacionEPower.InformacionGeneralCliente
|
|
|
|
ReqRegistroEpower = new setNewInformacion_General_ClienteRequestBody()
|
|
{
|
|
anno = AnnoDocumentoEpower,
|
|
codigo_cliente = CodigoBPCliente,
|
|
condicion = CondicionClienteEpower,
|
|
cuerpo_referencia = AdjuntoByteArray,
|
|
estado = EstadoDocumentoEPower,
|
|
extencion_referencia = ExtensionAdjuntoDocumentoPower,
|
|
fecha_emision = FechaClienteEntregaDocumentoEpower,
|
|
fecha_vencimiento = FechaVencimientoDocumentoEPower,
|
|
id_tramite = DocumentoEpower.IdSolicitud.ToString(),
|
|
nombre = NombreCliente,
|
|
nombre_persona = NombreCliente,
|
|
nombre_referencia = NombreReferenciaEpower,
|
|
numero_identificacion = IdentificacionCliente,
|
|
seccion = SeccionEpower,
|
|
tipo_documento = NombreTipoDocumentoEpower,
|
|
tipo_persona = TipoPersonaEpower
|
|
};
|
|
|
|
RespRegistroEpower = setNewInformacion_General_Cliente((setNewInformacion_General_ClienteRequestBody)ReqRegistroEpower);
|
|
//if (RespRegistroEpower == true)
|
|
// logs.Trace(string.Format("Resultado del servicio web de registro de Epower:MetodoEpower=>{0},anno=>{1},codigo_cliente=>{2},condicion=>{3},estado=>{4},extencion_referencia=>{5},fecha_emision=>{6},fecha_vencimiento=>{7},id_tramite=>{8},nombre=>{9},nombre_persona=>{10},nombre_referencia=>{11},numero_identificacion=>{12},seccion=>{13},tipo_documento=>{14},tipo_persona=>{15}",
|
|
// "setNewInformacion_General_Cliente",AnnoDocumentoEpower,CodigoBPCliente,CondicionClienteEpower,EstadoDocumentoEPower, ExtensionAdjuntoDocumentoPower,FechaClienteEntregaDocumentoEpower,FechaVencimientoDocumentoEPower,DocumentoEpower.IdSolicitud.ToString(),NombreCliente,NombreCliente,NombreReferenciaEpower,IdentificacionCliente,SeccionEpower,NombreTipoDocumentoEpower,TipoPersonaEpower));
|
|
#endregion
|
|
break;
|
|
|
|
case EnumUbicacionEPower.Correspondencia:
|
|
#region EnumUbicacionEPower.Correspondencia
|
|
|
|
ReqRegistroEpower = new setNewCorrespondenciaRequestBody()
|
|
{
|
|
anno = AnnoDocumentoEpower,
|
|
codigo_cliente = CodigoBPCliente,
|
|
cuerpo_referencia = AdjuntoByteArray,
|
|
estado = EstadoDocumentoEPower,
|
|
extencion_referencia = ExtensionAdjuntoDocumentoPower,
|
|
id_tramite = DocumentoEpower.IdSolicitud.ToString(),
|
|
nombre = NombreCliente,
|
|
nombre_referencia = NombreReferenciaEpower,
|
|
numero_identificacion = IdentificacionCliente,
|
|
tipo = TipoCorrespondenciaEpower,
|
|
tipo_documento = NombreTipoDocumentoEpower
|
|
};
|
|
|
|
RespRegistroEpower = setNewCorrespondencia((setNewCorrespondenciaRequestBody)ReqRegistroEpower);
|
|
//if (RespRegistroEpower == true)
|
|
// logs.Trace(string.Format("Resultado del servicio web de registro de Epower:MetodoEpower=>{0},anno=>{1},codigo_cliente=>{2},estado=>{3},extencion_referencia=>{4},id_tramite=>{5},nombre=>{6},nombre_referencia=>{7},numero_identificacion=>{8},tipo=>{9},tipo_documento=>{10}",
|
|
// "setNewCorrespondencia", AnnoDocumentoEpower, CodigoBPCliente, EstadoDocumentoEPower, ExtensionAdjuntoDocumentoPower, DocumentoEpower.IdSolicitud.ToString(), NombreCliente, NombreReferenciaEpower, IdentificacionCliente, TipoCorrespondenciaEpower, NombreTipoDocumentoEpower));
|
|
#endregion
|
|
break;
|
|
}
|
|
|
|
|
|
ItemDocumentoJSON.RegistradoEpower = RespRegistroEpower;
|
|
|
|
if (RespRegistroEpower == true)
|
|
{
|
|
BitacoraDocumentosCliente pivot = new BitacoraDocumentosCliente();
|
|
List<BitacoraDocumentosCliente> listaPivot = new List<BitacoraDocumentosCliente>();
|
|
pivot.CopyValueProperties(ItemDocumentoJSON);
|
|
listaPivot = new ConsultaEpowerDAL().ObtenerRutaConsulta(new List<BitacoraDocumentosCliente>() { pivot }, DocumentoEpower.IdSolicitud, DocumentoEpower.SolicitantePrincipal.Cliente.IdCliente);
|
|
|
|
if (listaPivot != null && listaPivot.Count > 0)
|
|
ItemDocumentoJSON.RutaEPower = listaPivot.FirstOrDefault().RutaEPower;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (RespRegistroEpower == false)
|
|
logs.Trace(string.Format("Resultado del servicio web de registro de Epower: Resultado=>{0}, Cliente=>{1}, TipoDocumento=>{2}, RutaDocumento=>{3}, Body=>{4}", RespRegistroEpower, DocumentoEpower.SolicitantePrincipal.IdCliente, ItemDocumentoJSON.IdTipoDocumento, ItemDocumentoJSON.RutaFisica, JsonConvert.SerializeObject(ReqRegistroEpower ?? "")));
|
|
|
|
#endregion
|
|
|
|
}
|
|
catch (Exception ex1)
|
|
{
|
|
logs.Error(ex1);
|
|
logs.Trace(string.Format("Resultado del servicio web de registro de Epower: Resultado=>{0}, Cliente=>{1}, TipoDocumento=>{2}, RutaDocumento=>{3}, Body=>{4}", RespRegistroEpower, DocumentoEpower.SolicitantePrincipal.IdCliente, ItemDocumentoJSON.IdTipoDocumento, ItemDocumentoJSON.RutaFisica, JsonConvert.SerializeObject(ReqRegistroEpower ?? "")));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
DocumentoEpower.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
DocumentoEpower.DescripcionRespuesta = ex.ToString();
|
|
logs.Error(ex);
|
|
}
|
|
|
|
return DocumentoEpower;
|
|
}
|
|
|
|
|
|
public UltimusJson RegistrarDocumentosEpowerBitacoraDocumentosCliente(DocumentosEpowerJSON DocumentoEpower)
|
|
{
|
|
|
|
UltimusJson res = new UltimusJson();
|
|
BitacoraDocumentosClienteDAL BitacoraDocumentosClienteDal = new BitacoraDocumentosClienteDAL();
|
|
|
|
try
|
|
{
|
|
#region Obtiene Bitacora Documentos Cliente
|
|
List<BitacoraDocumentosCliente> ListaBitacoraDocumentosCliente = BitacoraDocumentosClienteDal.Obtener(DocumentoEpower.IdSolicitud, DocumentoEpower.SolicitantePrincipal.IdCliente);
|
|
|
|
if (ListaBitacoraDocumentosCliente == null || ListaBitacoraDocumentosCliente.Count == 0)
|
|
{
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
res.DescripcionRespuesta = "No se pudo obtener la información de los documentos de la bitacora del cliente";
|
|
logs.Error(res.DescripcionRespuesta);
|
|
return res;
|
|
}
|
|
#endregion
|
|
|
|
#region Carga el Objeto de Lista de Documentos
|
|
DocumentoEpower.ListaDocumentos = (from itemBitacora in ListaBitacoraDocumentosCliente
|
|
join itemDocAjunto in DocumentoEpower.DocumentosAdjuntosCategoriaJSON.ListaDocumentos
|
|
on itemBitacora.CodDocumentoAdjunto equals itemDocAjunto.CodDocumento
|
|
select new DocumentoJSON()
|
|
{
|
|
IdTipoDocumento = itemBitacora.IdTipoDocumento,
|
|
ConsecutivoPeriodo = itemBitacora.ConsecutivoPeriodo,
|
|
CodDocumentoAdjunto = itemBitacora.CodDocumentoAdjunto,
|
|
RutaFisica = itemDocAjunto.RutaFisica,
|
|
RutaDescarga = itemDocAjunto.RutaDescarga,
|
|
RegistradoEpower = itemBitacora.RegistradoEpower,
|
|
EstaPendiente = itemBitacora.EstaPendiente,
|
|
TipoDocumento = itemBitacora.TipoDocumento,
|
|
FechaEmision = itemBitacora.Periodo,
|
|
FechaVencimiento = itemBitacora.FechaVencimiento,
|
|
TipoAvaluoEpower = itemBitacora.TipoAvaluoEpower,
|
|
IdentificadorEpower = itemBitacora.IdentificadorEpower,
|
|
SeccionEpower = itemBitacora.SeccionEpower
|
|
}).ToList();
|
|
#endregion
|
|
|
|
#region Invocar el Registro a Epower
|
|
|
|
DocumentoEpower = ProcesarRegistroDocumentosEpower(DocumentoEpower);
|
|
#endregion
|
|
|
|
#region Actualizar la Bitacora de Documentos del Cliente
|
|
|
|
ListaBitacoraDocumentosCliente = (from itemBitacora in ListaBitacoraDocumentosCliente
|
|
join itemListaDocEpower in DocumentoEpower.ListaDocumentos
|
|
on itemBitacora.IdTipoDocumento equals itemListaDocEpower.IdTipoDocumento
|
|
into ListaEpower
|
|
from itemEpower in ListaEpower.DefaultIfEmpty()
|
|
select itemBitacora.UpdateProperties(
|
|
x =>
|
|
{
|
|
x.RegistradoEpower = (itemEpower != null ? itemEpower.RegistradoEpower : false);
|
|
x.RutaEPower = (itemEpower != null ? itemEpower.RutaEPower : null);
|
|
x.FechaRegistraEpower = (itemEpower != null ? (x.RegistradoEpower == true && x.FechaRegistraEpower == null ? DateTime.Now : x.FechaRegistraEpower) : null);
|
|
x.EstaPendiente = (itemEpower != null ? itemEpower.EstaPendiente : false);
|
|
return x;
|
|
})).ToList();
|
|
|
|
|
|
|
|
BitacoraDocumentosClienteDal.Actualizar(ListaBitacoraDocumentosCliente);
|
|
|
|
#endregion
|
|
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.EXITOSO.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
res.DescripcionRespuesta = ex.ToString();
|
|
logs.Error(ex);
|
|
}
|
|
|
|
return res;
|
|
}
|
|
|
|
|
|
public UltimusJson RegistrarDocumentosEpowerBitacoraDocumentosFormalizacion(DocumentosEpowerJSON DocumentoEpower)
|
|
{
|
|
|
|
UltimusJson res = new UltimusJson();
|
|
BitacoraDocumentosFormalizacionDAL BitacoraDocumentosFormalizacionDal = new BitacoraDocumentosFormalizacionDAL();
|
|
|
|
try
|
|
{
|
|
#region Obtiene Bitacora Documentos Formalizacion
|
|
List<BitacoraDocumentosFormalizacion> ListaBitacoraDocumentosFormalizacion = BitacoraDocumentosFormalizacionDal.Obtener(new BitacoraDocumentosFormalizacion() { IdSolicitud = DocumentoEpower.IdSolicitud, Incident = DocumentoEpower.Incident, IdProceso = DocumentoEpower.IdProceso });
|
|
|
|
if (ListaBitacoraDocumentosFormalizacion == null)
|
|
{
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
res.DescripcionRespuesta = "No se pudo obtener la información de los documentos de la bitacora formalizacion";
|
|
return res;
|
|
}
|
|
#endregion
|
|
|
|
#region Carga el Objeto de Lista de Documentos
|
|
DocumentoEpower.ListaDocumentos = (from itemBitacora in ListaBitacoraDocumentosFormalizacion
|
|
join itemDocAjunto in DocumentoEpower.DocumentosAdjuntosCategoriaJSON.ListaDocumentos
|
|
on itemBitacora.CodDocumentoAdjunto equals itemDocAjunto.CodDocumento
|
|
select new DocumentoJSON()
|
|
{
|
|
IdTipoDocumento = itemBitacora.IdTipoDocumento,
|
|
CodDocumentoAdjunto = itemBitacora.CodDocumentoAdjunto,
|
|
RutaFisica = itemDocAjunto.RutaFisica,
|
|
RutaDescarga = itemDocAjunto.RutaDescarga,
|
|
RegistradoEpower = itemBitacora.RegistradoEpower,
|
|
TipoDocumento = itemBitacora.TipoDocumento,
|
|
FechaEmision = itemDocAjunto.Fecha,
|
|
FechaVencimiento = itemBitacora.FechaVencimiento,
|
|
TipoAvaluoEpower = itemBitacora.TipoAvaluoEpower,
|
|
IdentificadorEpower = itemBitacora.IdentificadorEpower,
|
|
SeccionEpower = itemBitacora.SeccionEpower
|
|
}).ToList();
|
|
#endregion
|
|
|
|
#region Invocar el Registro a Epower
|
|
|
|
DocumentoEpower = ProcesarRegistroDocumentosEpower(DocumentoEpower);
|
|
#endregion
|
|
|
|
#region Actualizar la Bitacora de Documentos Formalizacion
|
|
|
|
ListaBitacoraDocumentosFormalizacion = (from itemBitacora in ListaBitacoraDocumentosFormalizacion
|
|
join itemListaDocEpower in DocumentoEpower.ListaDocumentos
|
|
on itemBitacora.IdTipoDocumento equals itemListaDocEpower.IdTipoDocumento
|
|
into ListaEpower
|
|
from itemEpower in ListaEpower.DefaultIfEmpty()
|
|
select itemBitacora.UpdateProperties(
|
|
x =>
|
|
{
|
|
x.RegistradoEpower = (itemEpower != null ? itemEpower.RegistradoEpower : false);
|
|
x.RutaEPower = (itemEpower != null ? itemEpower.RutaEPower : null);
|
|
x.FechaRegistraEpower = (itemEpower != null ? (x.RegistradoEpower == true && x.FechaRegistraEpower == null ? DateTime.Now : x.FechaRegistraEpower) : null);
|
|
return x;
|
|
})).ToList();
|
|
|
|
|
|
BitacoraDocumentosFormalizacionDal.Actualizar(ListaBitacoraDocumentosFormalizacion);
|
|
|
|
#endregion
|
|
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.EXITOSO.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
res.DescripcionRespuesta = ex.ToString();
|
|
logs.Error(ex);
|
|
}
|
|
|
|
return res;
|
|
}
|
|
|
|
|
|
public UltimusJson RegistrarDocumentosEpowerFormalizacionDocumentosLegales(DocumentosEpowerJSON DocumentoEpower)
|
|
{
|
|
|
|
UltimusJson res = new UltimusJson();
|
|
FormalizacionDocumentosLegalesDAL FormalizacionDocumentosLegalesDal = new FormalizacionDocumentosLegalesDAL();
|
|
|
|
try
|
|
{
|
|
#region Obtiene Bitacora Documentos Formalizacion
|
|
List<FormalizacionDocumentosLegales> ListaFormalizacionDocumentosLegales = FormalizacionDocumentosLegalesDal.Obtener(DocumentoEpower.Incident, DocumentoEpower.IdSolicitud);
|
|
|
|
if (ListaFormalizacionDocumentosLegales == null)
|
|
{
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
res.DescripcionRespuesta = "No se pudo obtener la información de los documentos legales de formalizacion";
|
|
return res;
|
|
}
|
|
#endregion
|
|
|
|
#region Carga el Objeto de Lista de Documentos
|
|
DocumentoEpower.ListaDocumentos = (from itemBitacora in ListaFormalizacionDocumentosLegales
|
|
join itemDocAjunto in DocumentoEpower.DocumentosAdjuntosCategoriaJSON.ListaDocumentos
|
|
on itemBitacora.CodDocumentoAdjunto equals itemDocAjunto.CodDocumento
|
|
select new DocumentoJSON()
|
|
{
|
|
IdTipoDocumento = itemBitacora.IdTipoDocumento,
|
|
CodDocumentoAdjunto = itemBitacora.CodDocumentoAdjunto,
|
|
RutaFisica = itemDocAjunto.RutaFisica,
|
|
RutaDescarga = itemDocAjunto.RutaDescarga,
|
|
RegistradoEpower = itemBitacora.RegistradoEpower,
|
|
TipoDocumento = itemBitacora.TipoDocumento,
|
|
FechaEmision = itemDocAjunto.Fecha,
|
|
FechaVencimiento = null//itemBitacora.FechaVencimiento
|
|
}).ToList();
|
|
#endregion
|
|
|
|
#region Invocar el Registro a Epower
|
|
|
|
DocumentoEpower = ProcesarRegistroDocumentosEpower(DocumentoEpower);
|
|
#endregion
|
|
|
|
#region Actualizar la Bitacora de Documentos Formalizacion
|
|
|
|
ListaFormalizacionDocumentosLegales = (from itemBitacora in ListaFormalizacionDocumentosLegales
|
|
join itemListaDocEpower in DocumentoEpower.ListaDocumentos
|
|
on itemBitacora.IdTipoDocumento equals itemListaDocEpower.IdTipoDocumento
|
|
into ListaEpower
|
|
from itemEpower in ListaEpower.DefaultIfEmpty()
|
|
select itemBitacora.UpdateProperties(
|
|
x =>
|
|
{
|
|
x.RegistradoEpower = (itemEpower != null ? itemEpower.RegistradoEpower : false);
|
|
x.RutaEPower = (itemEpower != null ? itemEpower.RutaEPower : null);
|
|
x.FechaRegistraEpower = (itemEpower != null ? (x.RegistradoEpower == true && x.FechaRegistraEpower == null ? DateTime.Now : x.FechaRegistraEpower) : null);
|
|
return x;
|
|
})).ToList();
|
|
|
|
|
|
FormalizacionDocumentosLegalesDal.ActualizarDocumentos(ListaFormalizacionDocumentosLegales);
|
|
|
|
#endregion
|
|
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.EXITOSO.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
res.CodigoRespuesta = TipoCodigoRespuesta.ERROR.ToString();
|
|
res.DescripcionRespuesta = ex.ToString();
|
|
logs.Error(ex);
|
|
}
|
|
|
|
return res;
|
|
}
|
|
|
|
|
|
|
|
|
|
#region RegistroDocumentoEPower
|
|
|
|
private Byte[] ConvertirAdjutoAByteArray(string RutaArchivo)
|
|
{
|
|
Byte[] ArchivoBytes = null;
|
|
|
|
try
|
|
{
|
|
ArchivoBytes = File.ReadAllBytes(RutaArchivo);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
throw ex;
|
|
}
|
|
|
|
return ArchivoBytes;
|
|
}
|
|
|
|
private bool setNewCorrespondencia(setNewCorrespondenciaRequestBody req)
|
|
{
|
|
bool Respuesta = false;
|
|
try
|
|
{
|
|
using (IntegracionesEPowerClient Conn = new IntegracionesEPowerClient(BindingSAP, EndpointSAP))
|
|
{
|
|
Respuesta = Conn.setNewCorrespondencia(req);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
return Respuesta;
|
|
}
|
|
|
|
private bool setNewExpedientes_Aprobaciones(setNewExpedientes_AprobacionesRequestBody req)
|
|
{
|
|
bool Respuesta = false;
|
|
try
|
|
{
|
|
using (IntegracionesEPowerClient Conn = new IntegracionesEPowerClient(BindingSAP, EndpointSAP))
|
|
{
|
|
Respuesta = Conn.setNewExpedientes_Aprobaciones(req);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
return Respuesta;
|
|
}
|
|
|
|
private bool setNewFacilidades(setNewFacilidadesRequestBody req)
|
|
{
|
|
bool Respuesta = false;
|
|
try
|
|
{
|
|
using (IntegracionesEPowerClient Conn = new IntegracionesEPowerClient(BindingSAP, EndpointSAP))
|
|
{
|
|
Respuesta = Conn.setNewFacilidades(req);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
return Respuesta;
|
|
}
|
|
|
|
private bool setNewGarantias(setNewGarantiasRequestBody req)
|
|
{
|
|
bool Respuesta = false;
|
|
try
|
|
{
|
|
using (IntegracionesEPowerClient Conn = new IntegracionesEPowerClient(BindingSAP, EndpointSAP))
|
|
{
|
|
Respuesta = Conn.setNewGarantias(req);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
return Respuesta;
|
|
}
|
|
|
|
private bool setNewInformacion_Financiera(setNewInformacion_FinancieraRequestBody req)
|
|
{
|
|
bool Respuesta = false;
|
|
try
|
|
{
|
|
///using (IntegracionesEPowerClient Conn = new IntegracionesEPowerClient(BindingSAP, EndpointSAP))
|
|
using (IntegracionesEPowerClient Conn = new IntegracionesEPowerClient())
|
|
{
|
|
Respuesta = Conn.setNewInformacion_Financiera(req);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
return Respuesta;
|
|
}
|
|
|
|
private bool setNewInformacion_General_Cliente(setNewInformacion_General_ClienteRequestBody req)
|
|
{
|
|
bool Respuesta = false;
|
|
try
|
|
{
|
|
using (IntegracionesEPowerClient Conn = new IntegracionesEPowerClient(BindingSAP, EndpointSAP))
|
|
{
|
|
Respuesta = Conn.setNewInformacion_General_Cliente(req);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
finally
|
|
{
|
|
|
|
}
|
|
return Respuesta;
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|