|
|
|
|
@ -40,8 +40,10 @@ public class RegistarPresencasWindow extends JFrame
|
|
|
|
|
{
|
|
|
|
|
protected JCalendarPanel dataPanel;
|
|
|
|
|
protected JButton carregarButton;
|
|
|
|
|
protected JScrollPane listScroll;
|
|
|
|
|
protected MultipleActionListPanel listPanel;
|
|
|
|
|
protected JScrollPane listECDsScroll;
|
|
|
|
|
protected JScrollPane listConsultasScroll;
|
|
|
|
|
protected MultipleActionListPanel listECDsPanel;
|
|
|
|
|
protected MultipleActionListPanel listConsultasPanel;
|
|
|
|
|
|
|
|
|
|
protected MedicinaDataProvider provider;
|
|
|
|
|
|
|
|
|
|
@ -80,16 +82,28 @@ public class RegistarPresencasWindow extends JFrame
|
|
|
|
|
getContentPane().setLayout( new BorderLayout( 5, 5 ) );
|
|
|
|
|
JPanel upperPanel = new JPanel();
|
|
|
|
|
getContentPane().add( upperPanel, BorderLayout.NORTH );
|
|
|
|
|
JTabbedPane tabbedPane = new JTabbedPane();
|
|
|
|
|
getContentPane().add( tabbedPane, BorderLayout.CENTER );
|
|
|
|
|
|
|
|
|
|
listPanel =
|
|
|
|
|
listECDsPanel =
|
|
|
|
|
new MultipleActionListPanel(
|
|
|
|
|
new PresencasActionFactory[]{ shstDesmarcouFactory, faltouFactory },
|
|
|
|
|
new PresencasActionFactory[]{ realizouFactory, realizouParcialmenteFactory,
|
|
|
|
|
trabalhadorDesmarcouFactory, shstDesmarcouFactory,
|
|
|
|
|
faltouFactory } );
|
|
|
|
|
listScroll = new JScrollPane( listPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
|
|
|
|
|
listECDsScroll = new JScrollPane( listECDsPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
|
|
|
|
|
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
|
|
|
|
|
getContentPane().add( listScroll, BorderLayout.CENTER );
|
|
|
|
|
|
|
|
|
|
listConsultasPanel =
|
|
|
|
|
new MultipleActionListPanel(
|
|
|
|
|
new PresencasActionFactory[]{ shstDesmarcouFactory, faltouFactory },
|
|
|
|
|
new PresencasActionFactory[]{ realizouFactory, trabalhadorDesmarcouFactory,
|
|
|
|
|
shstDesmarcouFactory, faltouFactory } );
|
|
|
|
|
listConsultasScroll = new JScrollPane( listConsultasPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
|
|
|
|
|
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
|
|
|
|
|
|
|
|
|
|
tabbedPane.add( "ECDs", listECDsScroll );
|
|
|
|
|
tabbedPane.add( "Consultas", listConsultasScroll );
|
|
|
|
|
|
|
|
|
|
upperPanel.setLayout( new FlowLayout( FlowLayout.CENTER ) );
|
|
|
|
|
upperPanel.add( dataLabel );
|
|
|
|
|
@ -152,20 +166,35 @@ public class RegistarPresencasWindow extends JFrame
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Date data = dataPanel.getDate();
|
|
|
|
|
Object marcacoesArray[][] = provider.getListaMarcacoesByData( data );
|
|
|
|
|
List<Presenca> marcacoes = new Vector<Presenca>();
|
|
|
|
|
for( int n = 0; n < marcacoesArray.length; n++ )
|
|
|
|
|
Object ecdsArray[][] = provider.getListaECDsByData( data );
|
|
|
|
|
List<Presenca> ecds = new Vector<Presenca>();
|
|
|
|
|
for( int n = 0; n < ecdsArray.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
Integer id = ( Integer ) ecdsArray[ n ][ 0 ];
|
|
|
|
|
String nome = ( String ) ecdsArray[ n ][ 1 ];
|
|
|
|
|
String nomePlain = ( String ) ecdsArray[ n ][ 2 ];
|
|
|
|
|
String empresa = ( String ) ecdsArray[ n ][ 3 ];
|
|
|
|
|
int tipo = ( ( Integer )ecdsArray[ n ][ 4 ] ).intValue();
|
|
|
|
|
ecds.add( new Presenca( id, nome, nomePlain, empresa, tipo ) );
|
|
|
|
|
}
|
|
|
|
|
Collections.sort( ecds );
|
|
|
|
|
listECDsPanel.showList( ecds.toArray( new Presenca[ ecds.size() ] ) );
|
|
|
|
|
listECDsScroll.setViewportView( listECDsPanel );
|
|
|
|
|
|
|
|
|
|
Object consultasArray[][] = provider.getListaConsultasByData( data );
|
|
|
|
|
List<Presenca> consultas = new Vector<Presenca>();
|
|
|
|
|
for( int n = 0; n < consultasArray.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
Integer id = ( Integer ) marcacoesArray[ n ][ 0 ];
|
|
|
|
|
String nome = ( String ) marcacoesArray[ n ][ 1 ];
|
|
|
|
|
String nomePlain = ( String ) marcacoesArray[ n ][ 2 ];
|
|
|
|
|
String empresa = ( String ) marcacoesArray[ n ][ 3 ];
|
|
|
|
|
int tipo = ( ( Integer )marcacoesArray[ n ][ 4 ] ).intValue();
|
|
|
|
|
marcacoes.add( new Presenca( id, nome, nomePlain, empresa, tipo ) );
|
|
|
|
|
Integer id = ( Integer ) consultasArray[ n ][ 0 ];
|
|
|
|
|
String nome = ( String ) consultasArray[ n ][ 1 ];
|
|
|
|
|
String nomePlain = ( String ) consultasArray[ n ][ 2 ];
|
|
|
|
|
String empresa = ( String ) consultasArray[ n ][ 3 ];
|
|
|
|
|
int tipo = ( ( Integer )consultasArray[ n ][ 4 ] ).intValue();
|
|
|
|
|
consultas.add( new Presenca( id, nome, nomePlain, empresa, tipo ) );
|
|
|
|
|
}
|
|
|
|
|
Collections.sort( marcacoes );
|
|
|
|
|
listPanel.showList( marcacoes.toArray( new Presenca[ marcacoes.size() ] ) );
|
|
|
|
|
listScroll.setViewportView( listPanel );
|
|
|
|
|
Collections.sort( consultas );
|
|
|
|
|
listConsultasPanel.showList( consultas.toArray( new Presenca[ ecds.size() ] ) );
|
|
|
|
|
listConsultasScroll.setViewportView( listConsultasPanel );
|
|
|
|
|
// setExtendedState( getExtendedState() | MAXIMIZED_BOTH );
|
|
|
|
|
}
|
|
|
|
|
catch( Exception ex )
|
|
|
|
|
|