no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@396 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 19 years ago
parent 98f0434728
commit ba75384ad5

@ -225,6 +225,30 @@ public class ProcessoDataProvider
}
}
public Integer getLastConsultaDataIDForConsulta( Integer consultaID )
throws Exception
{
Select select =
new Select2( new String[]{ "trabalhadores_consultas_datas" },
new Integer[]{},
new Expression[]{},
new String[]{ "MAX( id )" },
new Field( "trabalhadores_consultas_id" ).isEqual( consultaID ),
null,
null,
null,
null );
Virtual2DArray array = EXECUTER.executeQuery( select );
if( array.columnLength() == 0 || array.get( 0, 0 ) == null )
{
return null;
}
else
{
return ( Integer ) array.get( 0, 0 );
}
}
public IDObject getObservacoesECDsData( Integer ecdsDataID )
throws Exception
{
@ -248,4 +272,28 @@ public class ProcessoDataProvider
return new MappableObject( ( Integer ) array.get( 0, 0 ), ( String ) array.get( 0, 1 ) );
}
}
public Integer getLastECDsDataIDForECDs( Integer ecdsID )
throws Exception
{
Select select =
new Select2( new String[]{ "trabalhadores_ecds_datas" },
new Integer[]{},
new Expression[]{},
new String[]{ "MAX( id )" },
new Field( "trabalhadores_ecds_id" ).isEqual( ecdsID ),
null,
null,
null,
null );
Virtual2DArray array = EXECUTER.executeQuery( select );
if( array.columnLength() == 0 || array.get( 0, 0 ) == null )
{
return null;
}
else
{
return ( Integer ) array.get( 0, 0 );
}
}
}

@ -9,17 +9,22 @@
package siprp.medicina.processo.detalhes;
import com.evolute.utils.Singleton;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.ui.DialogException;
import com.evolute.utils.ui.calendar.JCalendarPanel;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Date;
import java.util.Vector;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import siprp.medicina.MedicinaConstants;
import siprp.medicina.processo.ProcessoListener;
import siprp.medicina.processo.data.TrabalhadoresConsultasData;
/**
*
@ -33,15 +38,19 @@ public class ConsultaPanel extends JPanel
protected JButton estadoButton;
protected JButton emailButton;
protected JButton observacoesButton;
protected ObservacoesDialog observacoesDialog;
private final Vector<ProcessoListener> PROCESSO_LISTENERS = new Vector<ProcessoListener>();
protected final Vector<ProcessoListener> PROCESSO_LISTENERS = new Vector<ProcessoListener>();
protected JDOProvider JDO;
protected TrabalhadoresConsultasData consulta;
protected Integer trabalhadorID;
/** Creates a new instance of ConsultaPanel */
public ConsultaPanel( JFrame owner )
{
this.owner = owner;
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
setupComponents();
}
@ -92,7 +101,6 @@ public class ConsultaPanel extends JPanel
{
observacoesDialog = new ObservacoesDialog( owner );
}
}
public void addProcessoListener( ProcessoListener listener )
@ -104,4 +112,44 @@ public class ConsultaPanel extends JPanel
{
PROCESSO_LISTENERS.remove( listener );
}
public void clear()
{
dataConsultaPanel.setDate( null );
estadoButton.setText( " " );
}
public void fill( Object value )
{
clear();
if( value != null )
{
try
{
consulta = ( TrabalhadoresConsultasData ) JDO.load( TrabalhadoresConsultasData.class, ( Integer ) value );
Date data = ( Date ) consulta.get( TrabalhadoresConsultasData.DATA );
Integer estado = ( Integer ) consulta.get( TrabalhadoresConsultasData.ESTADO );
dataConsultaPanel.setDate( data );
if( estado != null )
{
estadoButton.setText( ESTADOS_CONSULTA_STR[ estado.intValue() ] );
}
else
{
estadoButton.setText( " " );
}
}
catch( Exception ex )
{
DialogException.showExceptionMessage( ex, "Erro a carregar dados da consulta", true );
}
}
}
public void setTrabalhadorID( Integer trabalhadorID )
{
this.trabalhadorID = trabalhadorID;
}
}

@ -25,7 +25,7 @@ public class DetalhesProcessoPanel extends JPanel
private static final String CARD_BLANK = "";
private static final String CARD_CONSULTA = "CONSULTA";
private static final String CARD_ECD = "ECD";
private static final String CARD_ECDS = "ECDS";
protected JFrame owner;
@ -54,7 +54,7 @@ public class DetalhesProcessoPanel extends JPanel
setLayout( cardLayout );
add( blankPanel, CARD_BLANK );
add( consultaPanel, CARD_CONSULTA );
add( ecdsPanel, CARD_ECD );
add( ecdsPanel, CARD_ECDS );
}
public void addProcessoListener( ProcessoListener listener )
@ -75,4 +75,15 @@ public class DetalhesProcessoPanel extends JPanel
{
cardLayout.first( this );
}
public void setConsulta( Integer consultaID )
{
cardLayout.show( this, CARD_CONSULTA );
consultaPanel.fill( consultaID );
}
public void setECDs( Integer ecdsID )
{
cardLayout.show( this, CARD_ECDS );
}
}

Loading…
Cancel
Save