예제 #1
0
        $idBairro = $_GET['idBairro'];
    }
}
switch ($action) {
    case 'incluir':
        $conBairro->insert($bairro);
        ?>
 
        <script>
            alert("O bairro foi incluido com sucesso.");
            window.location.href = '../../view/bairro.php'
        </script>
        <?php 
        break;
    case 'delete':
        $retorno = $conBairro->delete($idBairro);
        if ($retorno == 1) {
            ?>
 
            <script>
                alert("O bairro foi excluido com sucesso.");
                window.location.href = '../../view/bairro.php'
            </script>
        <?php 
        } else {
            ?>
 
            <script>
                alert("Erro ao excluir bairro, Informe linha 55.");
                window.location.href = '../../view/bairro.php'
            </script>
예제 #2
0
 /**
  * method Delete()
  * Delete a record
  */
 function Delete($param)
 {
     try {
         // get the parameter $key
         $key = $param['key'];
         // open a transaction with database 'permission'
         TTransaction::open('liger');
         // instantiates object SystemProgram
         $object = new Bairro($key);
         // deletes the object from the database
         $object->delete();
         // close the transaction
         TTransaction::close();
         // reload the listing
         $this->onReload($param);
         // shows the success message
         new TMessage('info', TAdiantiCoreTranslator::translate('Record deleted'));
     } catch (Exception $e) {
         // shows the exception error message
         new TMessage('error', '<b>Error</b> ' . $e->getMessage());
         // undo all pending operations
         TTransaction::rollback();
     }
 }