Example #1
0
 public function excluirUsuario()
 {
     try {
         if (empty($_POST['id'])) {
             throw new \Exception("Selecione um usuário.");
         }
         $usuario = new Usuario();
         $usuario->id = $_POST['id'];
         $this->fachada->excluirUsuario($usuario);
         echo new JSONResponse(true, self::MSG_OPERACAO_SUCESSO);
     } catch (\Exception $e) {
         echo new JSONResponse(false, $e->getMessage());
     }
 }