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