<?php

class FakeData extends TPage
{
    public function __construct($param)
    {
        parent::__construct();
    }
    
    public function onShow($param = null)
    {
        try
        {
            TTransaction::open('clinica');
            
            FakeDataService::generate();
            
            TTransaction::close();
            
            new TMessage('info', 'Dados gerados com sucesso!');
        }
        catch (Exception $e)
        {
            new TMessage('error', $e->getMessage());
            TTransaction::rollback();
        }    
    }
}
