|
|
|
@ -11,8 +11,10 @@ import java.awt.event.*;
|
|
|
|
import javax.swing.*;
|
|
|
|
import javax.swing.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.evolute.utils.*;
|
|
|
|
import com.evolute.utils.data.*;
|
|
|
|
import com.evolute.utils.data.*;
|
|
|
|
import com.evolute.utils.dataui.*;
|
|
|
|
import com.evolute.utils.dataui.*;
|
|
|
|
|
|
|
|
import com.evolute.utils.jdo.*;
|
|
|
|
import com.evolute.utils.metadb.*;
|
|
|
|
import com.evolute.utils.metadb.*;
|
|
|
|
import com.evolute.utils.ui.*;
|
|
|
|
import com.evolute.utils.ui.*;
|
|
|
|
|
|
|
|
|
|
|
|
@ -26,6 +28,8 @@ import siprp.data.*;
|
|
|
|
public class UpperPanel extends JPanel
|
|
|
|
public class UpperPanel extends JPanel
|
|
|
|
implements ControllableComponent, ItemListener
|
|
|
|
implements ControllableComponent, ItemListener
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
protected JDOProvider JDO;
|
|
|
|
|
|
|
|
|
|
|
|
protected JFrame owner;
|
|
|
|
protected JFrame owner;
|
|
|
|
private JTextField empresaText;
|
|
|
|
private JTextField empresaText;
|
|
|
|
private JTextField nomeText;
|
|
|
|
private JTextField nomeText;
|
|
|
|
@ -41,6 +45,7 @@ public class UpperPanel extends JPanel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
provider = (FichaDataProvider)FichaDataProvider.getProvider();
|
|
|
|
provider = (FichaDataProvider)FichaDataProvider.getProvider();
|
|
|
|
medicosHash = new Hashtable();
|
|
|
|
medicosHash = new Hashtable();
|
|
|
|
|
|
|
|
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
|
|
|
|
setupComponents();
|
|
|
|
setupComponents();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -122,19 +127,19 @@ public class UpperPanel extends JPanel
|
|
|
|
EmpresaData empresa;
|
|
|
|
EmpresaData empresa;
|
|
|
|
if( trabalhadorID != null )
|
|
|
|
if( trabalhadorID != null )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
trabalhador = ( TrabalhadorData ) TrabalhadorData.load( TrabalhadorData.class, trabalhadorID );
|
|
|
|
trabalhador = ( TrabalhadorData ) JDO.load( TrabalhadorData.class, trabalhadorID );
|
|
|
|
String nome = (String) trabalhador.get( TrabalhadorData.NOME );
|
|
|
|
String nome = (String) trabalhador.get( TrabalhadorData.NOME );
|
|
|
|
nomeText.setText( nome );
|
|
|
|
nomeText.setText( nome );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String nomeEstabelecimento = "";
|
|
|
|
String nomeEstabelecimento = "";
|
|
|
|
if( estabelecimentoID != null )
|
|
|
|
if( estabelecimentoID != null )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
estabelecimento = ( EstabelecimentoData ) EstabelecimentoData.load( EstabelecimentoData.class, estabelecimentoID );
|
|
|
|
estabelecimento = ( EstabelecimentoData ) JDO.load( EstabelecimentoData.class, estabelecimentoID );
|
|
|
|
nomeEstabelecimento = (String) estabelecimento.get( EstabelecimentoData.NOME );
|
|
|
|
nomeEstabelecimento = (String) estabelecimento.get( EstabelecimentoData.NOME );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( empresaID != null )
|
|
|
|
if( empresaID != null )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
empresa = ( EmpresaData ) EmpresaData.load( EmpresaData.class, empresaID );
|
|
|
|
empresa = ( EmpresaData ) JDO.load( EmpresaData.class, empresaID );
|
|
|
|
String nomeEmpresa = (String) empresa.get( EmpresaData.DESIGNACAO_SOCIAL );
|
|
|
|
String nomeEmpresa = (String) empresa.get( EmpresaData.DESIGNACAO_SOCIAL );
|
|
|
|
empresaText.setText( nomeEmpresa + ( nomeEstabelecimento.length() > 0?" / " + nomeEstabelecimento:"" ) );
|
|
|
|
empresaText.setText( nomeEmpresa + ( nomeEstabelecimento.length() > 0?" / " + nomeEstabelecimento:"" ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -152,7 +157,7 @@ public class UpperPanel extends JPanel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MedicoData medico = ( MedicoData )MedicoData.load( MedicoData.class, id );
|
|
|
|
MedicoData medico = ( MedicoData )JDO.load( MedicoData.class, id );
|
|
|
|
return medico;
|
|
|
|
return medico;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( Exception ex )
|
|
|
|
catch( Exception ex )
|
|
|
|
|