Exemple #1
0
        public IHttpActionResult PedirTrocarSenha(string userID, string reCaptchaResponse)
        {
            if (!_reCaptchaService.ResponseIsCorrect(reCaptchaResponse))
            {
                return(BadRequest(((int)ReCaptchaService.RESPONSE.INVALID).ToString()));
            }

            if (_accountService.PedirTrocarSenha(userID))
            {
                return(Ok());
            }

            return(BadRequest());
        }
Exemple #2
0
        public IHttpActionResult EditaUsuario(ReCaptchaParam <UsuarioModel> recaptchaParam)
        {
            UsuarioModel usuario = recaptchaParam.param;

            if (!_reCaptchaService.ResponseIsCorrect(recaptchaParam.reCaptchaResponse))
            {
                return(BadRequest(((int)ReCaptchaService.RESPONSE.INVALID).ToString()));
            }

            int ID = _usuarioService.EditaUsuario(usuario, GetUsuarioID(), UsuarioEhAdmin());

            if (ID > 0)
            {
                return(Ok(ID));
            }

            return(BadRequest((-ID).ToString()));
        }
Exemple #3
0
        public IHttpActionResult SalvarAnuncio(ReCaptchaParam <VagaModel> recaptchaParam)
        {
            VagaModel vaga = recaptchaParam.param;

            if (!_reCaptchaService.ResponseIsCorrect(recaptchaParam.reCaptchaResponse))
            {
                return(BadRequest(((int)ReCaptchaService.RESPONSE.INVALID).ToString()));
            }

            int ID = _vagasService.SalvarAnuncio(vaga, GetUsuarioID(), UsuarioEhAdmin());

            if (ID > 0)
            {
                return(Ok(ID));
            }

            return(BadRequest((-ID).ToString()));
        }