|
|
|
|
@ -267,32 +267,32 @@ public class ExamePanel extends JPanel
|
|
|
|
|
public void fill( Object value )
|
|
|
|
|
{
|
|
|
|
|
clear();
|
|
|
|
|
Integer trabID = (Integer) value;
|
|
|
|
|
if( trabID == null )
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Integer id = provider.getLastExameIDForTrabalhador( trabID );
|
|
|
|
|
if( id == null )
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
MetaObject exame = provider.load( provider.EXAMES, new DBKey( id ) );
|
|
|
|
|
byte pdf[] = (byte []) exame.getProperty( provider.PDF );
|
|
|
|
|
if( pdf != null )
|
|
|
|
|
{
|
|
|
|
|
FileOutputStream fos = new FileOutputStream( "C:\\teste.pdf" );
|
|
|
|
|
fos.write( pdf );
|
|
|
|
|
fos.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch( Exception ex )
|
|
|
|
|
{
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// Integer trabID = (Integer) value;
|
|
|
|
|
// if( trabID == null )
|
|
|
|
|
// {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// try
|
|
|
|
|
// {
|
|
|
|
|
// Integer id = provider.getLastExameIDForTrabalhador( trabID );
|
|
|
|
|
// if( id == null )
|
|
|
|
|
// {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// MetaObject exame = provider.load( provider.EXAMES, new DBKey( id ) );
|
|
|
|
|
// byte pdf[] = (byte []) exame.getProperty( provider.PDF );
|
|
|
|
|
// if( pdf != null )
|
|
|
|
|
// {
|
|
|
|
|
// FileOutputStream fos = new FileOutputStream( "C:\\teste.pdf" );
|
|
|
|
|
// fos.write( pdf );
|
|
|
|
|
// fos.close();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// catch( Exception ex )
|
|
|
|
|
// {
|
|
|
|
|
// ex.printStackTrace();
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Object save()
|
|
|
|
|
|