Esempio n. 1
0
        public IActionResult UpdateClient([FromBody] Client client, string CPF)
        {
            string actionResult;

            if (_repository.SearchClient(CPF).STATUS == "0")
            {
                return(StatusCode(403, "This account is inactived"));
            }

            actionResult = _repository.UpdateClient(CPF, client);

            if (actionResult == "200")
            {
                NotifyClient(client, "We inform that your account has been sucessfuly updated!");
                return(Ok("Updates sucessfuly applied"));
            }
            else if (actionResult == "404")
            {
                return(StatusCode(404, "Client not found"));
            }
            return(StatusCode(500, "An error occurred"));
        }