Example #1
0
        public ActionResult Atualizar(int id, [FromBody] ContaModel dados)
        {
            ReturnAllServices retorno = new ReturnAllServices();

            try
            {
                if (AutenticacaoServico.Autenticar())
                {
                    dados.Id = id;
                    dados.Atualizar();
                    retorno.Result       = true;
                    retorno.ErrorMessage = string.Empty;
                    return(new OkObjectResult(retorno));
                }
                else
                {
                    return(new ForbidResult());
                }
            }
            catch (Exception ex)
            {
                retorno.Result       = false;
                retorno.ErrorMessage = "Erro ao tentar atualizar um cliente: " + ex.Message;
                return(StatusCode(500, retorno));
            }
        }