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