no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@32 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 22 years ago
parent 7737602509
commit 5724ac65c3

@ -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

@ -159,6 +159,10 @@ public class UpperPanel extends JPanel
ex.printStackTrace();
}
}
else
{
throw new ValuesException( "A ficha tem de ter um m\u00e9dico associado" );
}
return null;
}

Loading…
Cancel
Save