TFS_ANTIGUO/PrendarioDavivienda/ULA.Davivienda.WCFServiciosCobisGenerales/ULA.Davivienda.WCFServiciosCobisGenerales.BL/ActualizaClienteBL.vb

1938 lines
83 KiB
VB.net
Raw Permalink Normal View History

Imports ULA.Davivienda.WCFServiciosCobisGenerales.DAL
Imports ULA.Davivienda.WCFServiciosCobisGenerales.Entidades
Imports Ultimus.Utilitarios
Imports System.Xml
Public Class ActualizaClienteBL
' Constante para indicar que se está trabajando en ambiente COBIS
#Const COBIS = 1
' Codigos de Errores
Const ERR_COBIS_1 = 1
Const ERR_COBIS_2 = 2
Const ERR_COBIS_3 = 3
Const ERR_COBIS_4 = 4
Const SQLTEXT& = &H23
Const SQLARRAY& = &H24
Const SQLVARBINARY& = &H25
Const SQLINTN& = &H26
Const SQLVARCHAR& = &H27
Const SQLBINARY& = &H2D
Const SQLIMAGE& = &H22
Const SQLCHAR& = &H2F
Const SQLINT1& = &H30
Const SQLBIT& = &H32
Const SQLINT2& = &H34
Const SQLINT4& = &H38
Const SQLMONEY& = &H3C
Const SQLDATETIME& = &H3D
Const SQLFLT8& = &H3E
Const SQLFLTN& = &H6D
Const SQLFLT4& = &H3E
Const SQLMONEYN& = &H6E
Const SQLDATETIMN& = &H6F
Const SQLAOPCNT& = &H4B
Const SQLAOPSUM& = &H4D
Const SQLAOPAVG& = &H4F
Const SQLAOPMIN& = &H51
Const SQLAOPMAX& = &H52
Const SQLAOPANY& = &H53
Const SQLAOPNOOP& = &H56
Const SQLMONEY4& = &H7A
Const SQLDATETIM4& = &H3A
Dim g_Login As String
Dim g_Clave As String
Dim g_Sucursal As String
Dim g_SucursalGestion As String
Dim g_Rol As String
Dim g_Oficina As String
Dim g_Filial As String
Dim xmlDocEnv As Xml.XmlDocument
Dim gElementoActual As Xml.XmlElement
Dim rootElement As Xml.XmlElement
Dim gstrConnDatos As String
Dim gstrConnUltimus As String
Dim gstrConnSybase As String
Dim gstrServidorCOBIS As String
Dim gResponse
Dim gSession
Dim gProceso As String
Dim gSolicitud As String
Dim gIncidente As String
Dim gEstatusConexionCOBIS As Integer
Dim gEnte As String
Dim gNombre As String
Dim gIdentificacion As String
Dim gTipoIdentificacion As String
Dim gTipoParticipante As String
Dim gCategoriaRiesgo As String
Dim gGeneraMonedaExtranjera As String
Dim gComportamientoPagoHistorico As String
Dim gCapacidadPago As String
Dim gActivarEnte As Integer = 0
Dim VTNum As Integer
Dim VTRow As Integer
Dim VTI As Object
Dim VTClave As String
Dim VTErr_Tipo As String
Dim VTErr_NumErr As Long
Dim VTErr_Sev As Integer
Dim VTErr_Msg As String
Dim VLErrorAut As String
Dim VTnumRets As Integer
Dim VTRetparam As String
Dim VTRetStatus As String
Dim VTresul As String
Dim Map As MAPASPLib.mapcon
Dim SqlConn As Integer
Dim srtResp As String
Dim crypt As Crypt = New Crypt()
Dim log As LogFile = New LogFile()
Public Sub New()
MyBase.New()
Dim bIsDummie As Boolean = False
Try
gstrServidorCOBIS = Configuration.ConfigurationManager.AppSettings("ServerCobisFisico")
bIsDummie = Configuration.ConfigurationManager.AppSettings("isDummie")
If (Not bIsDummie) Then
#If COBIS = 1 Then
Map = New MAPASPLib.mapcon
#End If
End If
gEstatusConexionCOBIS = 0
Catch ex As Exception
Throw New Exception("No fue posible inicializar el servicio. " + ex.Message)
End Try
End Sub
#Region "ActualizarDatosMIS"
Public Function ActualizarDatosMIS(ByVal strUsername As String, ByVal strPassword As String, ByVal strXML As String) As ActualizaDatosMISResponse
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim intResultado As Integer
Dim aMatriz(10, 3)
Dim I As Integer
Dim xmlDocRec As Xml.XmlDocument
Dim xmlCodeudor, xmlFiador As Xml.XmlElement
Dim xmlRoot As Xml.XmlElement
Dim nElement, nElement2, aElement As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim strRespXML As ActualizaDatosMISResponse = Nothing
Dim strSolicitud As String
Dim strTasaCambio As String
xmlDocEnv = New Xml.XmlDocument
objPI = xmlDocEnv.CreateProcessingInstruction("xml", "version='1.0'")
xmlDocEnv.AppendChild(objPI)
rootElement = xmlDocEnv.CreateElement("Resultado")
xmlDocEnv.AppendChild(rootElement)
strRespXML = New ActualizaDatosMISResponse()
Try
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", "Input=> Usuario:" + strUsername + "XML:" + strXML)
gCategoriaRiesgo = ""
gGeneraMonedaExtranjera = ""
gComportamientoPagoHistorico = ""
gCapacidadPago = ""
xmlDocRec = New Xml.XmlDocument
xmlDocRec.LoadXml(strXML)
gProceso = xmlDocRec.SelectSingleNode("//COBIS/Proceso").InnerText
gSolicitud = xmlDocRec.SelectSingleNode("//COBIS/nu_solicitud").InnerText
strTasaCambio = xmlDocRec.SelectSingleNode("//COBIS/po_tasacambio").InnerText
gIncidente = xmlDocRec.SelectSingleNode("//COBIS/nu_incidente").InnerText
If ConsultarLoginCOBIS(strUsername, strPassword) Then
If SqlConn = 0 Then
IniciarConexionCOBIS()
End If
ActualizarDatosSolicitante("Principal", strXML, strUsername, strPassword)
If Len(srtResp) > 0 Then
strRespXML.resultado = srtResp
Else
strRespXML.resultado = xmlDocEnv.InnerXml
End If
End If
strRespXML.errCode = "00"
strRespXML.errMessage = "EXITOSO"
Catch excError As Exception
Try
strRespXML.errCode = "99"
strRespXML.errMessage = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
Try
If SqlConn > 0 And gEstatusConexionCOBIS = 1 Then
TerminarConexionCOBIS()
End If
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", "Output =>" + strRespXML.resultado)
Catch ex As Exception
End Try
End Try
Return strRespXML
End Function
#End Region
Private Function ConsultarLoginCOBIS(ByVal g_co_username As String, ByVal g_password As String) As Boolean
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim co_login, de_clave As String
Dim nu_filial, nu_oficina, nu_rol As Integer
''Dim objAudit As New ServiciosApoyo.Auditoria
' Variables para Manejo de Errores
Dim excError As Exception
Dim strError As String
intNumeroError = 0
strDescError = ""
strOrigenError = "ConsultarLoginCOBIS"
Try
ObtenerOficinaUsuario2(g_co_username, g_password)
Catch ex As Exception
Try
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", ex)
Catch ex2 As Exception
End Try
Finally
If strError <> "" Then
Throw excError
ConsultarLoginCOBIS = False
Else
ConsultarLoginCOBIS = True
End If
End Try
End Function
Private Function ObtenerOficinaUsuario2(ByVal strUser As String,
ByVal strPassword As String)
Dim intNumeroError As Object
Dim excError As Exception
Dim strError As Object
Dim strOrigenError As Object
Dim strSql, strResp As String
Dim conConexion As New Odbc.OdbcConnection
Dim comCommand As New Odbc.OdbcCommand
Dim dapAdaptador As New Odbc.OdbcDataAdapter
Dim dstDatos As New DataSet
''Dim objConector As WSConector.Conector
Dim strFuenteDatos As String = String.Empty
Dim strSP As String = String.Empty
''Dim objAudit As New ServiciosApoyo.Auditoria
Dim aNombreParametro(2), aValorParametro(2) As String
Dim xmlDoc As New Xml.XmlDocument
Dim xmlRoot As Xml.XmlElement
intNumeroError = 0
strOrigenError = "ObtenerUsuarioOficina"
strError = ""
Try
g_Login = strUser
' Obtener los datos de conexión del usuario
conConexion.ConnectionString = ObtenerCadenaConexion("sybase")
strSql = "SELECT us_login, us_clave, us_oficina, us_filial FROM cobis..ad_usuario WHERE us_login = '" & strUser & "' and us_estado = 'V'"
comCommand.Connection = conConexion
comCommand.CommandType = CommandType.Text
comCommand.CommandText = strSql
dapAdaptador.SelectCommand = comCommand
conConexion.Open()
dapAdaptador.Fill(dstDatos)
conConexion.Close()
' Devolver XML
strResp = dstDatos.GetXml
xmlDoc.LoadXml(strResp)
xmlRoot = xmlDoc.DocumentElement.SelectSingleNode("//NewDataSet")
If xmlRoot.ChildNodes.Count > 0 Then
xmlRoot = xmlDoc.DocumentElement.SelectSingleNode("//NewDataSet/Table")
g_Filial = Trim(xmlRoot.SelectSingleNode("us_filial").InnerText)
g_Oficina = Trim(xmlRoot.SelectSingleNode("us_oficina").InnerText)
g_Clave = Trim(xmlRoot.SelectSingleNode("us_clave").InnerText)
Else
g_Clave = ""
End If
' ###########################################################
' Obtener el Rol con el que se conectará
' ###########################################################
If g_Clave <> "" Then
If gProceso = Enumerador.ProcesoUltimus.PrestamoPrendario.ToString() Then
strFuenteDatos = Enumerador.FuenteDatosUltimus.BPMPRENDARIO.ToString()
strSP = "usp_cp_obtener_rol_usuario"
End If
aNombreParametro(1) = "@i_modo" : aValorParametro(1) = "0"
aNombreParametro(2) = "@i_usuario" : aValorParametro(2) = strUser
strResp = outConector.EjecutarComandoSQLArreglo(gProceso, strFuenteDatos, strSP, aNombreParametro, aValorParametro, 0)
xmlDoc.LoadXml(strResp)
xmlRoot = xmlDoc.DocumentElement.SelectSingleNode("//NewDataSet")
If xmlRoot.ChildNodes.Count > 0 Then
xmlRoot = xmlDoc.DocumentElement.SelectSingleNode("//NewDataSet/Table")
g_Rol = Trim(xmlRoot.SelectSingleNode("Rol").InnerText)
g_Filial = Trim(xmlRoot.SelectSingleNode("Filial").InnerText)
g_Oficina = Trim(xmlRoot.SelectSingleNode("Oficina").InnerText)
Else
strError = "Por favor, Ingrese su Rol, Oficina y Filial en la Pantalla de Conexió#¡Muchas Gracias!"
Err.Raise(Err.Number, "ObtenerOficinaUsuario2", strError)
End If
Else
strError = "No se pudo encontrar su clave en SYBASE. Consulte a su Administrador"
Err.Raise(Err.Number, "ObtenerOficinaUsuario2", strError)
End If
Catch excError
Try
If strError = "" Then
strError = excError.Message
End If
''objAudit.grabarLog(gProceso, "consultaGeneral", "ObtenerOficinaUsuario", "E", strError)
Return strError
Catch ex As Exception
''grabarError(gProceso, "consultaGeneral", "ObtenerOficinaUsuario", "E", strError)
Return strError
End Try
End Try
Return strError
End Function
Private Function ObtenerCadenaConexion(ByVal FuenteDatos As String) As String
Dim strCadena As String = String.Empty
Dim objEncriptacion As New LibEncriptacion.Encriptacion
Dim strError As String = String.Empty
Try
strCadena = ReadWebConfig(FuenteDatos)
strCadena = objEncriptacion.getCadenaDesencriptada(strCadena, LibEncriptacion.Encriptacion.Llave.PUBLICA, strError)
Catch excError As Exception
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Finally
objEncriptacion = Nothing
End Try
Return strCadena
End Function
Private Function ReadWebConfig(ByVal Cadena As String) As String
Try
ReadWebConfig = Configuration.ConfigurationManager.AppSettings(Cadena)
Catch ex As Exception
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", ex)
Throw ex
End Try
End Function
Private Sub IniciarConexionCOBIS()
Dim type As Object = Nothing
Dim msgno As Object = Nothing
Dim severity As Object = Nothing
Dim msgtxt As Object = Nothing
Dim strError As String = String.Empty
'Dim objAudit As ServiciosApoyo.Auditoria
Try
'SqlConn = Map.SqlOpen(CStr(gstrServidorCOBIS), CStr("*" & g_Login), CStr(g_Clave))
SqlConn = Map.SqlOpen(CStr(gstrServidorCOBIS), CStr("" & g_Login), CStr(g_Clave))
If SqlConn > 0 Then
gEstatusConexionCOBIS = 1
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".master.sp_reclogin", 1502, gResponse, gSession) Then
' Envia los parametros del procedimiento
Map.PMPasoValores(SqlConn, "@i_role", 0, SQLINT1&, CStr(g_Rol))
Map.PMPasoValores(SqlConn, "@i_server", 0, SQLVARCHAR&, CStr(gstrServidorCOBIS))
Map.PMPasoValores(SqlConn, "@i_login", 0, SQLCHAR&, CStr(g_Login))
Map.PMPasoValores(SqlConn, "@i_terminal", 0, SQLCHAR&, "TERM-CONT")
Map.PMPasoValores(SqlConn, "@i_office", 0, SQLINT1&, CStr(g_Oficina))
' Ejecuto OK
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "master", "sp_reclogin", True, "") Then
Map.PMChequea(SqlConn)
If Map.FMMapeaMensaje(SqlConn, type, msgno, severity, msgtxt) <> -1 Then
Err.Clear()
Err.Number = 999 + ERR_COBIS_1
Err.Description = msgtxt
Err.Source = "IniciarConexionCOBIS"
Err.Raise(Err.Number, Err.Source, Err.Description)
End If
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
Err.Clear()
Err.Number = 999 ' NO SE COLOCA VTErr_NumErr YA que es tipo Long y causa problema a la hora de ejecutar el RAISE(No devuelve el verdadero mensaje de error)
Err.Description = VTErr_Msg
Err.Source = "IniciarConexionCOBIS"
Err.Raise(Err.Number, Err.Source, Err.Description)
End If
Else
Err.Clear()
Err.Number = 512 + ERR_COBIS_2
Err.Description = "COBIS - Error en RPCInit"
Err.Source = "IniciarConexionCOBIS"
Err.Raise(Err.Number, Err.Source, Err.Description)
End If
Else
Err.Clear()
Err.Number = 512 + ERR_COBIS_2
Err.Description = "No se pudo Conectar a la MAP"
Err.Source = "IniciarConexionCOBIS"
Err.Raise(Err.Number, Err.Source, Err.Description)
''objAudit.grabarLog(gProceso, "ConexionCOBIS", "MapSqlOpen", "E", "NoSePudoConectarALaMAP")
End If
Catch excError As Exception
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Throw excError
Finally
If strError <> "" Then
If gEstatusConexionCOBIS = 1 Then
TerminarConexionCOBIS()
End If
End If
End Try
End Sub
#Region "TerminarConexionCOBIS"
Private Sub TerminarConexionCOBIS()
If SqlConn > 0 Then
Map.PMPasoValores(SqlConn, "@i_server", 0, SQLCHAR&, CStr(gstrServidorCOBIS))
Map.PMPasoValores(SqlConn, "@i_login", 0, SQLCHAR&, CStr(g_Login))
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, "1502")
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "master", "sp_endlogin", True, "") Then
Map.PMMapeaVariable(SqlConn, VTresul)
Map.PMChequea(SqlConn)
End If
Map.SqlClose(SqlConn)
SqlConn = 0
gEstatusConexionCOBIS = 0
End If
End Sub
#End Region
#Region "ActualizarDatosSolicitante"
Private Function ActualizarDatosSolicitante(ByVal strTipoParticipante As String, ByVal strXML As String, ByVal strUsername As String, ByVal strPassword As String) As String
Dim co_ente As String
Dim objPI As Xml.XmlProcessingInstruction
Dim nElement, nElementoSolicitante, aElement As Xml.XmlElement
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Try
If SqlConn <> 0 Then
If strTipoParticipante = "Principal" Then
gElementoActual = xmlDocEnv.CreateElement("Solicitante")
rootElement.AppendChild(gElementoActual)
gTipoParticipante = "D"
Else
gElementoActual = xmlDocEnv.CreateElement("Codeudor")
rootElement.AppendChild(gElementoActual)
gTipoParticipante = "C"
End If
gActivarEnte = 0
ActualizarDatosGenerales(strTipoParticipante, strXML, co_ente, strUsername, strPassword)
If Len(srtResp) > 0 Then
Exit Function
End If
nElementoSolicitante = gElementoActual
gElementoActual = xmlDocEnv.CreateElement("Direcciones")
nElementoSolicitante.AppendChild(gElementoActual)
ActualizarDireccionesSolicitante(strTipoParticipante, co_ente, strXML)
gElementoActual = xmlDocEnv.CreateElement("ReferenciasPersonales")
nElementoSolicitante.AppendChild(gElementoActual)
ActualizarReferenciasPersonales(strTipoParticipante, co_ente, strXML)
gElementoActual = xmlDocEnv.CreateElement("FuentesIngreso")
nElementoSolicitante.AppendChild(gElementoActual)
ActualizarFuentesIngreso(strTipoParticipante, co_ente, strXML)
gElementoActual = xmlDocEnv.CreateElement("Emails")
nElementoSolicitante.AppendChild(gElementoActual)
ActualizarEmailSolicitante(strTipoParticipante, co_ente, strXML)
gElementoActual = xmlDocEnv.CreateElement("CamposRegulatorios")
nElementoSolicitante.AppendChild(gElementoActual)
ActualizarCamposRegulatorios(strTipoParticipante, co_ente, strXML)
If gActivarEnte = 1 Then
gElementoActual = xmlDocEnv.CreateElement("Activacion")
nElementoSolicitante.AppendChild(gElementoActual)
ActivarEnteMIS(strTipoParticipante, co_ente)
End If
gElementoActual = xmlDocEnv.CreateElement("CrearCategoria")
nElementoSolicitante.AppendChild(gElementoActual)
Crear_Categoria(strTipoParticipante, co_ente)
End If
Catch
intNumeroError = Err.Number
strDescError = Err.Description
strOrigenError = "ActualizarDatosSolicitante"
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", strDescError)
Finally
If intNumeroError <> 0 Then
Err.Raise(intNumeroError, strOrigenError, strDescError)
Else
ActualizarDatosSolicitante = xmlDocEnv.InnerXml
End If
End Try
End Function
#End Region
#Region "ActualizarDatosGenerales"
Private Sub ActualizarDatosGenerales(ByVal strTipoParticipante As String, ByVal strXML As String, ByRef co_ente As String, ByVal strUsername As String, ByVal strPassword As String)
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim intResultado As Integer
Dim aMatriz(10, 3)
Dim aArreglo(30)
Dim aArreglo1(30)
Dim aArreglo2(30)
Dim aArreglo3(30)
Dim aFecha() As String
Dim I As Integer
Dim xmlDocRec As Xml.XmlDocument
Dim xmlRoot As Xml.XmlElement
Dim nElement, nElement2, aElement As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim de_cedula, de_pasaporte, de_primer_nombre, de_segundo_nombre As String
Dim de_apellido_paterno, de_apellido_materno, de_apellido_casada, de_seguro_social, fe_nacimiento As String
Dim co_nacionalidad, co_estado_civil, co_sexo, co_profesion, co_tipo_ident, co_tipo_persona, de_cedula_sugef As String
Dim co_pais_nac As String
' OHG 15 DIC 2006 - Variables nuevas para consulta al padrón de SUGEF
Dim strEncontrado, strNombreCoincide, strTexto, strId As String
Dim strVTR
Dim strSP, strTransaccion As String
Dim strTempEnte As String
' OHG 21 SEP 06 - Parámetros nuevos por requerimiento de SUGEF
Dim co_sector_economico, co_actividad_economica, co_segmentacion, co_sucursal_gestion, co_ejecutivo_contacto As String
Dim fe_vencimiento As String
' Variables para Manejo de Errores
Dim excError As Exception
Dim strError As String
Try
xmlDocRec = New Xml.XmlDocument
xmlDocRec.LoadXml(strXML)
If strTipoParticipante = "Principal" Or strTipoParticipante = "FiadorPF" Then
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosSolicitante/DatosGenerales")
Else
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosCodeudor/DatosGenerales")
End If
co_ente = xmlRoot.SelectSingleNode("co_ente").InnerText
strTempEnte = co_ente
de_cedula = xmlRoot.SelectSingleNode("de_cedula").InnerText
de_cedula_sugef = xmlRoot.SelectSingleNode("cedula_sugef").InnerText
de_pasaporte = xmlRoot.SelectSingleNode("de_pasaporte").InnerText
de_primer_nombre = xmlRoot.SelectSingleNode("de_primer_nombre").InnerText
de_segundo_nombre = xmlRoot.SelectSingleNode("de_segundo_nombre").InnerText
de_apellido_paterno = xmlRoot.SelectSingleNode("de_apellido_paterno").InnerText
de_apellido_materno = xmlRoot.SelectSingleNode("de_apellido_materno").InnerText
de_apellido_casada = xmlRoot.SelectSingleNode("de_apellido_casada").InnerText
de_seguro_social = xmlRoot.SelectSingleNode("de_seguro_social").InnerText
fe_nacimiento = xmlRoot.SelectSingleNode("fe_nacimiento").InnerText
co_tipo_persona = xmlRoot.SelectSingleNode("co_tipo_persona").InnerText
co_nacionalidad = xmlRoot.SelectSingleNode("co_nacionalidad").InnerText
co_estado_civil = xmlRoot.SelectSingleNode("co_estado_civil").InnerText
'Select Case co_estado_civil
' Case "Casado(a)"
' co_estado_civil = "C"
'End Select
co_sexo = Left(xmlRoot.SelectSingleNode("co_sexo").InnerText, 1)
Try
co_profesion = Format(Integer.Parse(xmlRoot.SelectSingleNode("co_profesion").InnerText), "000")
Catch ex As Exception
End Try
co_tipo_ident = xmlRoot.SelectSingleNode("co_tipo_ident").InnerText
'AP Consulta primero si ya existe la cedula
If co_ente = "0" Or co_ente = "" Then
If co_tipo_ident = "C" Then
ConsultarEnteSolicitante(Enumerador.ProcesoUltimus.PrestamoPrendario.ToString(), de_cedula, co_tipo_ident, co_ente)
ElseIf co_tipo_ident = "P" Then
ConsultarEnteSolicitante(Enumerador.ProcesoUltimus.PrestamoPrendario.ToString(), de_pasaporte, co_tipo_ident, co_ente)
End If
If co_ente <> "" And co_ente <> "0" Then
Dim objLectura As New ConsultaClienteBL
Dim strXMLAux As New ConsultarSecuencialesSolicitanteResponse
Dim strRespAux As String = ""
Dim XMLDocAux As New Xml.XmlDocument
Dim objRequest As New ConsultarSecuencialesSolicitanteRequest
objRequest.Proceso = Enumerador.ProcesoUltimus.PrestamoPrendario
objRequest.strUsername = strUsername
objRequest.strPassword = strPassword
objRequest.strIdentificacion = co_ente
objRequest.strTipoIdentificacion = "Ente"
strXMLAux = objLectura.ConsultarSecuencialesSolicitante(objRequest)
XMLDocAux.LoadXml(strXMLAux.resultado)
strRespAux = XMLDocAux.SelectSingleNode("Resultado").InnerXml
srtResp = "<?xml version='1.0'?><Resultado><Solicitante><co_ente>" & co_ente & "</co_ente><cliente_existe>SI</cliente_existe>" & strRespAux & "</Solicitante></Resultado>"
Exit Sub 'ActualizarDatosGenerales = srtResp
End If
End If
' OHG 21 SEP 06 - Parámetros nuevos por requerimiento de SUGEF
co_sector_economico = xmlRoot.SelectSingleNode("co_sector_economico").InnerText
co_actividad_economica = xmlRoot.SelectSingleNode("co_actividad_economica").InnerText
co_segmentacion = xmlRoot.SelectSingleNode("co_segmentacion").InnerText
co_sucursal_gestion = xmlRoot.SelectSingleNode("co_sucursal_gestion").InnerText
co_ejecutivo_contacto = xmlRoot.SelectSingleNode("co_ejecutivo_contacto").InnerText
' OHG 13 ENE 07 - Parámetros nuevos por requerimiento de SUGEF
fe_vencimiento = xmlRoot.SelectSingleNode("fe_vencimiento").InnerText
If strTipoParticipante = "FiadorPF" Then
aFecha = Split(fe_vencimiento, "/")
If (aFecha.Length >= 3) Then
fe_vencimiento = aFecha(1) & "/" & aFecha(0) & "/" & aFecha(2)
End If
End If
' OHG 12 DIC 06 - Campos para Riesgo
If gCategoriaRiesgo = "" Then
gCategoriaRiesgo = xmlRoot.SelectSingleNode("co_categoria_riesgo").InnerText
End If
If gGeneraMonedaExtranjera = "" Then
gGeneraMonedaExtranjera = xmlRoot.SelectSingleNode("co_generador_moneda").InnerText
End If
If gComportamientoPagoHistorico = "" Then
gComportamientoPagoHistorico = xmlRoot.SelectSingleNode("co_capacidad_pago_hist").InnerText
End If
If gCapacidadPago = "" Then
gCapacidadPago = xmlRoot.SelectSingleNode("co_capacidad_pago").InnerText
End If
' OHG 24 ENE 07 - Campo de País de Nacimiento
co_pais_nac = xmlRoot.SelectSingleNode("co_pais_nac").InnerText
If co_ente <> "0" And co_ente <> "" Then
strSP = "sp_persona_upd"
strTransaccion = "104"
Else
strSP = "sp_persona_ins"
strTransaccion = "103"
End If
' CONSULTA AL PADRON
' Primero realiza la consulta al padrón
If co_ente = "" Or co_ente = "0" Then
co_ente = "0"
gActivarEnte = 1
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_persona_ins", "103", gResponse, gSession) Then
' Envia el paso de parámetros
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "P")
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, CStr(strTransaccion))
Map.PMPasoValores(SqlConn, "@i_cedula", 0, SQLVARCHAR&, CStr(de_cedula_sugef))
Map.PMPasoValores(SqlConn, "@i_pasaporte", 0, SQLVARCHAR&, CStr(de_pasaporte))
Map.PMPasoValores(SqlConn, "@i_persona", 0, SQLINT4&, CStr(co_ente))
Map.PMPasoValores(SqlConn, "@i_nombre", 0, SQLVARCHAR&, CStr(de_primer_nombre))
Map.PMPasoValores(SqlConn, "@i_nombre2", 0, SQLVARCHAR&, CStr(de_segundo_nombre))
Map.PMPasoValores(SqlConn, "@i_p_apellido", 0, SQLVARCHAR&, CStr(de_apellido_paterno))
Map.PMPasoValores(SqlConn, "@i_s_apellido", 0, SQLVARCHAR&, CStr(de_apellido_materno))
Map.PMPasoValores(SqlConn, "@i_tipo_ident", 0, SQLCHAR&, CStr(co_tipo_ident))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_persona_ins", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
If (strTransaccion = "103") Then
strEncontrado = aMatriz(2, 1)
strNombreCoincide = aMatriz(1, 1)
If strTipoParticipante = "Principal" Then
strTexto = "DEUDOR: "
End If
If strTipoParticipante = "Codeudor" Then
strTexto = "CODEUDOR: "
End If
If strTipoParticipante = "FiadorPF" Then
strTexto = "FIADOR: "
End If
If de_cedula_sugef <> "" Then
strId = de_cedula_sugef
End If
If de_pasaporte <> "" Then
strId = de_pasaporte
End If
aElement = xmlDocEnv.CreateElement("ExistePadronSUGEF")
If strEncontrado = "S" Then
aElement.InnerText = strTexto & "Cedula " & strId & " existe en Padrón de SUGEF"
Else
aElement.InnerText = strTexto & "Cedula " & strId & " no existe en Padrón de SUGEF. Favor enviar identificación a cumplimiento inmediatamente"
End If
gElementoActual.AppendChild(aElement)
aElement = xmlDocEnv.CreateElement("NombreCoincidePadronSUGEF")
If strEncontrado = "S" Then
If strNombreCoincide = "S" Then
aElement.InnerText = "Los Nombres y Apellidos coinciden con el PADRON SUGEF"
Else
aElement.InnerText = "Los Nombres y Apellidos son Diferentes al Padrón SUGEF, Aparece: " & aMatriz(5, 1) & " " & aMatriz(3, 1) & " " & aMatriz(4, 1)
End If
Else
aElement.InnerText = ""
End If
gElementoActual.AppendChild(aElement)
gNombre = de_primer_nombre & " " & de_apellido_paterno & " " & de_apellido_materno
If Len(Trim(de_cedula)) > 0 Then
gIdentificacion = de_cedula
End If
If Len(Trim(de_cedula)) > 0 Then
gIdentificacion = de_pasaporte
End If
gTipoIdentificacion = co_tipo_ident
End If
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
Err.Raise(intNumeroError, strSP, strDescError)
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
Else
gActivarEnte = 0
End If
' Luego realiza la inserciòn del solicitante
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis." & CStr(strSP), strTransaccion, gResponse, gSession) Then
If co_sucursal_gestion = "" Then
If g_SucursalGestion <> "" And g_SucursalGestion <> "0" Then
co_sucursal_gestion = g_SucursalGestion
Else
co_sucursal_gestion = "0"
End If
Else
g_SucursalGestion = co_sucursal_gestion
End If
' Envia el paso de parámetros
If co_ente <> "0" And co_ente <> "" Then
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "U")
Map.PMPasoValores(SqlConn, "@i_persona", 0, SQLINT4&, CStr(co_ente))
Else
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "I")
Map.PMPasoValores(SqlConn, "@i_filial", 0, SQLINT2&, "4")
Map.PMPasoValores(SqlConn, "@i_oficina", 0, SQLINT2&, CStr(g_Oficina))
Map.PMPasoValores(SqlConn, "@i_sucursal_gestion", 0, SQLINT2&, CStr(co_sucursal_gestion))
End If
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, CStr(strTransaccion))
Map.PMPasoValores(SqlConn, "@i_cedula", 0, SQLVARCHAR&, CStr(de_cedula))
Map.PMPasoValores(SqlConn, "@i_pasaporte", 0, SQLVARCHAR&, CStr(de_pasaporte))
Map.PMPasoValores(SqlConn, "@i_nombre", 0, SQLVARCHAR&, CStr(de_primer_nombre))
Map.PMPasoValores(SqlConn, "@i_nombre2", 0, SQLVARCHAR&, CStr(de_segundo_nombre))
Map.PMPasoValores(SqlConn, "@i_p_apellido", 0, SQLVARCHAR&, CStr(de_apellido_paterno))
Map.PMPasoValores(SqlConn, "@i_s_apellido", 0, SQLVARCHAR&, CStr(de_apellido_materno))
Map.PMPasoValores(SqlConn, "@i_c_apellido", 0, SQLVARCHAR&, CStr(de_apellido_casada))
Map.PMPasoValores(SqlConn, "@i_ssocial", 0, SQLCHAR&, CStr(de_seguro_social))
Map.PMPasoValores(SqlConn, "@i_fecha_nac", 0, SQLDATETIME&, CStr(fe_nacimiento))
Map.PMPasoValores(SqlConn, "@i_pais", 0, SQLINT2&, CStr(co_nacionalidad))
Map.PMPasoValores(SqlConn, "@i_estado_civil", 0, SQLCHAR&, CStr(co_estado_civil))
Map.PMPasoValores(SqlConn, "@i_sexo", 0, SQLCHAR&, CStr(co_sexo))
Map.PMPasoValores(SqlConn, "@i_profesion", 0, SQLVARCHAR&, CStr(co_profesion))
Map.PMPasoValores(SqlConn, "@i_retencion", 0, SQLCHAR&, "S")
Map.PMPasoValores(SqlConn, "@i_tipo_ident", 0, SQLCHAR&, CStr(co_tipo_ident))
' OHG 21 SEP 06 - Parámetros nuevos por requerimiento de SUGEF
Map.PMPasoValores(SqlConn, "@i_tipo", 0, SQLCHAR&, CStr(co_tipo_persona))
Map.PMPasoValores(SqlConn, "@i_sector_economico", 0, SQLVARCHAR&, CStr(co_sector_economico))
Map.PMPasoValores(SqlConn, "@i_actividad", 0, SQLVARCHAR&, CStr(co_actividad_economica))
Map.PMPasoValores(SqlConn, "@i_segmentacion", 0, SQLVARCHAR&, CStr(co_segmentacion))
Map.PMPasoValores(SqlConn, "@i_fecha_venc", 0, SQLDATETIME&, CStr(fe_vencimiento))
Map.PMPasoValores(SqlConn, "@i_ejecutivo_contacto", 0, SQLVARCHAR&, CStr(co_ejecutivo_contacto))
Map.PMPasoValores(SqlConn, "@i_pais_nac", 0, SQLINT2&, CStr(co_pais_nac))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", CStr(strSP), True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
If (strTransaccion = "103") Then
co_ente = aMatriz(0, 1)
End If
Else
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
Err.Raise(intNumeroError, strSP, strDescError)
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
If co_ente = "0" Then
co_ente = strTempEnte
End If
aElement = xmlDocEnv.CreateElement("co_ente")
aElement.InnerText = co_ente
gElementoActual.AppendChild(aElement)
' GUARDAR DATOS PARA RIESGO
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_mant_riesgo_clte", "1317", gResponse, gSession) Then
' Envia el paso de parámetros
If strTransaccion = "104" Then
Map.PMPasoValores(SqlConn, "@i_opcion", 0, SQLCHAR&, "G")
Else
Map.PMPasoValores(SqlConn, "@i_opcion", 0, SQLCHAR&, "I")
End If
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, "1317")
Map.PMPasoValores(SqlConn, "@i_ente", 0, SQLINT4&, CStr(co_ente))
Map.PMPasoValores(SqlConn, "@i_actividad", 0, SQLCHAR&, CStr(co_actividad_economica))
Map.PMPasoValores(SqlConn, "@i_capacidad_pago", 0, SQLCHAR&, CStr(gCapacidadPago))
Map.PMPasoValores(SqlConn, "@i_genera_divisas", 0, SQLCHAR&, CStr(gGeneraMonedaExtranjera))
Map.PMPasoValores(SqlConn, "@i_comportamiento_historico", 0, SQLCHAR&, CStr(gComportamientoPagoHistorico))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_mant_riesgo_clte", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
Else
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
Err.Raise(intNumeroError, strSP, strDescError)
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
aElement = xmlDocEnv.CreateElement("Riesgo")
aElement.InnerText = "OK"
gElementoActual.AppendChild(aElement)
Catch excError
Try
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
If strError <> "" Then
Throw excError
End If
End Try
End Sub
#End Region
#Region "ConsultarEnteSolicitante"
Public Function ConsultarEnteSolicitante(ByVal Proceso As String, ByVal strIdentificacion As String, ByVal strTipoIdentificacion As String, ByRef co_ente As String) As String
Dim intResp As Integer
Dim intElem As Integer
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim aMatriz(100, 100)
Dim intResultado As Integer
intNumeroError = 0
strDescError = ""
strOrigenError = "ConsultarEnteSolicitante"
Try
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_se_ente", 1182, gResponse, gSession) Then
' Envia el paso de parámetros
Map.PMPasoValores(SqlConn, "@i_subtipo", 0, SQLCHAR&, "P")
' i_tipo = 2 para Cedula; i_tipo = 3 para Pasaporte
If strTipoIdentificacion = "C" Then
Map.PMPasoValores(SqlConn, "@i_tipo", 0, SQLINT1&, "2")
Else
Map.PMPasoValores(SqlConn, "@i_tipo", 0, SQLINT1&, "3")
End If
Map.PMPasoValores(SqlConn, "@i_modo", 0, SQLINT1&, "0")
Map.PMPasoValores(SqlConn, "@i_nombre_bus", 0, SQLVARCHAR&, "%")
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT4&, "1182")
Map.PMPasoValores(SqlConn, "@i_valor", 0, SQLVARCHAR&, CStr(strIdentificacion))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_se_ente", True, "") Then
intResultado = Map.FMMapeaMatriz(SqlConn, aMatriz)
If intResultado <> 0 Then
co_ente = aMatriz(0, 1)
Else
co_ente = "0"
End If
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
Err.Raise(intNumeroError, "sp_se_ente", strDescError)
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
Catch excError As Exception
strDescError = excError.Message
strOrigenError = excError.Source
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Finally
If intNumeroError <> 0 Then
Select Case intNumeroError
Case -2147220988
ConsultarEnteSolicitante = "0"
Case Else
Err.Raise(intNumeroError, strOrigenError, strDescError)
End Select
Else
ConsultarEnteSolicitante = co_ente
End If
End Try
End Function
#End Region
#Region "ActualizarDireccionesSolicitante"
Private Sub ActualizarDireccionesSolicitante(ByVal strTipoParticipante As String, ByVal co_ente As String, ByVal strXML As String)
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim intResultado As Integer
Dim aMatriz(10, 3)
Dim I As Integer
Dim xmlDocRec As Xml.XmlDocument
Dim xmlRoot, xmlTelefonos As Xml.XmlElement
Dim nElement, nElement2, aElement, nChild As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim co_direccion, co_pais, co_provincia, co_canton, co_distrito As String
Dim co_tipo_domicilio, de_calle, de_vivienda, de_edificio, co_tipo_direccion As String
Dim co_alquilada, mo_alquiler, co_verificado, de_direccion_exacta As String
Dim strTransaccion As String
Dim strTempDir As String
' Variables para Manejo de Errores
Dim excError As Exception
Dim strError As String
Try
xmlDocRec = New Xml.XmlDocument
xmlDocRec.LoadXml(strXML)
If strTipoParticipante = "Principal" Then
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosSolicitante/Direcciones")
End If
For I = 0 To (xmlRoot.ChildNodes.Count - 1)
nChild = xmlRoot.ChildNodes.Item(I)
co_direccion = nChild.SelectSingleNode("co_direccion").InnerText
strTempDir = co_direccion
co_pais = nChild.SelectSingleNode("co_pais").InnerText
If co_pais = "" Then
co_pais = "41"
End If
co_provincia = nChild.SelectSingleNode("co_provincia").InnerText
co_canton = nChild.SelectSingleNode("co_canton").InnerText
co_distrito = nChild.SelectSingleNode("co_distrito").InnerText
co_tipo_domicilio = nChild.SelectSingleNode("co_tipo_domicilio").InnerText
de_calle = nChild.SelectSingleNode("de_calle").InnerText
de_vivienda = nChild.SelectSingleNode("de_vivienda").InnerText
de_edificio = nChild.SelectSingleNode("de_edificio").InnerText
co_tipo_direccion = nChild.SelectSingleNode("co_tipo_direccion").InnerText
co_alquilada = nChild.SelectSingleNode("co_alquilada").InnerText
mo_alquiler = nChild.SelectSingleNode("mo_alquiler").InnerText
co_verificado = nChild.SelectSingleNode("co_verificado").InnerText
de_direccion_exacta = nChild.SelectSingleNode("de_direccion_exacta").InnerText
If co_direccion <> "0" And co_direccion <> "" Then
strTransaccion = "110"
Else
strTransaccion = "109"
End If
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_direccion_dml", strTransaccion, gResponse, gSession) Then
' Envia el paso de parámetros
If co_direccion <> "0" And co_direccion <> "" Then
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "U")
Map.PMPasoValores(SqlConn, "@i_direccion", 0, SQLINT1&, CStr(co_direccion))
Else
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "I")
End If
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, CStr(strTransaccion))
Map.PMPasoValores(SqlConn, "@i_pais", 0, SQLINT1&, CStr(co_pais))
If Not String.IsNullOrWhiteSpace(co_provincia) Then
Map.PMPasoValores(SqlConn, "@i_provincia", 0, SQLINT1&, CStr(co_provincia))
End If
If Not String.IsNullOrWhiteSpace(co_canton) Then
Map.PMPasoValores(SqlConn, "@i_ciudad", 0, SQLINT2&, CStr(co_canton))
End If
If Not String.IsNullOrWhiteSpace(co_distrito) Then
Map.PMPasoValores(SqlConn, "@i_parroquia", 0, SQLINT2&, CStr(co_distrito))
End If
Map.PMPasoValores(SqlConn, "@i_clase_dir", 0, SQLCHAR&, CStr(co_tipo_domicilio))
Map.PMPasoValores(SqlConn, "@i_num_calle", 0, SQLVARCHAR&, CStr(de_calle))
Map.PMPasoValores(SqlConn, "@i_num_vivienda", 0, SQLVARCHAR&, CStr(de_vivienda))
Map.PMPasoValores(SqlConn, "@i_tipo", 0, SQLCHAR&, CStr(co_tipo_direccion))
Map.PMPasoValores(SqlConn, "@i_nombre_edif", 0, SQLVARCHAR&, CStr(de_edificio))
Map.PMPasoValores(SqlConn, "@i_alquiler", 0, SQLCHAR&, CStr(co_alquilada))
If mo_alquiler = "" Then
mo_alquiler = "0"
End If
Map.PMPasoValores(SqlConn, "@i_alq_men", 0, SQLMONEY&, CStr(mo_alquiler))
Map.PMPasoValores(SqlConn, "@i_verificado", 0, SQLCHAR&, CStr(co_verificado))
Map.PMPasoValores(SqlConn, "@i_descripcion", 0, SQLVARCHAR&, CStr(de_direccion_exacta))
Map.PMPasoValores(SqlConn, "@i_ente", 0, SQLINT4&, CStr(co_ente))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_direccion_dml", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
If strTransaccion = "109" Then
co_direccion = aMatriz(0, 1)
End If
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
If (VTErr_NumErr.ToString() <> "103007" And VTErr_NumErr.ToString() <> "") Then
Err.Raise(intNumeroError, "sp_direccion_dml", strDescError)
Else
co_direccion = "1"
End If
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
nElement = xmlDocEnv.CreateElement("Direccion")
gElementoActual.AppendChild(nElement)
If co_direccion = "0" Then
co_direccion = strTempDir
End If
aElement = xmlDocEnv.CreateElement("co_direccion")
aElement.InnerText = co_direccion
nElement.AppendChild(aElement)
aElement = xmlDocEnv.CreateElement("co_tipo_direccion")
aElement.InnerText = co_tipo_direccion
nElement.AppendChild(aElement)
aElement = xmlDocEnv.CreateElement("Telefonos")
nElement.AppendChild(aElement)
xmlTelefonos = nChild.SelectSingleNode("Telefonos")
If xmlTelefonos.ChildNodes.Count > 0 Then
ActualizarTelefonoSolicitante(co_ente, co_direccion, xmlTelefonos, aElement)
End If
Next
Catch excError
Try
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
If strError <> "" Then
Throw excError
End If
End Try
End Sub
#End Region
#Region "ActualizarTelefonoSolicitante"
Private Sub ActualizarTelefonoSolicitante(ByVal co_ente As String, ByVal co_direccion As String, ByVal xmlTelefonosDireccion As Xml.XmlElement, ByRef xmlElementTelefonos As Xml.XmlElement)
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim intResultado As Integer
Dim aMatriz(10, 3)
Dim I As Integer
Dim xmlDocRec As Xml.XmlDocument
Dim xmlRoot As Xml.XmlElement
Dim nElement, nElement2, aElement, nChild As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim co_pais, co_provincia, co_ciudad, co_corregimiento As String
Dim co_tipo, co_secuencial, de_telefono, de_edificio, co_tipo_direccion As String
Dim co_alquilada, mo_alquiler, co_verificado As String
Dim strTransaccion As String
Dim strTempDir As String
' Variables para Manejo de Errores
Dim excError As Exception
Dim strError As String
Try
xmlDocRec = New Xml.XmlDocument
For I = 0 To (xmlTelefonosDireccion.ChildNodes.Count - 1)
nChild = xmlTelefonosDireccion.ChildNodes.Item(I)
co_tipo = nChild.SelectSingleNode("co_tipo").InnerText
co_secuencial = nChild.SelectSingleNode("co_secuencial").InnerText
de_telefono = nChild.SelectSingleNode("de_telefono").InnerText
If co_secuencial <> "0" And co_secuencial <> "" Then
strTransaccion = "112"
Else
strTransaccion = "111"
End If
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_telefono", strTransaccion, gResponse, gSession) Then
' Envia el paso de parámetros
If co_secuencial <> "0" And co_secuencial <> "" Then
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "U")
Map.PMPasoValores(SqlConn, "@i_secuencial", 0, SQLINT1&, CStr(co_secuencial))
Else
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "I")
End If
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, CStr(strTransaccion))
Map.PMPasoValores(SqlConn, "@i_ente", 0, SQLINT4&, CStr(co_ente))
Map.PMPasoValores(SqlConn, "@i_direccion", 0, SQLINT1&, CStr(co_direccion))
Map.PMPasoValores(SqlConn, "@i_valor", 0, SQLVARCHAR&, CStr(de_telefono))
Map.PMPasoValores(SqlConn, "@i_tipo_telefono", 0, SQLCHAR&, CStr(co_tipo))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_telefono", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
If strTransaccion = "111" Then
co_secuencial = aMatriz(0, 1)
End If
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
If VTErr_NumErr.ToString() <> "208183" And VTErr_NumErr.ToString() <> "105035" And VTErr_NumErr.ToString() <> "" Then
Err.Raise(intNumeroError, "sp_telefono", strDescError)
End If
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
nElement = xmlDocEnv.CreateElement("Telefono")
xmlElementTelefonos.AppendChild(nElement)
If co_secuencial = "0" Then
co_secuencial = strTempDir
End If
aElement = xmlDocEnv.CreateElement("co_secuencial")
aElement.InnerText = co_secuencial
nElement.AppendChild(aElement)
aElement = xmlDocEnv.CreateElement("co_tipo")
aElement.InnerText = co_tipo
nElement.AppendChild(aElement)
Next
Catch excError
Try
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
If strError <> "" Then
Throw excError
End If
End Try
End Sub
#End Region
#Region "ActualizarReferenciasPersonales"
Private Sub ActualizarReferenciasPersonales(ByVal strTipoParticipante As String, ByVal co_ente As String, ByVal strXML As String)
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim intResultado As Integer
Dim aMatriz(10, 3)
Dim I As Integer
Dim xmlDocRec As Xml.XmlDocument
Dim xmlRoot As Xml.XmlElement
Dim nElement, nElement2, aElement, nChild As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim no_referencia, nombre, p_apellido, s_apellido, direccion As String
Dim telefono_d, parentesco, co_verificado, telefono_e, celular As String
Dim strTransaccion As String
Dim strTempRef As String = String.Empty
' Variables para Manejo de Errores
Dim strError As String = String.Empty
Try
xmlDocRec = New Xml.XmlDocument
xmlDocRec.LoadXml(strXML)
If strTipoParticipante = "Principal" Or strTipoParticipante = "FiadorPF" Then
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosSolicitante/ReferenciasPersonales")
Else
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosCodeudor/ReferenciasPersonales")
End If
If (Not IsNothing(xmlRoot)) Then
For I = 0 To (xmlRoot.ChildNodes.Count - 1)
nChild = xmlRoot.ChildNodes.Item(I)
no_referencia = nChild.SelectSingleNode("no_referencia").InnerText
nombre = nChild.SelectSingleNode("nombre").InnerText
p_apellido = nChild.SelectSingleNode("p_apellido").InnerText
s_apellido = nChild.SelectSingleNode("s_apellido").InnerText
direccion = nChild.SelectSingleNode("direccion").InnerText
telefono_d = nChild.SelectSingleNode("telefono_d").InnerText
parentesco = nChild.SelectSingleNode("parentesco").InnerText
telefono_e = nChild.SelectSingleNode("telefono_e").InnerText
celular = nChild.SelectSingleNode("celular").InnerText
If no_referencia <> "0" And no_referencia <> "" Then
strTempRef = no_referencia
strTransaccion = "178"
Else
strTransaccion = "177"
End If
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_refpersonal", strTransaccion, gResponse, gSession) Then
' Envia el paso de parámetros
If no_referencia <> "0" And no_referencia <> "" Then
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "U")
Map.PMPasoValores(SqlConn, "@i_referencia", 0, SQLINT1&, CStr(no_referencia))
Else
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "I")
End If
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, CStr(strTransaccion))
Map.PMPasoValores(SqlConn, "@i_ente", 0, SQLINT4&, CStr(co_ente))
Map.PMPasoValores(SqlConn, "@i_nombre", 0, SQLVARCHAR&, CStr(nombre))
Map.PMPasoValores(SqlConn, "@i_p_apellido", 0, SQLVARCHAR&, CStr(p_apellido))
Map.PMPasoValores(SqlConn, "@i_s_apellido", 0, SQLVARCHAR&, CStr(s_apellido))
Map.PMPasoValores(SqlConn, "@i_direccion", 0, SQLVARCHAR&, CStr(direccion))
Map.PMPasoValores(SqlConn, "@i_telefono_d", 0, SQLCHAR&, CStr(telefono_d))
Map.PMPasoValores(SqlConn, "@i_telefono_e", 0, SQLCHAR&, CStr(telefono_e))
Map.PMPasoValores(SqlConn, "@i_telefono_o", 0, SQLCHAR&, CStr(celular))
Map.PMPasoValores(SqlConn, "@i_parentesco", 0, SQLCHAR&, CStr(parentesco))
Map.PMPasoValores(SqlConn, "@i_verificacion", 0, SQLCHAR&, "N")
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_refpersonal", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
If strTransaccion = "177" Then
no_referencia = aMatriz(0, 1)
End If
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
Err.Raise(intNumeroError, "sp_refpersonal", strDescError)
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
nElement = xmlDocEnv.CreateElement("ReferenciaPersonal")
gElementoActual.AppendChild(nElement)
If no_referencia = 0 Then
no_referencia = strTempRef
End If
aElement = xmlDocEnv.CreateElement("no_referencia")
aElement.InnerText = no_referencia
nElement.AppendChild(aElement)
Next
End If
Catch excError As Exception
Try
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
If strError <> "" Then
Throw New Exception(strError)
End If
End Try
End Sub
#End Region
#Region "ActualizarFuentesIngreso"
Private Sub ActualizarFuentesIngreso(ByVal strTipoParticipante As String, ByVal co_ente As String, ByVal strXML As String)
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim intResultado As Integer
Dim aMatriz(10, 3)
Dim I As Integer
Dim xmlDocRec As Xml.XmlDocument
Dim xmlRoot As Xml.XmlElement
Dim nElement, nElement2, aElement, nChild As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim co_empleo, co_empresa, de_empresa, co_ocupacion, fe_ingreso, mo_sueldo As String
Dim co_tipo_empleo, de_ministerio, nu_planilla, nu_empleado, nu_empleado_seguro As String
Dim co_verificado, co_moneda As String
Dim strTransaccion As String
Dim strTempEmpleo As String
Dim aFecha() As String
' Variables para Manejo de Errores
Dim excError As Exception
Dim strError As String
Try
xmlDocRec = New Xml.XmlDocument
xmlDocRec.LoadXml(strXML)
If strTipoParticipante = "Principal" Or strTipoParticipante = "FiadorPF" Then
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosSolicitante/FuentesIngreso")
Else
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosCodeudor/FuentesIngreso")
End If
For I = 0 To (xmlRoot.ChildNodes.Count - 1)
nChild = xmlRoot.ChildNodes.Item(I)
co_empleo = nChild.SelectSingleNode("co_empleo").InnerText
strTempEmpleo = co_empleo
co_empresa = nChild.SelectSingleNode("co_empresa").InnerText
de_empresa = nChild.SelectSingleNode("de_empresa").InnerText
co_ocupacion = nChild.SelectSingleNode("co_ocupacion").InnerText
fe_ingreso = nChild.SelectSingleNode("fe_ingreso").InnerText
mo_sueldo = nChild.SelectSingleNode("mo_sueldo").InnerText
co_tipo_empleo = nChild.SelectSingleNode("co_tipo_empleo").InnerText
de_ministerio = nChild.SelectSingleNode("de_ministerio").InnerText
nu_planilla = nChild.SelectSingleNode("nu_planilla").InnerText
nu_empleado = nChild.SelectSingleNode("nu_empleado").InnerText
nu_empleado_seguro = nChild.SelectSingleNode("nu_empleado_seguro").InnerText
co_verificado = nChild.SelectSingleNode("co_verificado").InnerText
co_moneda = nChild.SelectSingleNode("co_moneda").InnerText
' OHG 13 ENE 2007 - Ajuste de la fecha de ingreso
If strTipoParticipante = "FiadorPF" Then
aFecha = Split(fe_ingreso, "/")
If (aFecha.Length >= 3) Then
fe_ingreso = aFecha(1) & "/" & aFecha(0) & "/" & aFecha(2)
End If
End If
If co_empleo <> "0" And co_empleo <> "" Then
strTransaccion = "182"
Else
strTransaccion = "181"
End If
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_empleo", strTransaccion, gResponse, gSession) Then
' Envia el paso de parámetros
If co_empleo <> "0" And co_empleo <> "" Then
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "U")
Map.PMPasoValores(SqlConn, "@i_trabajo", 0, SQLINT1&, CStr(co_empleo))
Else
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "I")
End If
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, CStr(strTransaccion))
If co_empresa = "" Or co_empresa = "0" Then
Map.PMPasoValores(SqlConn, "@i_nom_cia", 0, SQLVARCHAR&, CStr(de_empresa))
Else
Map.PMPasoValores(SqlConn, "@i_empresa", 0, SQLINT4&, CStr(co_empresa))
End If
Map.PMPasoValores(SqlConn, "@i_ocupacion", 0, SQLVARCHAR&, CStr(co_ocupacion))
Map.PMPasoValores(SqlConn, "@i_fecha_ingreso", 0, SQLDATETIME&, CStr(fe_ingreso))
Map.PMPasoValores(SqlConn, "@i_sueldo", 0, SQLMONEY&, CStr(mo_sueldo))
Map.PMPasoValores(SqlConn, "@i_empleo", 0, SQLVARCHAR&, CStr(co_tipo_empleo))
Map.PMPasoValores(SqlConn, "@i_ministerio", 0, SQLVARCHAR&, CStr(de_ministerio))
Map.PMPasoValores(SqlConn, "@i_planilla", 0, SQLVARCHAR&, CStr(nu_planilla))
Map.PMPasoValores(SqlConn, "@i_empleado", 0, SQLVARCHAR&, CStr(nu_empleado))
Map.PMPasoValores(SqlConn, "@i_seguro", 0, SQLVARCHAR&, CStr(nu_empleado_seguro))
Map.PMPasoValores(SqlConn, "@i_verificado", 0, SQLCHAR&, CStr(co_verificado))
Map.PMPasoValores(SqlConn, "@i_ente", 0, SQLINT4&, CStr(co_ente))
Map.PMPasoValores(SqlConn, "@i_moneda", 0, SQLINT2&, CStr(co_moneda))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_empleo", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
If strTransaccion = "181" Then
co_empleo = aMatriz(0, 1)
End If
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
Err.Raise(intNumeroError, "sp_empleo", strDescError)
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
nElement = xmlDocEnv.CreateElement("FuenteIngreso")
gElementoActual.AppendChild(nElement)
If co_empleo = "0" Then
co_empleo = strTempEmpleo
End If
aElement = xmlDocEnv.CreateElement("co_empleo")
aElement.InnerText = co_empleo
nElement.AppendChild(aElement)
Next
Catch excError
Try
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
If strError <> "" Then
Throw excError
End If
End Try
End Sub
#End Region
#Region "ActualizarEmailSolicitante"
Private Sub ActualizarEmailSolicitante(ByVal strTipoParticipante As String, ByVal co_ente As String, ByVal strXML As String)
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim intResultado As Integer
Dim aMatriz(10, 3)
Dim I As Integer
Dim xmlDocRec As Xml.XmlDocument
Dim xmlRoot, xmlTelefonos As Xml.XmlElement
Dim nElement, nElement2, aElement, nChild As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim co_email, de_email, co_tipo_email As String
Dim strTransaccion As String
Dim strTempDir As String
' Variables para Manejo de Errores
Dim excError As Exception
Dim strError As String
Try
xmlDocRec = New Xml.XmlDocument
xmlDocRec.LoadXml(strXML)
If strTipoParticipante = "Principal" Or strTipoParticipante = "FiadorPF" Then
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosSolicitante/Emails")
Else
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosCodeudor/Emails")
End If
For I = 0 To (xmlRoot.ChildNodes.Count - 1)
nChild = xmlRoot.ChildNodes.Item(I)
co_email = nChild.SelectSingleNode("co_email").InnerText
co_tipo_email = nChild.SelectSingleNode("co_tipo_email").InnerText
strTempDir = co_email
de_email = nChild.SelectSingleNode("de_email").InnerText
If de_email <> "" Then
If co_email <> "0" And co_email <> "" Then
strTransaccion = "1271"
Else
strTransaccion = "1270"
End If
If co_email <> "0" And co_email <> "" Then
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_email", "1271", gResponse, gSession) Then
' Envia el paso de parámetros
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "E")
Map.PMPasoValores(SqlConn, "@i_sec", 0, SQLINT1&, CStr(co_email))
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, "1271")
Map.PMPasoValores(SqlConn, "@i_ente", 0, SQLINT4&, CStr(co_ente))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_email", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
If VTErr_NumErr.ToString() <> "208186" And VTErr_NumErr.ToString() <> "" Then
Err.Raise(intNumeroError, "sp_email", strDescError)
End If
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
End If
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_email", "1270", gResponse, gSession) Then
' Envia el paso de parámetros
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "I")
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, "1270")
Map.PMPasoValores(SqlConn, "@i_descripcion", 0, SQLVARCHAR&, CStr(de_email))
Map.PMPasoValores(SqlConn, "@i_ente", 0, SQLINT4&, CStr(co_ente))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_email", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
co_email = aMatriz(0, 1)
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
If VTErr_NumErr <> 208186 Then
Err.Raise(intNumeroError, "sp_email", strDescError)
End If
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
nElement = xmlDocEnv.CreateElement("Email")
gElementoActual.AppendChild(nElement)
If co_email = "0" Then
co_email = strTempDir
End If
aElement = xmlDocEnv.CreateElement("co_email")
aElement.InnerText = co_email
nElement.AppendChild(aElement)
aElement = xmlDocEnv.CreateElement("co_tipo_email")
aElement.InnerText = co_tipo_email
nElement.AppendChild(aElement)
End If
Next
Catch excError
Try
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
If strError <> "" Then
Throw excError
End If
End Try
End Sub
#End Region
#Region "ActualizarCamposRegulatorios"
Private Sub ActualizarCamposRegulatorios(ByVal strTipoParticipante As String, ByVal co_ente As String, ByVal strXML As String)
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim intResultado As Integer
Dim aMatriz(10, 3)
Dim I As Integer
Dim xmlDocRec As Xml.XmlDocument
Dim xmlRoot, xmlTelefonos As Xml.XmlElement
Dim nElement, nElement2, aElement, nChild As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim co_declara_renta, co_riesgo_cambiario As String
Dim strTransaccion As String
Dim strTempDir As String
' Variables para Manejo de Errores
Dim excError As Exception
Dim strError As String
Try
xmlDocRec = New Xml.XmlDocument
xmlDocRec.LoadXml(strXML)
If strTipoParticipante = "Principal" Or strTipoParticipante = "FiadorPF" Then
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosSolicitante/CamposRegulatorios")
Else
xmlRoot = xmlDocRec.DocumentElement.SelectSingleNode("//COBIS/DatosCodeudor/CamposRegulatorios")
End If
For I = 0 To (xmlRoot.ChildNodes.Count - 1)
nChild = xmlRoot.ChildNodes.Item(I)
co_declara_renta = nChild.SelectSingleNode("co_declara_renta").InnerText
co_riesgo_cambiario = nChild.SelectSingleNode("co_riesgo_cambiario").InnerText
strTransaccion = "182"
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cob_sugef.sp_ingresos_deudor", strTransaccion, gResponse, gSession) Then
' Envia el paso de parámetros
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "A")
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT2&, CStr(strTransaccion))
Map.PMPasoValores(SqlConn, "@i_ente", 0, SQLINT4&, CStr(co_ente))
Map.PMPasoValores(SqlConn, "@i_riesgo_camb_deudor", 0, SQLMONEY&, CStr(co_riesgo_cambiario))
Map.PMPasoValores(SqlConn, "@i_ind_declara_renta", 0, SQLVARCHAR&, CStr(co_declara_renta))
'Map.PMPasoValores(SqlConn, "@i_carga_mensual_CSD", 0, SQLMONEY&, CStr(co_carga_mensual_CSD))
'Map.PMPasoValores(SqlConn, "@i_cuotas_no_reg_CSD", 0, SQLMONEY&, CStr(co_cuotas_no_reg_CSD))
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cob_sugef", "sp_ingresos_deudor", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
Err.Raise(intNumeroError, "sp_ingresos_deudor", strDescError)
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
Next
Catch excError
Try
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
If strError <> "" Then
Throw excError
End If
End Try
End Sub
#End Region
#Region "ActivarEnteMIS"
Public Function ActivarEnteMIS(ByVal strTipoParticipante As String, ByVal co_ente As String) As String
Dim no_sucursal As String
Dim intResp As Integer
Dim intElem As Integer
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim aMatriz(10, 10)
Dim xmlRoot As Xml.XmlElement
Dim nElement, nElement2, aElement As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim strRespXML As String
Dim xmlEntes As Xml.XmlElement
Dim xmlEnte As Xml.XmlElement
Dim I As Integer
' Variables para Manejo de Errores
Dim excError As Exception
Dim strError As String
intNumeroError = 0
strDescError = ""
strOrigenError = "actualizarMIS"
Try
strRespXML = "<Respuesta>"
If SqlConn > 0 Then
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_persona_upd", 1258, gResponse, gSession) Then
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT4&, "1258")
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "E")
Map.PMPasoValores(SqlConn, "@i_persona", 0, SQLINT4&, CStr(co_ente))
Map.PMPasoValores(SqlConn, "@i_estado", 0, SQLCHAR&, "7")
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_persona_upd", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
nElement = xmlDocEnv.CreateElement("EnteActivo")
nElement.InnerText = "SI"
gElementoActual.AppendChild(nElement)
End If
Catch excError
Try
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
If strError <> "" Then
Throw excError
End If
End Try
End Function
#End Region
#Region "Crear_Categoria"
Public Function Crear_Categoria(ByVal strTipoParticipante As String, ByVal co_ente As String) As String
Dim no_sucursal As String
Dim intResp As Integer
Dim intElem As Integer
Dim intNumeroError As Object
Dim strDescError As Object
Dim strOrigenError As Object
Dim aMatriz(10, 10)
Dim xmlRoot As Xml.XmlElement
Dim nElement, nElement2, aElement As Xml.XmlElement
Dim objPI As Xml.XmlProcessingInstruction
Dim strRespXML As String
Dim xmlEntes As Xml.XmlElement
Dim xmlEnte As Xml.XmlElement
Dim relacion As String
Dim I As Integer
' Variables para Manejo de Errores
Dim excError As Exception
Dim strError As String
intNumeroError = 0
strDescError = ""
strOrigenError = "actualizarMIS"
Select Case strTipoParticipante
Case "Principal"
relacion = "8"
Case "FiadorPF"
relacion = "20"
Case Else
relacion = "9"
End Select
Try
strRespXML = "<Respuesta>"
If SqlConn > 0 Then
If Map.FMRpcInit(SqlConn, CStr(gstrServidorCOBIS) & ".cobis.sp_relacion_prod", 1277, gResponse, gSession) Then
Map.PMPasoValores(SqlConn, "@t_trn", 0, SQLINT4&, "1277")
Map.PMPasoValores(SqlConn, "@i_operacion", 0, SQLCHAR&, "I")
Map.PMPasoValores(SqlConn, "@i_cliente", 0, SQLINT4&, CStr(co_ente))
Map.PMPasoValores(SqlConn, "@i_relacion", 0, SQLINT4&, relacion)
If Map.FMTransmitirRPC(SqlConn, CStr(gstrServidorCOBIS), "cobis", "sp_relacion_prod", True, "") Then
Map.FMMapeaMatriz(SqlConn, aMatriz)
Map.PMChequea(SqlConn)
Else
Map.FMMapeaMensaje(SqlConn, VTErr_Tipo, VTErr_NumErr, VTErr_Sev, VTErr_Msg)
Map.PMChequea(SqlConn)
intNumeroError = vbObjectError + 512 + ERR_COBIS_4
strDescError = VTErr_NumErr & "- " & VTErr_Sev & "- " & VTErr_Msg
Err.Raise(intNumeroError, "sp_relacion_prod", strDescError)
End If
VTRetStatus = Map.FMRetStatus(SqlConn)
Map.PMChequea(SqlConn)
End If
nElement = xmlDocEnv.CreateElement("CategoriaCreada")
nElement.InnerText = "SI"
gElementoActual.AppendChild(nElement)
End If
Catch excError
Try
strError = excError.Message
log.EscribirArchivo("ULA.Davivienda.WCFServiciosCobisGenerales", excError)
Catch ex As Exception
End Try
Finally
If strError <> "" Then
Throw excError
End If
End Try
End Function
#End Region
End Class