public string ResivirData(UsuarioRequest request)
        {
            string _operation = String.Empty;
            string respose    = String.Empty;

            _conectorNegocio = new NegocioObtenerDatos();
            try
            {
                if (ModelState.IsValid)
                {
                    _conectorNegocio.MandarDatosUsuario(request, _operation);
                }
                else
                {
                }
            }
            catch (Exception)
            {
            }
            return(respose);
        }
        public string ResivirData(UsuarioRequest request)
        {
            GenericResponse _resonse   = new GenericResponse();
            string          _operation = String.Empty;
            string          respose    = String.Empty;

            _conectorNegocio = new NegocioObtenerDatos();
            try
            {
                if (ModelState.IsValid)
                {
                    _conectorNegocio.MandarDatosUsuario(request, _operation);
                }
                else
                {
                }
            }
            catch (Exception)
            {
            }
            return(JsonConvert.SerializeObject(_resonse));
        }
Ejemplo n.º 3
0
        public string ResivirData(UsuarioRequest request)
        {
            GenericResponse _resonse = new GenericResponse();

            _operation       = GerenteOperacion.GenerarOperacion();
            _conectorNegocio = new NegocioObtenerDatos();
            bool estado = false;

            try
            {
                Informacion.LogInformacion(LogManager.GetCurrentClassLogger(), " [ " + GerenteLog.GetObtenerMetodo() + " ] -- [ " + _operation + " ] REQUEST: " + GerenteJson.SerializeObject(request));
                if (ModelState.IsValid)
                {
                    _resonse = _conectorNegocio.VerificarCanal(request.Canal, request.PassCanal, _operation, ref estado);
                    if (!estado)
                    {
                        return(GerenteJson.SerializeObject(_resonse));
                    }
                    _resonse = _conectorNegocio.MandarDatosUsuario(request, _operation);
                    Informacion.LogInformacion(LogManager.GetCurrentClassLogger(), " [ " + GerenteLog.GetObtenerMetodo() + " ] -- [ " + _operation + " ] RESPONSE: " + GerenteJson.SerializeObject(_resonse));
                }
                else
                {
                    var errors = string.Join(" | ", ModelState.Values
                                             .SelectMany(v => v.Errors)
                                             .Select(e => e.ErrorMessage));
                    _resonse.mensaje = Convert.ToString(errors);
                    return(GerenteJson.SerializeObject(_resonse));
                }
            }
            catch (Exception ex)
            {
                Informacion.LogError(LogManager.GetCurrentClassLogger(), " [ " + GerenteLog.GetObtenerMetodo() + " ] -- [ " + _operation + " ]. Se genero un error en Recibir los datos.", ex);
            }
            return(JsonConvert.SerializeObject(_resonse));
        }