/// <summary> /// /// </summary> /// <param name="identificación"></param> /// <returns></returns> public ResponsePersonaModel BuscarPorIdentificacion(string identificación) { try { var response = _datosPersonaRcRepository.BuscarPorId(identificación); var model = new ResponsePersonaModel { Cedula = response.IDENTIFICACION, Nombre = response.NOMBRE_COMPLETO, Profesion = response.PROFESION, NombreMadre = response.NOMBRE_MADRE, NombrePadre = response.NOMBRE_PADRE, Conyuge = response.NOMBRE_CONYUGE, EstadoCivil = response.ESTADO_CIVIL, FechaCedulacion = response.FECHA_CEDULACION.ToString() == null ? null : response.FECHA_CEDULACION.ToString("dd/MM/yyyy"), FechaActualizacion = response.FECHA_ACTUALIZACION.ToString() == null ? null : response.FECHA_ACTUALIZACION.ToString("dd/MM/yyyy"), //FechaDefuncion = response.FECHA_DEFUNCION.ToString() == null ? null : response.FECHA_DEFUNCION }; return(model); } catch (Exception e) { return(null); } }
/// <summary> /// /// </summary> /// <param name="info"></param> public async Task <bool> CrearLogAsync(ResponsePersonaModel info) { try { var connection = _configurationService.GetValue("Global:Services:Siaerp:ConnectionString"); var model = new ConsultaPersonaLog { IdConsultaPersonaLog = 0, IdUsuario = 15663, Usuario = "DATOSPERSONAWS", Rol = (int)RolBusqueda.Normal, Origen = (int)OrigenBusqueda.DataBook, Fecha = DateTime.Now, Aplicacion = "ROLES", UrlLlamada = "", Respuesta = "CONSULTA REALIZADA.", Accion = (int)AccionConsulta.Consulta, BasePropia = 0, RegistroCivil = 1, NombreCompletoUsuario = info.Nombre, CedulaConsultada = info.Cedula, DataBook = 0 }; var flag = AddLog(model, connection); _oracleContext.ConsultaPersonaLogs.Add(model); //await _oracleContext.SaveChangesAsync(); return(true); } catch (Exception e) { return(false); } }
/// <summary> /// /// </summary> /// <param name="model"></param> /// <returns></returns> public async Task <bool> GuardarLogAsync(ResponsePersonaModel model) { try { return(await _consultaLogRepository.CrearLogAsync(model)); } catch (Exception) { return(false); } }
/// <summary> /// /// </summary> /// <param name="pm"></param> /// <returns></returns> public DataClientesRc MapeaRCDataCliente(ResponsePersonaModel pm) { try { var model = new DataClientesRc { }; return(model); } catch (Exception) { return(null); } }
/// <summary> /// /// </summary> /// <param name="model"></param> /// <param name="tiempo"></param> /// <returns></returns> public bool ValidarActualizacion(ResponsePersonaModel model, int tiempo) { try { var fechaActualizacion = Convert.ToDateTime(model.FechaActualizacion); var fechaActual = DateTime.Now; var dif = fechaActual - fechaActualizacion; var dias = dif.Days; if (dif.Days > tiempo) { return(true); } return(false); } catch (Exception e) { return(false); } }
/// <summary> /// /// </summary> /// <param name="identification"></param> /// <returns></returns> public async Task <ResponsePersonaModel> ConsultaNuevoRCAsync(string identification) { var nombreCiudadano = ""; var codInstitucion = _configurationService.GetValue("registrocivil:CredencialesRC:codInstitucion"); var codAgencia = _configurationService.GetValue("registrocivil:CredencialesRC:codAgencia"); var newUsuarioRC = _configurationService.GetValue("registrocivil:CredencialesRC:newUsuarioRC"); var newClaveRC = _configurationService.GetValue("registrocivil:CredencialesRC:newClaveRC"); var response = new ResponsePersonaModel(); WSConsultaCiudadano.ConsultaCiudadanoClient service = new WSConsultaCiudadano.ConsultaCiudadanoClient(); WSConsultaCiudadano.BusquedaPorNuiResponse personaRc = await service.BusquedaPorNuiAsync(codInstitucion, codAgencia, newUsuarioRC, newClaveRC, identification); nombreCiudadano = [email protected]; var strNombres = Helper.TransformarNombres(nombreCiudadano, Helper.NombreOrden.PrimeroApellidos); response.Acta = [email protected]; response.CIConyuge = [email protected]; response.Genero = [email protected]; response.Nombre = [email protected]; response.Cedula = [email protected]; response.CodigoError = [email protected]; response.Error = [email protected]; response.CondicionCedulado = [email protected]; response.Conyuge = [email protected]; response.EstadoCivil = [email protected]; response.FechaCedulacion = [email protected]; response.FechaDefuncion = [email protected]; response.FechaNacimiento = [email protected]; response.FechaMatrimonio = [email protected]; response.Nacionalidad = [email protected]; response.Profesion = [email protected]; response.PrimerNombre = strNombres.PrimerNombre; response.SegundoNombre = strNombres.SegundoNombre; response.PrimerApellido = strNombres.PrimerApellido; response.SegundoApellido = strNombres.SegundoApellido; return(response); }
/// <summary> /// /// </summary> /// <param name="identificacion"></param> /// <returns></returns> public async Task <ResponsePersonaModel> ConsultaAntiguoRCAsync(string identificacion) { var usuario = _configurationService.GetValue("registrocivil:CredencialesRCAntiguo:usuarioRC"); var clave = _configurationService.GetValue("registrocivil:CredencialesRCAntiguo:claveRC"); var nombreCiudadano = ""; var response = new ResponsePersonaModel(); WSRegistroCivil.WSRegistroCivilConsultaClient service = new WSRegistroCivil.WSRegistroCivilConsultaClient(); WSRegistroCivil.BusquedaPorCedulaResponse personaRc = await service.BusquedaPorCedulaAsync(identificacion, usuario, clave); //log.CrearLog(OrigenBusqueda.RegistroCivil, [email protected], AccionConsulta.Consulta, con); nombreCiudadano = [email protected]; var strNombres = Helper.TransformarNombres(nombreCiudadano, Helper.NombreOrden.PrimeroApellidos); response.Acta = [email protected]; response.CIConyuge = [email protected]; response.Genero = [email protected]; response.Nombre = [email protected]; response.Cedula = [email protected]; response.CodigoError = [email protected]; response.Error = [email protected]; response.CondicionCedulado = [email protected]; response.Conyuge = [email protected]; response.EstadoCivil = [email protected]; response.FechaCedulacion = [email protected]; response.FechaDefuncion = [email protected]; response.FechaNacimiento = [email protected]; response.FechaMatrimonio = [email protected]; response.Nacionalidad = [email protected]; response.Profesion = [email protected]; response.PrimerNombre = strNombres.PrimerNombre; response.SegundoNombre = strNombres.SegundoNombre; response.PrimerApellido = strNombres.PrimerApellido; response.SegundoApellido = strNombres.SegundoApellido; return(response); }