|
|
|
|
@ -34,7 +34,7 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
|
private Integer trabalhadorID;
|
|
|
|
|
|
|
|
|
|
private static int permissions[][] =
|
|
|
|
|
new int[][]{ { NEW_INDEX, CANCEL_INDEX, SAVE_INDEX, DELETE_INDEX } };
|
|
|
|
|
new int[][]{ { NEW_INDEX, CANCEL_INDEX, SAVE_INDEX } };
|
|
|
|
|
|
|
|
|
|
/** Creates a new instance of FichaWindow */
|
|
|
|
|
public FichaWindow()
|
|
|
|
|
@ -111,6 +111,16 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
StringBuffer msg = new StringBuffer();
|
|
|
|
|
MetaObject medico;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
medico = (MetaObject)upperPanel.save();
|
|
|
|
|
}
|
|
|
|
|
catch( ValuesException vex )
|
|
|
|
|
{
|
|
|
|
|
msg.append( vex.getMessage() );
|
|
|
|
|
medico = null;
|
|
|
|
|
}
|
|
|
|
|
MetaObject estabelecimento;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
@ -141,23 +151,14 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
|
msg.append( vex.getMessage() );
|
|
|
|
|
exame = null;
|
|
|
|
|
}
|
|
|
|
|
if( estabelecimento == null || trabalhador == null || exame == null )
|
|
|
|
|
if( estabelecimento == null || trabalhador == null || exame == null || medico == null )
|
|
|
|
|
{
|
|
|
|
|
JOptionPane.showMessageDialog( this, msg.toString(), "Erro...", JOptionPane.ERROR_MESSAGE );
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
trabalhador.setProperty( fdpProvider.R_TRABALHADOR_ESTABELECIMENTO, estabelecimento );
|
|
|
|
|
trabalhador.setProperty( fdpProvider.OBSERVACOES, observacoesPanel.save() );
|
|
|
|
|
MetaObject medico;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
medico = fdpProvider.load( fdpProvider.MEDICOS, new DBKey( new Integer(1) ) );
|
|
|
|
|
}
|
|
|
|
|
catch( Exception ex )
|
|
|
|
|
{
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exame.setProperty( fdpProvider.R_EXAME_MEDICO, medico );
|
|
|
|
|
exame.setProperty( fdpProvider.R_EXAME_TRABALHADOR, trabalhador );
|
|
|
|
|
try
|
|
|
|
|
|