no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@390 bb69d46d-e84e-40c8-a05a-06db0d633741
Luis Flores 19 years ago
parent 51762b5d60
commit 5a313f3937

@ -490,15 +490,16 @@ public class FichaWindow extends TabbedWindow
} }
byte fo[] = (byte []) exame.get( ExameData.FO ); byte fo[] = (byte []) exame.get( ExameData.FO );
byte pdf[] = (byte []) exame.get( ExameData.PDF ); byte pdf[] = (byte []) exame.get( ExameData.PDF );
TrabalhadorData trabalhadorExame = ( TrabalhadorData ) exame.get( ExameData.TRABALHADOR );
String nomeFicheiro = StringPlainer.convertString( ( String ) trabalhadorExame.get( TrabalhadorData.NOME ) );
nomeFicheiro.replaceAll( " ", "_" );
if( fo != null ) if( fo != null )
{ {
FichaAptidaoCreator.getCreator().print( fo ); FichaAptidaoCreator.getCreator().print( fo );
} }
else else
{ {
TrabalhadorData trabalhadorExame = ( TrabalhadorData ) exame.get( ExameData.TRABALHADOR );
String nomeFicheiro = StringPlainer.convertString( ( String ) trabalhadorExame.get( TrabalhadorData.NOME ) );
nomeFicheiro = nomeFicheiro.replaceAll( " ", "_" );
ePDF.print( pdf, nomeFicheiro ); ePDF.print( pdf, nomeFicheiro );
} }
} }
@ -734,41 +735,39 @@ public class FichaWindow extends TabbedWindow
private void printOld() private void printOld()
{ {
if( trabalhadorID == null ) if( trabalhadorID != null )
{
return;
}
Vector linhas;
try
{ {
IDObject fichas[] = fdpProvider.getAllFichasForTrabalhador( trabalhadorID ); Vector linhas;
linhas = new Vector( Arrays.asList( fichas ) ); try
} {
catch( Exception ex ) IDObject fichas[] = fdpProvider.getAllFichasForTrabalhador( trabalhadorID );
{ linhas = new Vector( Arrays.asList( fichas ) );
DialogException.showExceptionMessage( ex, "Erro a criar lista de Fichas anteriores", true ); }
return; catch( Exception ex )
{
DialogException.showExceptionMessage( ex, "Erro a criar lista de Fichas anteriores", true );
return;
}
ListActionDialog dialog = new ListActionDialog( this, "Imprimir Fichas Anteriores", new String[]{ "Data" },
linhas, this );
dialog.setSize( 250, 200 );
dialog.setVisible( true );
} }
ListActionDialog dialog = new ListActionDialog( this, "Imprimir Fichas Anteriores", new String[]{ "Data" },
linhas, this );
dialog.setSize( 250, 200 );
dialog.setVisible( true );
} }
public boolean executeListAction( int line, Object value ) public boolean executeListAction( int line, Object value )
{ {
if( value == null ) if( value != null )
{
return true;
}
try
{
print( ( ( IDObject )value ).getID() );
}
catch( Exception ex )
{ {
DialogException.showExceptionMessage( ex, "Erro a imprimir Ficha", true ); try
return false; {
print( ( ( IDObject )value ).getID() );
}
catch( Exception ex )
{
DialogException.showExceptionMessage( ex, "Erro a imprimir Ficha", true );
return false;
}
} }
return true; return true;
} }

Loading…
Cancel
Save