Ejemplo n.º 1
0
        public string ModificarData(UpdateUsuarioRequest request)
        {
            _operation       = GerenteOperacion.GenerarOperacion();
            _conectorNegocio = new NegocioObtenerDatos();
            GenericResponse _response = new GenericResponse();
            bool            estado    = false;

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

            _conectorNegocio = new NegocioObtenerDatos();
            try
            {
                if (ModelState.IsValid)
                {
                    _conectorNegocio.ModificarDatosUsuario(request, _operation);
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
            }
            return(_response);
        }
        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));
        }