/** * method Delete() * Delete a record */ function Delete($param) { try { // get the parameter $key $key = $param['key']; TTransaction::open('atividade'); // open the transaction $object = new Sistema($key, FALSE); // instantiates the Active Record $object->delete(); // deletes the object TTransaction::close(); // close the transaction $this->onReload($param); // reload the listing new TMessage('info', TAdiantiCoreTranslator::translate('Record deleted')); // success message } catch (Exception $e) { new TMessage('error', '<b>Error</b> ' . $e->getMessage()); // shows the exception error message TTransaction::rollback(); // undo all pending operations } }