|  |  | @ -140,6 +140,22 @@ public class FichaWindow extends TabbedWindow | 
			
		
	
		
		
			
				
					
					|  |  |  | 						"Imprimir Fichas Anteriores", null, |  |  |  | 						"Imprimir Fichas Anteriores", null, | 
			
		
	
		
		
			
				
					
					|  |  |  | 						0, false ); |  |  |  | 						0, false ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 						 |  |  |  | 						 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		registerAction( new ActionHandler(){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 							public void execute() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 							{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 								deleteOld(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 							} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 							 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 							public boolean activate( boolean newAction, boolean editAction,  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 														boolean cancelAction, boolean saveAction, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 														boolean deleteAction, boolean selectAction ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 							{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 								return saveAction || editAction; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 							} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 						}, "Apagar Fichas Anteriores",  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 						"Apagar Fichas Anteriores", null, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 						0, false ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 						 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		registerAction( new ActionHandler(){ |  |  |  | 		registerAction( new ActionHandler(){ | 
			
		
	
		
		
			
				
					
					|  |  |  | 							public void execute() |  |  |  | 							public void execute() | 
			
		
	
		
		
			
				
					
					|  |  |  | 							{ |  |  |  | 							{ | 
			
		
	
	
		
		
			
				
					|  |  | @ -347,6 +363,53 @@ public class FichaWindow extends TabbedWindow | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return true; |  |  |  | 		return true; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	public void deleteOld() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		if( trabalhadorID == null ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			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, "Apagar Fichas Anteriores", new String[]{ "Data" }, linhas,  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 							new ListAction(){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 								public String getListActionName() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 								{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									return "Apagar"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 								} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 								 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 								public boolean executeListAction( int line, Object value ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 								{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									if( value == null ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 										return true; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									try | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 										delete( ( ( IDObject )value ).getID() ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									catch( Exception ex ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 										DialogException.showExceptionMessage( ex, "Erro a Apagar Ficha", true ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 										return false; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 									return true; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 								}	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 							} ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		dialog.setSize( 250, 200 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		dialog.show(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public void reload( int index ) |  |  |  | 	public void reload( int index ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Integer upperData[] = new Integer[]{ empresaID, estabelecimentoID, trabalhadorID }; |  |  |  | 		Integer upperData[] = new Integer[]{ empresaID, estabelecimentoID, trabalhadorID }; | 
			
		
	
	
		
		
			
				
					|  |  | @ -524,13 +587,17 @@ public class FichaWindow extends TabbedWindow | 
			
		
	
		
		
			
				
					
					|  |  |  | 					case 6: |  |  |  | 					case 6: | 
			
		
	
		
		
			
				
					
					|  |  |  | 						ht.put( "tipo_trabalho", "" ); |  |  |  | 						ht.put( "tipo_trabalho", "" ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 						break; |  |  |  | 						break; | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 					case 10: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				break; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 			case 4: |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 						aux = (String)exame.getProperty( fdpProvider.OUTRO_TIPO ); |  |  |  | 						aux = (String)exame.getProperty( fdpProvider.OUTRO_TIPO ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 						ht.put( "tipo_outro", aux != null ? aux : "" ); |  |  |  | 						ht.put( "tipo_outro", aux != null ? aux : "" ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 						break; |  |  |  | 						break; | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				break; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //			case 4:
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //				aux = (String)exame.getProperty( fdpProvider.OUTRO_TIPO );
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //				ht.put( "tipo_outro", aux != null ? aux : "" );
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //				break;
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		tipo = (Integer)exame.getProperty( fdpProvider.RESULTADO ); |  |  |  | 		tipo = (Integer)exame.getProperty( fdpProvider.RESULTADO ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		switch( tipo.intValue() ) |  |  |  | 		switch( tipo.intValue() ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
	
		
		
			
				
					|  |  | @ -646,4 +713,21 @@ public class FichaWindow extends TabbedWindow | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return "Imprimir"; |  |  |  | 		return "Imprimir"; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	private void delete( Integer exameID ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		throws Exception | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		MetaObject exame = fdpProvider.load( fdpProvider.EXAMES, new DBKey( exameID ) ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		if( exame == null ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			throw new Exception( "N\u00e3o existe exame" ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		if( JOptionPane.showConfirmDialog( this,  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			"Tem a certeza que quer apagar o exame de " + exame.getProperty( fdpProvider.DATA ) + "?", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			"...", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null ) == 0 ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			exame.setProperty( fdpProvider.INACTIVO, "y" ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			exame.save(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |