From 5a313f39379300062ece34e379cd40a0b68e86f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Flores?= Date: Tue, 15 May 2007 16:28:43 +0000 Subject: [PATCH] no message git-svn-id: https://svn.coded.pt/svn/SIPRP@390 bb69d46d-e84e-40c8-a05a-06db0d633741 --- trunk/siprp/ficha/FichaWindow.java | 61 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/trunk/siprp/ficha/FichaWindow.java b/trunk/siprp/ficha/FichaWindow.java index 1df56deb..f3d40105 100644 --- a/trunk/siprp/ficha/FichaWindow.java +++ b/trunk/siprp/ficha/FichaWindow.java @@ -490,15 +490,16 @@ public class FichaWindow extends TabbedWindow } byte fo[] = (byte []) exame.get( ExameData.FO ); 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 ) { FichaAptidaoCreator.getCreator().print( fo ); } else { + TrabalhadorData trabalhadorExame = ( TrabalhadorData ) exame.get( ExameData.TRABALHADOR ); + String nomeFicheiro = StringPlainer.convertString( ( String ) trabalhadorExame.get( TrabalhadorData.NOME ) ); + nomeFicheiro = nomeFicheiro.replaceAll( " ", "_" ); ePDF.print( pdf, nomeFicheiro ); } } @@ -734,41 +735,39 @@ public class FichaWindow extends TabbedWindow private void printOld() { - if( trabalhadorID == null ) - { - return; - } - Vector linhas; - try + if( trabalhadorID != null ) { - IDObject fichas[] = fdpProvider.getAllFichasForTrabalhador( trabalhadorID ); - linhas = new Vector( Arrays.asList( fichas ) ); - } - catch( Exception ex ) - { - DialogException.showExceptionMessage( ex, "Erro a criar lista de Fichas anteriores", true ); - return; + Vector linhas; + try + { + IDObject fichas[] = fdpProvider.getAllFichasForTrabalhador( trabalhadorID ); + linhas = new Vector( Arrays.asList( fichas ) ); + } + 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 ) { - if( value == null ) - { - return true; - } - try - { - print( ( ( IDObject )value ).getID() ); - } - catch( Exception ex ) + if( value != null ) { - DialogException.showExceptionMessage( ex, "Erro a imprimir Ficha", true ); - return false; + try + { + print( ( ( IDObject )value ).getID() ); + } + catch( Exception ex ) + { + DialogException.showExceptionMessage( ex, "Erro a imprimir Ficha", true ); + return false; + } } return true; }