git-svn-id: https://svn.coded.pt/svn/SIPRP@885 bb69d46d-e84e-40c8-a05a-06db0d633741

lxbfYeaa
Tiago Simão 17 years ago
parent fb6074bb85
commit 672ab008b8

@ -2,7 +2,6 @@ package siprp.higiene.gestao.equipamentos;
import static com.evolute.utils.strings.UnicodeLatin1Map.atilde; import static com.evolute.utils.strings.UnicodeLatin1Map.atilde;
import static com.evolute.utils.strings.UnicodeLatin1Map.ccedil; import static com.evolute.utils.strings.UnicodeLatin1Map.ccedil;
import static com.evolute.utils.strings.UnicodeLatin1Map.eacute;
import info.clearthought.layout.TableLayout; import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints; import info.clearthought.layout.TableLayoutConstraints;
@ -21,6 +20,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import leaf.ui.LeafIconButton; import leaf.ui.LeafIconButton;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.HsEquipamentoMedico; import siprp.database.cayenne.objects.HsEquipamentoMedico;
@ -73,10 +73,11 @@ public class AdicionarEquipamentosPanel extends JPanel
private void setupLayout() private void setupLayout()
{ {
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.MINIMUM, TableLayout.FILL }, TableLayout.MINIMUM, TableLayout.FILL
new double[]{ TableLayout.FILL } }, new double[] {
); TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
setLayout( layout ); setLayout( layout );
@ -85,10 +86,11 @@ public class AdicionarEquipamentosPanel extends JPanel
private void placeComponents() private void placeComponents()
{ {
JPanel panel = new JPanel(); JPanel panel = new JPanel();
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.MINIMUM }, TableLayout.MINIMUM
new double[]{ TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL } }, new double[] {
); TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
panel.setLayout( layout ); panel.setLayout( layout );
@ -101,7 +103,8 @@ public class AdicionarEquipamentosPanel extends JPanel
private void startupListeners() private void startupListeners()
{ {
tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener(){ tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener()
{
@Override @Override
public void valueChanged( TreeSelectionEvent e ) public void valueChanged( TreeSelectionEvent e )
{ {
@ -131,6 +134,8 @@ public class AdicionarEquipamentosPanel extends JPanel
} }
private void add() private void add()
{
try
{ {
if( relatorio != null ) if( relatorio != null )
{ {
@ -147,9 +152,15 @@ public class AdicionarEquipamentosPanel extends JPanel
refresh(); refresh();
} }
} }
} catch( Exception e )
{
e.printStackTrace();
}
} }
private void rem() private void rem()
{
try
{ {
TreePath path = tree.getSelectionPath(); TreePath path = tree.getSelectionPath();
if( path != null ) if( path != null )
@ -162,6 +173,10 @@ public class AdicionarEquipamentosPanel extends JPanel
} }
} }
refresh(); refresh();
} catch( Exception e )
{
LeafError.error(e);
}
} }
private void setEnabled() private void setEnabled()
@ -184,12 +199,10 @@ public class AdicionarEquipamentosPanel extends JPanel
TreeTools.refreshTree( tree, root ); TreeTools.refreshTree( tree, root );
} }
public void setRelatorio( HsRelatorio relatorio ) public void setRelatorio( HsRelatorio relatorio )
{ {
this.relatorio = relatorio; this.relatorio = relatorio;
refresh(); refresh();
} }
} }

@ -28,6 +28,7 @@ import javax.swing.tree.TreeSelectionModel;
import leaf.data.Validator; import leaf.data.Validator;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import leaf.ui.LeafTextAreaEditor; import leaf.ui.LeafTextAreaEditor;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.HsLegislacao; import siprp.database.cayenne.objects.HsLegislacao;
@ -153,7 +154,6 @@ public class GerirLegislacaoPanel extends JPanel
private void placeComponents() private void placeComponents()
{ {
panelButtonsGeral.add( buttonGeralCriar ); panelButtonsGeral.add( buttonGeralCriar );
panelButtonsGeral.add( buttonGeralRemover ); panelButtonsGeral.add( buttonGeralRemover );
@ -244,6 +244,8 @@ public class GerirLegislacaoPanel extends JPanel
{ {
@Override @Override
public void propertyChange( PropertyChangeEvent evt ) public void propertyChange( PropertyChangeEvent evt )
{
try
{ {
String newValue = (String) evt.getNewValue(); String newValue = (String) evt.getNewValue();
if( selectedLegislacaoEspecifica != null ) if( selectedLegislacaoEspecifica != null )
@ -257,6 +259,10 @@ public class GerirLegislacaoPanel extends JPanel
selectedLegislacaoGeral.save(); selectedLegislacaoGeral.save();
} }
reload(); reload();
} catch( Exception e )
{
LeafError.error( e );
}
} }
} ); } );
buttonCategoriaCriar.addActionListener( new ActionListener() buttonCategoriaCriar.addActionListener( new ActionListener()
@ -318,6 +324,8 @@ public class GerirLegislacaoPanel extends JPanel
} }
private void criarCategoria() private void criarCategoria()
{
try
{ {
String categoriaString = JOptionPane.showInputDialog( this, "Nova categoria", "" ); String categoriaString = JOptionPane.showInputDialog( this, "Nova categoria", "" );
if( categoriaString != null ) if( categoriaString != null )
@ -327,9 +335,15 @@ public class GerirLegislacaoPanel extends JPanel
novaCategoria.save(); novaCategoria.save();
reload(); reload();
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void editarCategoria() private void editarCategoria()
{
try
{ {
if( selectedCategoria != null ) if( selectedCategoria != null )
{ {
@ -341,6 +355,10 @@ public class GerirLegislacaoPanel extends JPanel
reload(); reload();
} }
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void removerCategoria() private void removerCategoria()
@ -352,6 +370,8 @@ public class GerirLegislacaoPanel extends JPanel
} }
private void criarCategoriaLegislacao() private void criarCategoriaLegislacao()
{
try
{ {
if( selectedCategoria != null ) if( selectedCategoria != null )
{ {
@ -361,9 +381,15 @@ public class GerirLegislacaoPanel extends JPanel
novaLegislacao.save(); novaLegislacao.save();
reload(); reload();
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void removerCategoriaLegislacao() private void removerCategoriaLegislacao()
{
try
{ {
if( selectedLegislacaoEspecifica != null ) if( selectedLegislacaoEspecifica != null )
{ {
@ -371,9 +397,15 @@ public class GerirLegislacaoPanel extends JPanel
selectedLegislacaoEspecifica.save(); selectedLegislacaoEspecifica.save();
reload(); reload();
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void removerGeral() private void removerGeral()
{
try
{ {
if( selectedLegislacaoGeral != null ) if( selectedLegislacaoGeral != null )
{ {
@ -381,14 +413,24 @@ public class GerirLegislacaoPanel extends JPanel
selectedLegislacaoGeral.save(); selectedLegislacaoGeral.save();
reload(); reload();
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void criarGeral() private void criarGeral()
{
try
{ {
HsLegislacao legislacao = new HsLegislacao(); HsLegislacao legislacao = new HsLegislacao();
legislacao.setDescription( "" ); legislacao.setDescription( "" );
legislacao.save(); legislacao.save();
reload(); reload();
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void reload() private void reload()

@ -17,6 +17,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import leaf.ui.TreeInserterDialog; import leaf.ui.TreeInserterDialog;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.Estabelecimentos; import siprp.database.cayenne.objects.Estabelecimentos;
@ -65,10 +66,11 @@ public class AdicionarAreasPanel extends JPanel
private void setupLayout() private void setupLayout()
{ {
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.FILL }, TableLayout.FILL
new double[]{ TableLayout.MINIMUM, TableLayout.FILL } }, new double[] {
); TableLayout.MINIMUM, TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
setLayout( layout ); setLayout( layout );
@ -77,10 +79,11 @@ public class AdicionarAreasPanel extends JPanel
private void placeComponents() private void placeComponents()
{ {
JPanel panel = new JPanel(); JPanel panel = new JPanel();
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM }, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM
new double[]{ TableLayout.MINIMUM } }, new double[] {
); TableLayout.MINIMUM
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
panel.setLayout( layout ); panel.setLayout( layout );
@ -93,7 +96,8 @@ public class AdicionarAreasPanel extends JPanel
private void startupListeners() private void startupListeners()
{ {
tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener(){ tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener()
{
@Override @Override
public void valueChanged( TreeSelectionEvent e ) public void valueChanged( TreeSelectionEvent e )
{ {
@ -132,6 +136,8 @@ public class AdicionarAreasPanel extends JPanel
} }
private void save( DefaultMutableTreeNode toadd ) private void save( DefaultMutableTreeNode toadd )
{
try
{ {
Object obj = toadd.getUserObject(); Object obj = toadd.getUserObject();
if( obj instanceof HsPosto ) if( obj instanceof HsPosto )
@ -148,6 +154,10 @@ public class AdicionarAreasPanel extends JPanel
save( (DefaultMutableTreeNode) toadd.getChildAt( i ) ); save( (DefaultMutableTreeNode) toadd.getChildAt( i ) );
} }
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void rem() private void rem()
@ -174,6 +184,8 @@ public class AdicionarAreasPanel extends JPanel
} }
private void remPosto( HsPosto posto ) private void remPosto( HsPosto posto )
{
try
{ {
HsPostoEstabelecimento toDelete = null; HsPostoEstabelecimento toDelete = null;
for( HsPostoEstabelecimento rel : posto.getHsPostoEstabelecimentoArray() ) for( HsPostoEstabelecimento rel : posto.getHsPostoEstabelecimentoArray() )
@ -189,6 +201,11 @@ public class AdicionarAreasPanel extends JPanel
toDelete.delete(); toDelete.delete();
} }
} }
catch( Exception e )
{
LeafError.error( e );
}
}
private void setEnabled() private void setEnabled()
{ {
@ -207,7 +224,6 @@ public class AdicionarAreasPanel extends JPanel
TreeTools.refreshTree( tree, root ); TreeTools.refreshTree( tree, root );
} }
public void setEstabelecimento( Estabelecimentos estabelecimento ) public void setEstabelecimento( Estabelecimentos estabelecimento )
{ {
this.estabelecimento = estabelecimento; this.estabelecimento = estabelecimento;

@ -26,6 +26,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.Empresas; import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.HsArea; import siprp.database.cayenne.objects.HsArea;
@ -170,6 +171,8 @@ public class GerirAreasPanel extends JPanel
} }
private void criarArea() private void criarArea()
{
try
{ {
if( empresa != null ) if( empresa != null )
{ {
@ -183,9 +186,15 @@ public class GerirAreasPanel extends JPanel
refresh(); refresh();
} }
} }
} catch( Exception e )
{
LeafError.error(e);
}
} }
private void removerArea() private void removerArea()
{
try
{ {
HsArea area = getSelectedArea(); HsArea area = getSelectedArea();
if( area != null ) if( area != null )
@ -193,9 +202,15 @@ public class GerirAreasPanel extends JPanel
area.delete(); area.delete();
refresh(); refresh();
} }
} catch( Exception e )
{
LeafError.error(e);
}
} }
private void criarPosto() private void criarPosto()
{
try
{ {
HsArea area = getSelectedArea(); HsArea area = getSelectedArea();
if( area != null ) if( area != null )
@ -211,9 +226,15 @@ public class GerirAreasPanel extends JPanel
} }
refresh(); refresh();
} }
} catch( Exception e )
{
LeafError.error(e);
}
} }
private void removerPosto() private void removerPosto()
{
try
{ {
HsPosto posto = getSelectedPosto(); HsPosto posto = getSelectedPosto();
if( posto != null ) if( posto != null )
@ -222,6 +243,10 @@ public class GerirAreasPanel extends JPanel
posto.save(); posto.save();
refresh(); refresh();
} }
} catch( Exception e )
{
LeafError.error(e);
}
} }
private HsArea getSelectedArea() private HsArea getSelectedArea()

@ -17,13 +17,13 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import leaf.ui.TreeInserterDialog; import leaf.ui.TreeInserterDialog;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.BaseObject; import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.Empresas; import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.HsPosto; import siprp.database.cayenne.objects.HsPosto;
import siprp.database.cayenne.objects.HsPostoRisco; import siprp.database.cayenne.objects.HsPostoRisco;
import siprp.database.cayenne.objects.HsRelatorioPosto;
import siprp.database.cayenne.objects.HsRisco; import siprp.database.cayenne.objects.HsRisco;
import siprp.database.cayenne.objects.HsRiscoEmpresa; import siprp.database.cayenne.objects.HsRiscoEmpresa;
import siprp.logic.HigieneSegurancaLogic; import siprp.logic.HigieneSegurancaLogic;
@ -70,10 +70,11 @@ public class AdicionarRiscosPanel extends JPanel
private void setupLayout() private void setupLayout()
{ {
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.FILL }, TableLayout.FILL
new double[]{ TableLayout.MINIMUM, TableLayout.FILL } }, new double[] {
); TableLayout.MINIMUM, TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
setLayout( layout ); setLayout( layout );
@ -82,10 +83,11 @@ public class AdicionarRiscosPanel extends JPanel
private void placeComponents() private void placeComponents()
{ {
JPanel panel = new JPanel(); JPanel panel = new JPanel();
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM }, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM
new double[]{ TableLayout.MINIMUM } }, new double[] {
); TableLayout.MINIMUM
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
panel.setLayout( layout ); panel.setLayout( layout );
@ -114,7 +116,8 @@ public class AdicionarRiscosPanel extends JPanel
rem(); rem();
} }
} ); } );
tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener(){ tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener()
{
@Override @Override
public void valueChanged( TreeSelectionEvent e ) public void valueChanged( TreeSelectionEvent e )
{ {
@ -156,6 +159,7 @@ public class AdicionarRiscosPanel extends JPanel
} }
return result; return result;
} }
private DefaultMutableTreeNode getRiscosTree() private DefaultMutableTreeNode getRiscosTree()
{ {
DefaultMutableTreeNode result = new DefaultMutableTreeNode(); DefaultMutableTreeNode result = new DefaultMutableTreeNode();
@ -181,6 +185,8 @@ public class AdicionarRiscosPanel extends JPanel
} }
private void addResult( DefaultMutableTreeNode root ) private void addResult( DefaultMutableTreeNode root )
{
try
{ {
if( root != null ) if( root != null )
{ {
@ -208,10 +214,15 @@ public class AdicionarRiscosPanel extends JPanel
addResult( child ); addResult( child );
} }
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void rem() private void rem()
{
try
{ {
TreePath path = tree.getSelectionPath(); TreePath path = tree.getSelectionPath();
if( path != null ) if( path != null )
@ -224,6 +235,10 @@ public class AdicionarRiscosPanel extends JPanel
refresh(); refresh();
} }
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void setEnabled() private void setEnabled()

@ -15,6 +15,7 @@ import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener; import javax.swing.event.CaretListener;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import siprp.database.cayenne.objects.HsMedida; import siprp.database.cayenne.objects.HsMedida;
import com.evolute.utils.images.ImageException; import com.evolute.utils.images.ImageException;
@ -31,10 +32,6 @@ public class GerirMedidaPanel extends JPanel
private static final String ICON_NAME_REVERT = "siprp/higiene/gestao/riscos/revert.png"; private static final String ICON_NAME_REVERT = "siprp/higiene/gestao/riscos/revert.png";
private LeafButton buttonSaveMedida;
private LeafButton buttonRevertMedida;
private LeafButton buttonSaveRequesito; private LeafButton buttonSaveRequesito;
private LeafButton buttonRevertRequesito; private LeafButton buttonRevertRequesito;
@ -53,8 +50,6 @@ public class GerirMedidaPanel extends JPanel
{ {
try try
{ {
buttonSaveMedida = new LeafButton( ImageIconLoader.loadImageIcon( ICON_NAME_SAVE ) );
buttonRevertMedida = new LeafButton( ImageIconLoader.loadImageIcon( ICON_NAME_REVERT ) );
buttonSaveRequesito = new LeafButton( ImageIconLoader.loadImageIcon( ICON_NAME_SAVE ) ); buttonSaveRequesito = new LeafButton( ImageIconLoader.loadImageIcon( ICON_NAME_SAVE ) );
buttonRevertRequesito = new LeafButton( ImageIconLoader.loadImageIcon( ICON_NAME_REVERT ) ); buttonRevertRequesito = new LeafButton( ImageIconLoader.loadImageIcon( ICON_NAME_REVERT ) );
} catch( ImageException e ) } catch( ImageException e )
@ -77,9 +72,7 @@ public class GerirMedidaPanel extends JPanel
scrollMedida.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ); scrollMedida.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS );
scrollRequesitos.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); scrollRequesitos.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
scrollRequesitos.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ); scrollRequesitos.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS );
buttonSaveMedida.setMargin( new Insets(0,0,0,0) );
buttonSaveRequesito.setMargin( new Insets( 0, 0, 0, 0 ) ); buttonSaveRequesito.setMargin( new Insets( 0, 0, 0, 0 ) );
buttonRevertMedida.setMargin( new Insets(0,0,0,0) );
buttonRevertRequesito.setMargin( new Insets( 0, 0, 0, 0 ) ); buttonRevertRequesito.setMargin( new Insets( 0, 0, 0, 0 ) );
} }
@ -101,14 +94,6 @@ public class GerirMedidaPanel extends JPanel
setEnabled(); setEnabled();
} }
} ); } );
buttonSaveMedida.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
saveMedida();
}
} );
buttonSaveRequesito.addActionListener( new ActionListener() buttonSaveRequesito.addActionListener( new ActionListener()
{ {
@Override @Override
@ -117,14 +102,6 @@ public class GerirMedidaPanel extends JPanel
saveRequesito(); saveRequesito();
} }
} ); } );
buttonRevertMedida.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
revertMedida();
}
} );
buttonRevertRequesito.addActionListener( new ActionListener() buttonRevertRequesito.addActionListener( new ActionListener()
{ {
@Override @Override
@ -137,10 +114,11 @@ public class GerirMedidaPanel extends JPanel
private void startupLayout() private void startupLayout()
{ {
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.FILL, TableLayout.MINIMUM, TableLayout.MINIMUM }, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.MINIMUM
new double[]{ TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.FILL } }, new double[] {
); TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
setLayout( layout ); setLayout( layout );
@ -153,8 +131,6 @@ public class GerirMedidaPanel extends JPanel
add( buttonRevertRequesito, new TableLayoutConstraints( 2, 0 ) ); add( buttonRevertRequesito, new TableLayoutConstraints( 2, 0 ) );
add( scrollRequesitos, new TableLayoutConstraints( 0, 1, 2, 1 ) ); add( scrollRequesitos, new TableLayoutConstraints( 0, 1, 2, 1 ) );
add( new JLabel( "Medida" ), new TableLayoutConstraints( 0, 2 ) ); add( new JLabel( "Medida" ), new TableLayoutConstraints( 0, 2 ) );
add( buttonSaveMedida, new TableLayoutConstraints(1,2) );
add( buttonRevertMedida, new TableLayoutConstraints(2,2) );
add( scrollMedida, new TableLayoutConstraints( 0, 3, 2, 3 ) ); add( scrollMedida, new TableLayoutConstraints( 0, 3, 2, 3 ) );
} }
@ -167,41 +143,26 @@ public class GerirMedidaPanel extends JPanel
medidaChanged = !fieldTextMedida.getText().equals( medida.getDescription() ); medidaChanged = !fieldTextMedida.getText().equals( medida.getDescription() );
requesitoChanged = !fieldTextRequisitosLegais.getText().equals( medida.getRequesitosLegais() ); requesitoChanged = !fieldTextRequisitosLegais.getText().equals( medida.getRequesitosLegais() );
} }
buttonSaveMedida.setEnabled( medidaChanged ); buttonSaveRequesito.setEnabled( requesitoChanged || medidaChanged );
buttonSaveRequesito.setEnabled( requesitoChanged ); buttonRevertRequesito.setEnabled( requesitoChanged || medidaChanged );
buttonRevertMedida.setEnabled( medidaChanged );
buttonRevertRequesito.setEnabled( requesitoChanged );
}
private void saveMedida()
{
if( medida != null )
{
medida.setDescription( fieldTextMedida.getText() );
medida.save();
refresh();
}
setEnabled();
} }
private void saveRequesito() private void saveRequesito()
{
try
{ {
if( medida != null ) if( medida != null )
{ {
medida.setRequesitosLegais( fieldTextRequisitosLegais.getText() ); medida.setRequesitosLegais( fieldTextRequisitosLegais.getText() );
medida.setDescription( fieldTextMedida.getText() );
medida.save(); medida.save();
refresh(); refresh();
} }
setEnabled(); setEnabled();
} } catch( Exception e )
private void revertMedida()
{
if( medida != null )
{ {
fieldTextMedida.setText( medida.getDescription() ); LeafError.error( e );
} }
setEnabled();
} }
private void revertRequesito() private void revertRequesito()
@ -209,6 +170,7 @@ public class GerirMedidaPanel extends JPanel
if( medida != null ) if( medida != null )
{ {
fieldTextRequisitosLegais.setText( medida.getRequesitosLegais() ); fieldTextRequisitosLegais.setText( medida.getRequesitosLegais() );
fieldTextMedida.setText( medida.getDescription() );
} }
setEnabled(); setEnabled();
} }
@ -231,5 +193,4 @@ public class GerirMedidaPanel extends JPanel
return this.medida; return this.medida;
} }
} }

@ -1,6 +1,6 @@
package siprp.higiene.gestao.riscos; package siprp.higiene.gestao.riscos;
import static com.evolute.utils.strings.UnicodeLatin1Map.atilde; import static com.evolute.utils.strings.UnicodeLatin1Map.*;
import static com.evolute.utils.strings.UnicodeLatin1Map.ccedil; import static com.evolute.utils.strings.UnicodeLatin1Map.ccedil;
import info.clearthought.layout.TableLayout; import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints; import info.clearthought.layout.TableLayoutConstraints;
@ -26,6 +26,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.HsMedida; import siprp.database.cayenne.objects.HsMedida;
import siprp.database.cayenne.objects.HsRisco; import siprp.database.cayenne.objects.HsRisco;
@ -157,7 +158,8 @@ public class GerirRiscosPanel extends JPanel
removerMedida(); removerMedida();
} }
} ); } );
tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener(){ tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener()
{
@Override @Override
public void valueChanged( TreeSelectionEvent e ) public void valueChanged( TreeSelectionEvent e )
{ {
@ -179,6 +181,8 @@ public class GerirRiscosPanel extends JPanel
} }
private void criarTema() private void criarTema()
{
try
{ {
String temaString = JOptionPane.showInputDialog( this, "Criar tema", "Descri" + ccedil + atilde + "o", JOptionPane.QUESTION_MESSAGE ); String temaString = JOptionPane.showInputDialog( this, "Criar tema", "Descri" + ccedil + atilde + "o", JOptionPane.QUESTION_MESSAGE );
if( temaString != null ) if( temaString != null )
@ -188,9 +192,15 @@ public class GerirRiscosPanel extends JPanel
tema.save(); tema.save();
refresh(); refresh();
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void editarTema() private void editarTema()
{
try
{ {
HsRiscoTema tema = getSelectedTema(); HsRiscoTema tema = getSelectedTema();
if( tema != null ) if( tema != null )
@ -203,9 +213,15 @@ public class GerirRiscosPanel extends JPanel
refresh(); refresh();
} }
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void removerTema() private void removerTema()
{
try
{ {
HsRiscoTema tema = getSelectedTema(); HsRiscoTema tema = getSelectedTema();
if( tema != null ) if( tema != null )
@ -213,9 +229,15 @@ public class GerirRiscosPanel extends JPanel
tema.delete(); tema.delete();
refresh(); refresh();
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void criarRisco() private void criarRisco()
{
try
{ {
HsRiscoTema tema = getSelectedTema(); HsRiscoTema tema = getSelectedTema();
if( tema == null ) if( tema == null )
@ -246,9 +268,15 @@ public class GerirRiscosPanel extends JPanel
refresh(); refresh();
} }
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void editarRisco() private void editarRisco()
{
try
{ {
HsRisco risco = getSelectedRisco(); HsRisco risco = getSelectedRisco();
if( risco != null ) if( risco != null )
@ -261,19 +289,45 @@ public class GerirRiscosPanel extends JPanel
refresh(); refresh();
} }
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void removerRisco() private void removerRisco()
{
try
{ {
HsRisco risco = getSelectedRisco(); HsRisco risco = getSelectedRisco();
if( risco != null ) if( risco != null && removerRiscoOK(risco) )
{ {
risco.delete(); risco.delete();
refresh(); refresh();
} }
} }
catch( Exception e )
{
LeafError.error( e );
}
}
private boolean removerRiscoOK( HsRisco risco )
{
boolean result = true;
if( risco.getHsRiscoEmpresaArray().size() > 0 )
{
if( JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog( this, "Este risco est" + aacute + " associado a uma ou mais empresas, \n tem a certeza que o deseja remover?", "Aviso", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE ) )
{
result = false;
}
}
return result;
}
private void criarMedida() private void criarMedida()
{
try
{ {
HsRisco risco = getSelectedRisco(); HsRisco risco = getSelectedRisco();
if( risco == null ) if( risco == null )
@ -296,9 +350,15 @@ public class GerirRiscosPanel extends JPanel
rel.save(); rel.save();
refresh(); refresh();
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void removerMedida() private void removerMedida()
{
try
{ {
HsRiscoMedida medida = getSelectedMedida(); HsRiscoMedida medida = getSelectedMedida();
if( medida != null ) if( medida != null )
@ -306,6 +366,10 @@ public class GerirRiscosPanel extends JPanel
medida.delete(); medida.delete();
refresh(); refresh();
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private HsRiscoTema getSelectedTema() private HsRiscoTema getSelectedTema()
@ -364,42 +428,47 @@ public class GerirRiscosPanel extends JPanel
private void startupLayout() private void startupLayout()
{ {
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.FILL }, TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.FILL
new double[]{ TableLayout.FILL } }, new double[] {
); TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
setLayout( layout ); setLayout( layout );
layout = new TableLayout( layout = new TableLayout( new double[] {
new double[]{ TableLayout.MINIMUM }, TableLayout.MINIMUM
new double[]{ TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL } }, new double[] {
); TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
panelButtons.setLayout( layout ); panelButtons.setLayout( layout );
layout = new TableLayout( layout = new TableLayout( new double[] {
new double[]{ TableLayout.FILL }, TableLayout.FILL
new double[]{ TableLayout.FILL } }, new double[] {
); TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
panelTree.setLayout( layout ); panelTree.setLayout( layout );
layout = new TableLayout( layout = new TableLayout( new double[] {
new double[]{ TableLayout.FILL }, TableLayout.FILL
new double[]{ TableLayout.FILL } }, new double[] {
); TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
panelDataTema.setLayout( layout ); panelDataTema.setLayout( layout );
layout = new TableLayout( layout = new TableLayout( new double[] {
new double[]{ TableLayout.FILL }, TableLayout.FILL
new double[]{ TableLayout.FILL } }, new double[] {
); TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
panelDataRisco.setLayout( layout ); panelDataRisco.setLayout( layout );
@ -441,7 +510,6 @@ public class GerirRiscosPanel extends JPanel
add( panelData, new TableLayoutConstraints( 2, 0 ) ); add( panelData, new TableLayoutConstraints( 2, 0 ) );
} }
private void selectCard() private void selectCard()
{ {
HsRiscoTema tema = getSelectedTema(); HsRiscoTema tema = getSelectedTema();

@ -18,6 +18,7 @@ import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener; import javax.swing.event.CaretListener;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import siprp.database.cayenne.objects.HsRelatorioPostoMedida; import siprp.database.cayenne.objects.HsRelatorioPostoMedida;
import com.evolute.utils.images.ImageException; import com.evolute.utils.images.ImageException;
@ -150,10 +151,11 @@ public class GerirMedidaRelatorioPanel extends JPanel
private void startupLayout() private void startupLayout()
{ {
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.FILL, TableLayout.MINIMUM, TableLayout.MINIMUM }, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.MINIMUM
new double[]{ TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.FILL } }, new double[] {
); TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
setLayout( layout ); setLayout( layout );
@ -162,10 +164,11 @@ public class GerirMedidaRelatorioPanel extends JPanel
private void placeComponents() private void placeComponents()
{ {
JPanel panel = new JPanel(); JPanel panel = new JPanel();
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.MINIMUM, TableLayout.FILL }, TableLayout.MINIMUM, TableLayout.FILL
new double[]{ TableLayout.MINIMUM } }, new double[] {
); TableLayout.MINIMUM
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
panel.setLayout( layout ); panel.setLayout( layout );
@ -214,6 +217,8 @@ public class GerirMedidaRelatorioPanel extends JPanel
} }
private void savePlano() private void savePlano()
{
try
{ {
if( relacao != null ) if( relacao != null )
{ {
@ -221,9 +226,15 @@ public class GerirMedidaRelatorioPanel extends JPanel
relacao.save(); relacao.save();
firePropertyChange( MEDIDA_CHANGED, null, relacao ); firePropertyChange( MEDIDA_CHANGED, null, relacao );
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void saveMedida() private void saveMedida()
{
try
{ {
if( relacao != null ) if( relacao != null )
{ {
@ -232,9 +243,15 @@ public class GerirMedidaRelatorioPanel extends JPanel
refresh(); refresh();
} }
setEnabled(); setEnabled();
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void saveRequesito() private void saveRequesito()
{
try
{ {
if( relacao != null ) if( relacao != null )
{ {
@ -243,6 +260,10 @@ public class GerirMedidaRelatorioPanel extends JPanel
refresh(); refresh();
} }
setEnabled(); setEnabled();
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void revertMedida() private void revertMedida()
@ -277,5 +298,4 @@ public class GerirMedidaRelatorioPanel extends JPanel
setEnabled(); setEnabled();
} }
} }

@ -20,6 +20,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.HsRelatorioMedida; import siprp.database.cayenne.objects.HsRelatorioMedida;
import siprp.database.cayenne.objects.HsRelatorioPosto; import siprp.database.cayenne.objects.HsRelatorioPosto;
@ -118,10 +119,11 @@ public class GerirMedidasRelatorioPanel extends JPanel
private void setupLayout() private void setupLayout()
{ {
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.FILL }, TableLayout.FILL
new double[]{ TableLayout.MINIMUM, TableLayout.FILL } }, new double[] {
); TableLayout.MINIMUM, TableLayout.FILL
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
setLayout( layout ); setLayout( layout );
@ -130,10 +132,11 @@ public class GerirMedidasRelatorioPanel extends JPanel
private void placeComponents() private void placeComponents()
{ {
JPanel panel = new JPanel(); JPanel panel = new JPanel();
TableLayout layout = new TableLayout( TableLayout layout = new TableLayout( new double[] {
new double[]{ TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM }, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM
new double[]{ TableLayout.MINIMUM } }, new double[] {
); TableLayout.MINIMUM
} );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
panel.setLayout( layout ); panel.setLayout( layout );
@ -146,7 +149,8 @@ public class GerirMedidasRelatorioPanel extends JPanel
private void startupListeners() private void startupListeners()
{ {
tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener(){ tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener()
{
@Override @Override
public void valueChanged( TreeSelectionEvent e ) public void valueChanged( TreeSelectionEvent e )
{ {
@ -224,6 +228,8 @@ public class GerirMedidasRelatorioPanel extends JPanel
} }
private void add() private void add()
{
try
{ {
HsRelatorioPostoRisco postoRisco = getSelectedRisco(); HsRelatorioPostoRisco postoRisco = getSelectedRisco();
if( posto != null ) if( posto != null )
@ -239,9 +245,15 @@ public class GerirMedidasRelatorioPanel extends JPanel
} }
refresh(); refresh();
setEnabled(); setEnabled();
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void rem() private void rem()
{
try
{ {
TreePath path = tree.getSelectionPath(); TreePath path = tree.getSelectionPath();
if( path != null ) if( path != null )
@ -256,6 +268,10 @@ public class GerirMedidasRelatorioPanel extends JPanel
} }
refresh(); refresh();
setEnabled(); setEnabled();
} catch( Exception e )
{
LeafError.error( e );
}
} }
private void setEnabled() private void setEnabled()

@ -1,5 +1,6 @@
package siprp.higiene.relatorio; package siprp.higiene.relatorio;
import static com.evolute.utils.strings.UnicodeLatin1Map.aacute;
import info.clearthought.layout.TableLayout; import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints; import info.clearthought.layout.TableLayoutConstraints;
@ -18,13 +19,12 @@ import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener; import javax.swing.event.CaretListener;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError;
import leaf.ui.LeafIconButton; import leaf.ui.LeafIconButton;
import siprp.database.cayenne.objects.HsRelatorioPostoRisco; import siprp.database.cayenne.objects.HsRelatorioPostoRisco;
import siprp.database.cayenne.objects.HsRelatorioRiscoValorQualitativo; import siprp.database.cayenne.objects.HsRelatorioRiscoValorQualitativo;
import siprp.logic.HigieneSegurancaLogic; import siprp.logic.HigieneSegurancaLogic;
import static com.evolute.utils.strings.UnicodeLatin1Map.*;
public class GerirValoresRiscoPanel extends JPanel implements ActionListener, CaretListener public class GerirValoresRiscoPanel extends JPanel implements ActionListener, CaretListener
{ {
@ -247,6 +247,8 @@ public class GerirValoresRiscoPanel extends JPanel implements ActionListener, Ca
} }
private void save() private void save()
{
try
{ {
if( valoresRisco != null ) if( valoresRisco != null )
{ {
@ -302,6 +304,10 @@ public class GerirValoresRiscoPanel extends JPanel implements ActionListener, Ca
refresh(); refresh();
setEnabled(); setEnabled();
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
@Override @Override

@ -30,6 +30,7 @@ import javax.swing.event.CaretListener;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import leaf.ui.LeafError;
import leaf.ui.LeafIconButton; import leaf.ui.LeafIconButton;
import siprp.database.cayenne.objects.HsRelatorio; import siprp.database.cayenne.objects.HsRelatorio;
import siprp.database.cayenne.objects.MarcacoesEstabelecimento; import siprp.database.cayenne.objects.MarcacoesEstabelecimento;
@ -221,6 +222,8 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
} }
private void submit() private void submit()
{
try
{ {
if( relatorio != null ) if( relatorio != null )
{ {
@ -229,9 +232,15 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
refresh(); refresh();
setRelatorio( relatorio, false ); setRelatorio( relatorio, false );
} }
} catch( Exception e )
{
LeafError.error(e);
}
} }
private void save() private void save()
{
try
{ {
if( relatorio != null ) if( relatorio != null )
{ {
@ -258,6 +267,10 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
refresh(); refresh();
buttonRevert.setEnabled( false ); buttonRevert.setEnabled( false );
buttonSave.setEnabled( false ); buttonSave.setEnabled( false );
} catch( Exception e )
{
LeafError.error(e);
}
} }
private void revert() private void revert()

@ -19,6 +19,7 @@ import javax.swing.JFrame;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import leaf.ui.LeafError;
import siprp.database.cayenne.objects.Empresas; import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.Estabelecimentos; import siprp.database.cayenne.objects.Estabelecimentos;
import siprp.database.cayenne.objects.HsRelatorio; import siprp.database.cayenne.objects.HsRelatorio;
@ -159,6 +160,8 @@ public class RelatorioHigieneSegurancaWindow extends JFrame implements Trackable
} }
private void fillRelatorio( MarcacoesEstabelecimento visita ) private void fillRelatorio( MarcacoesEstabelecimento visita )
{
try
{ {
boolean carregarDadosEstabelecimento = false; boolean carregarDadosEstabelecimento = false;
panelRelatorio.setRelatorio( null, carregarDadosEstabelecimento ); panelRelatorio.setRelatorio( null, carregarDadosEstabelecimento );
@ -186,6 +189,10 @@ public class RelatorioHigieneSegurancaWindow extends JFrame implements Trackable
} }
panelRelatorio.setRelatorio( relatorio, carregarDadosEstabelecimento );; panelRelatorio.setRelatorio( relatorio, carregarDadosEstabelecimento );;
} }
} catch( Exception e )
{
LeafError.error(e);
}
} }
@Override @Override

@ -1,14 +1,13 @@
package siprp.medicina.exames.logic; package siprp.medicina.exames.logic;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import leaf.ui.LeafError;
import leaf.ui.LeafLogic; import leaf.ui.LeafLogic;
import siprp.database.cayenne.objects.Prestadores; import siprp.database.cayenne.objects.Prestadores;
import siprp.database.cayenne.objects.TrabalhadoresEcd; import siprp.database.cayenne.objects.TrabalhadoresEcd;
import siprp.database.cayenne.providers.MedicinaDAO; import siprp.database.cayenne.providers.MedicinaDAO;
import siprp.medicina.processo.data.TrabalhadoresEcdData;
public class RecepcaoExamesLogic extends LeafLogic public class RecepcaoExamesLogic extends LeafLogic
{ {
@ -45,13 +44,19 @@ public class RecepcaoExamesLogic extends LeafLogic
@LeafLogicActionBinding(actions = ACTION_RECEBER_EXAMES) @LeafLogicActionBinding(actions = ACTION_RECEBER_EXAMES)
public void receberExames( List<TrabalhadoresEcd> ecds ) public void receberExames( List<TrabalhadoresEcd> ecds )
{
try
{ {
if( ecds != null ) if( ecds != null )
{ {
for( TrabalhadoresEcd ecd : ecds ) for( TrabalhadoresEcd ecd : ecds )
{ {
dao.saveObject( ecd ); ecd.save();
}
} }
} catch( Exception e )
{
LeafError.error( e );
} }
} }

@ -9,18 +9,8 @@
package siprp.medicina.prestadores; package siprp.medicina.prestadores;
import com.evolute.utils.Singleton; import static com.evolute.utils.strings.UnicodeLatin1Map.ccedil;
import static com.evolute.utils.strings.UnicodeLatin1Map.*; import static com.evolute.utils.strings.UnicodeLatin1Map.otilde;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.dataui.ComponentController;
import com.evolute.utils.dataui.ComponentsHashtable;
import com.evolute.utils.dataui.JDOControllable;
import com.evolute.utils.dataui.JTextComponentPlainFillerSaver;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.ui.DialogException;
import com.evolute.utils.ui.panel.CheckBoxPanel;
import com.evolute.utils.ui.search.SearchDialog;
import com.evolute.utils.ui.window.EditorWindow;
import info.clearthought.layout.TableLayout; import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints; import info.clearthought.layout.TableLayoutConstraints;
@ -35,6 +25,7 @@ import java.util.Hashtable;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Vector; import java.util.Vector;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import javax.swing.JComboBox; import javax.swing.JComboBox;
@ -45,6 +36,8 @@ import javax.swing.JSeparator;
import javax.swing.JTabbedPane; import javax.swing.JTabbedPane;
import javax.swing.JTextArea; import javax.swing.JTextArea;
import javax.swing.JTextField; import javax.swing.JTextField;
import leaf.ui.LeafError;
import siprp.clientes.ClientesDataProvider; import siprp.clientes.ClientesDataProvider;
import siprp.clientes.ContactoPanel; import siprp.clientes.ContactoPanel;
import siprp.data.ContactoData; import siprp.data.ContactoData;
@ -53,6 +46,18 @@ import siprp.database.cayenne.objects.PrtGruposProtocolo;
import siprp.database.cayenne.providers.MedicinaDAO; import siprp.database.cayenne.providers.MedicinaDAO;
import siprp.medicina.prestadores.data.PrestadoresData; import siprp.medicina.prestadores.data.PrestadoresData;
import com.evolute.utils.Singleton;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.dataui.ComponentController;
import com.evolute.utils.dataui.ComponentsHashtable;
import com.evolute.utils.dataui.JDOControllable;
import com.evolute.utils.dataui.JTextComponentPlainFillerSaver;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.ui.DialogException;
import com.evolute.utils.ui.panel.CheckBoxPanel;
import com.evolute.utils.ui.search.SearchDialog;
import com.evolute.utils.ui.window.EditorWindow;
/** /**
* *
* @author fpalma * @author fpalma
@ -175,17 +180,7 @@ public class PrestadoresWindow extends EditorWindow
TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL
}; };
double rows[] = new double[] { double rows[] = new double[] {
TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL
TableLayout.MINIMUM,
TableLayout.MINIMUM,
TableLayout.FILL,
TableLayout.PREFERRED,
TableLayout.PREFERRED,
TableLayout.MINIMUM,
TableLayout.MINIMUM,
TableLayout.MINIMUM,
TableLayout.MINIMUM,
TableLayout.FILL
}; };
TableLayout tableLayout = new TableLayout( cols, rows ); TableLayout tableLayout = new TableLayout( cols, rows );
prestadoresPanel.setLayout( tableLayout ); prestadoresPanel.setLayout( tableLayout );
@ -413,6 +408,8 @@ public class PrestadoresWindow extends EditorWindow
@Override @Override
public void itemStateChanged( ItemEvent itemEvent ) public void itemStateChanged( ItemEvent itemEvent )
{
try
{ {
if( ItemEvent.SELECTED == itemEvent.getStateChange() ) if( ItemEvent.SELECTED == itemEvent.getStateChange() )
{ {
@ -423,11 +420,15 @@ public class PrestadoresWindow extends EditorWindow
{ {
Prestadores analisador = (Prestadores) combo.getSelectedItem(); Prestadores analisador = (Prestadores) combo.getSelectedItem();
grupo.setToAnalisador( Prestadores.prestadorNulo.equals( analisador ) ? null : analisador ); grupo.setToAnalisador( Prestadores.prestadorNulo.equals( analisador ) ? null : analisador );
medicinaCayenneDAO.saveObject( grupo ); grupo.save();
shout( "Tipo de ECD: " + grupo.getDescricao() + " -> Analisador: " + analisador.getNome() + " [guardado]" ); shout( "Tipo de ECD: " + grupo.getDescricao() + " -> Analisador: " + analisador.getNome() + " [guardado]" );
} }
} }
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
} ); } );

@ -5,6 +5,7 @@ import java.util.List;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import leaf.ui.LeafError;
import leaf.ui.LeafLogic; import leaf.ui.LeafLogic;
import leaf.ui.LeafWindow.LeafObject; import leaf.ui.LeafWindow.LeafObject;
import siprp.MedicinaConstants; import siprp.MedicinaConstants;
@ -225,7 +226,9 @@ public class MedicinaProcessoLogic extends LeafLogic
}) })
public TrabalhadoresConsultas currentConsulta = null; public TrabalhadoresConsultas currentConsulta = null;
@LeafObject(useWith = { SAVE_CONSULTA_MARCACAO, APAGAR_CONSULTA_MARCACAO } ) @LeafObject(useWith = {
SAVE_CONSULTA_MARCACAO, APAGAR_CONSULTA_MARCACAO
})
public TrabalhadoresConsultasDatas currentConsultaMarcacao = null; public TrabalhadoresConsultasDatas currentConsultaMarcacao = null;
@LeafObject(useWith = SAVE_CONSULTA_MARCACAO_EMAIL) @LeafObject(useWith = SAVE_CONSULTA_MARCACAO_EMAIL)
@ -603,6 +606,8 @@ public class MedicinaProcessoLogic extends LeafLogic
{ {
@Override @Override
public void exameSaved( Integer trabalhadorID, Integer exameID ) public void exameSaved( Integer trabalhadorID, Integer exameID )
{
try
{ {
if( trabalhadorID != null && exameID != null ) if( trabalhadorID != null && exameID != null )
{ {
@ -613,11 +618,15 @@ public class MedicinaProcessoLogic extends LeafLogic
if( exame != null ) if( exame != null )
{ {
currentFicha.setToExames( exame ); currentFicha.setToExames( exame );
provider.saveObject( currentFicha ); currentFicha.save();
runAction( REFRESH ); runAction( REFRESH );
} }
} }
} }
} catch( Exception e )
{
LeafError.error( e );
}
} }
} ); } );
} }
@ -784,8 +793,14 @@ public class MedicinaProcessoLogic extends LeafLogic
}) })
public void saveObject( BaseObject object ) public void saveObject( BaseObject object )
{ {
provider.saveObject( object ); try
{
object.save();
runActionLater( REFRESH ); runActionLater( REFRESH );
} catch( Exception e )
{
LeafError.error(e);
}
} }
@LeafLogicActionBinding(actions = { @LeafLogicActionBinding(actions = {
@ -805,6 +820,8 @@ public class MedicinaProcessoLogic extends LeafLogic
} }
private void apagarConsulta( TrabalhadoresConsultas consulta ) private void apagarConsulta( TrabalhadoresConsultas consulta )
{
try
{ {
List<TrabalhadoresConsultasDatas> marcacoes = consulta.getTrabalhadoresConsultasDatasArray(); List<TrabalhadoresConsultasDatas> marcacoes = consulta.getTrabalhadoresConsultasDatasArray();
if( marcacoes != null ) if( marcacoes != null )
@ -816,7 +833,7 @@ public class MedicinaProcessoLogic extends LeafLogic
{ {
for( TrabalhadoresConsultasDatasEmails email : emails ) for( TrabalhadoresConsultasDatasEmails email : emails )
{ {
provider.deleteObject( email ); email.delete();
} }
} }
List<TrabalhadoresConsultasDatasObservacoes> observacoes = marcacao.getTrabalhadoresConsultasDatasObservacoesArray(); List<TrabalhadoresConsultasDatasObservacoes> observacoes = marcacao.getTrabalhadoresConsultasDatasObservacoesArray();
@ -824,16 +841,22 @@ public class MedicinaProcessoLogic extends LeafLogic
{ {
for( TrabalhadoresConsultasDatasObservacoes observacao : observacoes ) for( TrabalhadoresConsultasDatasObservacoes observacao : observacoes )
{ {
provider.deleteObject( observacao ); observacao.delete();
} }
} }
provider.deleteObject( marcacao ); marcacao.delete();
} }
provider.deleteObject( consulta ); consulta.delete();
}
} catch( Exception e )
{
LeafError.error(e);
} }
} }
private void apagarExame( TrabalhadoresEcds exame ) private void apagarExame( TrabalhadoresEcds exame )
{
try
{ {
List<TrabalhadoresEcdsDatas> marcacoes = exame.getTrabalhadoresEcdsDatasArray(); List<TrabalhadoresEcdsDatas> marcacoes = exame.getTrabalhadoresEcdsDatasArray();
if( marcacoes != null ) if( marcacoes != null )
@ -845,7 +868,7 @@ public class MedicinaProcessoLogic extends LeafLogic
{ {
for( TrabalhadoresEcd ecd : ecds ) for( TrabalhadoresEcd ecd : ecds )
{ {
provider.deleteObject( ecd ); ecd.delete();
} }
} }
List<TrabalhadoresEcdsDatasEmails> emails = marcacao.getTrabalhadoresEcdsDatasEmailsArray(); List<TrabalhadoresEcdsDatasEmails> emails = marcacao.getTrabalhadoresEcdsDatasEmailsArray();
@ -853,7 +876,7 @@ public class MedicinaProcessoLogic extends LeafLogic
{ {
for( TrabalhadoresEcdsDatasEmails email : emails ) for( TrabalhadoresEcdsDatasEmails email : emails )
{ {
provider.deleteObject( email ); email.delete();
} }
} }
List<TrabalhadoresEcdsDatasObservacoes> observacoes = marcacao.getTrabalhadoresEcdsDatasObservacoesArray(); List<TrabalhadoresEcdsDatasObservacoes> observacoes = marcacao.getTrabalhadoresEcdsDatasObservacoesArray();
@ -861,12 +884,16 @@ public class MedicinaProcessoLogic extends LeafLogic
{ {
for( TrabalhadoresEcdsDatasObservacoes observacao : observacoes ) for( TrabalhadoresEcdsDatasObservacoes observacao : observacoes )
{ {
provider.deleteObject( observacao ); observacao.delete();
}
} }
marcacao.delete();
} }
provider.deleteObject( marcacao ); exame.delete();
} }
provider.deleteObject( exame ); } catch( Exception e )
{
LeafError.error(e);
} }
} }

@ -1864,6 +1864,7 @@
<obj-relationship name="hsPostoRiscoArray" source="HsRelatorioRiscoValorQualitativo" target="HsPostoRisco" db-relationship-path="hsPostoRiscoArray"/> <obj-relationship name="hsPostoRiscoArray" source="HsRelatorioRiscoValorQualitativo" target="HsPostoRisco" db-relationship-path="hsPostoRiscoArray"/>
<obj-relationship name="hsRelatorioPostoRiscoArray" source="HsRelatorioRiscoValorQualitativo" target="HsRelatorioPostoRisco" db-relationship-path="hsRelatorioPostoRiscoArray"/> <obj-relationship name="hsRelatorioPostoRiscoArray" source="HsRelatorioRiscoValorQualitativo" target="HsRelatorioPostoRisco" db-relationship-path="hsRelatorioPostoRiscoArray"/>
<obj-relationship name="hsPostoRiscoArray" source="HsRisco" target="HsPostoRisco" deleteRule="Cascade" db-relationship-path="hsPostoRiscoArray"/> <obj-relationship name="hsPostoRiscoArray" source="HsRisco" target="HsPostoRisco" deleteRule="Cascade" db-relationship-path="hsPostoRiscoArray"/>
<obj-relationship name="hsRiscoEmpresaArray" source="HsRisco" target="HsRiscoEmpresa" deleteRule="Cascade" db-relationship-path="hsRiscoEmpresaArray"/>
<obj-relationship name="hsRiscoMedidaArray" source="HsRisco" target="HsRiscoMedida" deleteRule="Cascade" db-relationship-path="hsRiscoMedidaArray"/> <obj-relationship name="hsRiscoMedidaArray" source="HsRisco" target="HsRiscoMedida" deleteRule="Cascade" db-relationship-path="hsRiscoMedidaArray"/>
<obj-relationship name="toHsRiscoTema" source="HsRisco" target="HsRiscoTema" deleteRule="Nullify" db-relationship-path="toHsRiscoTema"/> <obj-relationship name="toHsRiscoTema" source="HsRisco" target="HsRiscoTema" deleteRule="Nullify" db-relationship-path="toHsRiscoTema"/>
<obj-relationship name="toEmpresa" source="HsRiscoEmpresa" target="Empresas" deleteRule="Nullify" db-relationship-path="toEmpresa"/> <obj-relationship name="toEmpresa" source="HsRiscoEmpresa" target="Empresas" deleteRule="Nullify" db-relationship-path="toEmpresa"/>

@ -0,0 +1,20 @@
package leaf.ui;
import javax.swing.JOptionPane;
import com.evolute.utils.error.ErrorLogger;
public class LeafError
{
public static void error( Throwable e )
{
if( e != null )
{
ErrorLogger.logException( e );
e.printStackTrace(System.out);
JOptionPane.showMessageDialog( null, "Detalhes: \n"+e.getMessage(), "Erro!", JOptionPane.ERROR_MESSAGE );
}
}
}

@ -29,9 +29,9 @@ public class TreeInserterDialog extends JDialog
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Dimension allDimension = new Dimension(300,500); private static final Dimension ALL_DIMENSION = new Dimension(300,500);
private static final Dimension newDimension = new Dimension(300,400); private static final Dimension NEW_DIMENSION = new Dimension(300,400);
private static final String ICON_NAME_ADD = "leaf/ui/icons/add.png"; private static final String ICON_NAME_ADD = "leaf/ui/icons/add.png";
@ -98,12 +98,12 @@ public class TreeInserterDialog extends JDialog
allScroll.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); allScroll.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
newScroll.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ); newScroll.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS );
newScroll.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); newScroll.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
allScroll.setPreferredSize( allDimension ); allScroll.setPreferredSize( ALL_DIMENSION );
newScroll.setPreferredSize( newDimension ); newScroll.setPreferredSize( NEW_DIMENSION );
buttonAdd.setToolTipText( "Adicionar" ); buttonAdd.setToolTipText( "Adicionar" );
buttonRemove.setToolTipText( "Remover" ); buttonRemove.setToolTipText( "Remover" );
buttonAdd.setMargin( new Insets(4,4,4,4) ); buttonAdd.setMargin( new Insets(0,0,0,0) );
buttonRemove.setMargin( new Insets(4,4,4,4) ); buttonRemove.setMargin( new Insets(0,0,0,0) );
} }
private void setupLayout() private void setupLayout()

@ -6,7 +6,7 @@ import java.util.Locale;
import org.apache.cayenne.CayenneDataObject; import org.apache.cayenne.CayenneDataObject;
import org.apache.cayenne.PersistenceState; import org.apache.cayenne.PersistenceState;
import siprp.database.cayenne.providers.MedicinaDAO; import siprp.database.cayenne.providers.MainDAO;
import com.evolute.utils.strings.UnicodeChecker; import com.evolute.utils.strings.UnicodeChecker;
@ -19,7 +19,7 @@ public class BaseObject extends CayenneDataObject
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
protected static MedicinaDAO medicinaProvider = new MedicinaDAO(); protected static MainDAO dao = new MainDAO();
protected static final DateFormat sdf = DateFormat.getDateInstance( DateFormat.SHORT, new Locale( "pt", "PT" ) ); protected static final DateFormat sdf = DateFormat.getDateInstance( DateFormat.SHORT, new Locale( "pt", "PT" ) );
@ -45,16 +45,29 @@ public class BaseObject extends CayenneDataObject
return getPersistenceState() == PersistenceState.MODIFIED; return getPersistenceState() == PersistenceState.MODIFIED;
} }
public void save() public void commit()
{ {
medicinaProvider.saveObject( this ); dao.commit();
medicinaProvider.commit();
} }
public void delete() public void rollback()
{ {
medicinaProvider.deleteObject( this ); dao.rollback();
medicinaProvider.commit(); }
public void save() throws Exception
{
if( isTransient() )
{
dao.getContext().registerNewObject( this );
}
commit();
}
public void delete() throws Exception
{
dao.getContext().deleteObject( this );
commit();
} }
protected String parseToUnicode( String string ) protected String parseToUnicode( String string )

@ -8,7 +8,7 @@ public class HsRiscoMedida extends _HsRiscoMedida {
@Override @Override
public String toString() public String toString()
{ {
String d = getToHsMedida().getRequesitosLegais(); String d = getToHsMedida() == null ? null : getToHsMedida().getRequesitosLegais();
return d == null ? " " : d.substring( 0, Math.min( 20, d.length() ) ) + "..."; return d == null ? " " : d.substring( 0, Math.min( 20, d.length() ) ) + "...";
} }
} }

@ -3,8 +3,7 @@ package siprp.database.cayenne.objects;
import java.util.List; import java.util.List;
import siprp.database.cayenne.objects.auto._Prestadores; import siprp.database.cayenne.objects.auto._Prestadores;
import siprp.database.cayenne.providers.MedicinaDAO;
import com.evolute.utils.strings.UnicodeChecker;
public class Prestadores extends _Prestadores { public class Prestadores extends _Prestadores {
@ -59,7 +58,7 @@ public class Prestadores extends _Prestadores {
public static List<Prestadores> getAllPrestadores() public static List<Prestadores> getAllPrestadores()
{ {
List<Prestadores> result = medicinaProvider.getAllPrestadores(); List<Prestadores> result = new MedicinaDAO().getAllPrestadores();
result.add( 0, prestadorNulo); result.add( 0, prestadorNulo);
return result; return result;
} }

@ -5,6 +5,7 @@ import java.util.List;
import siprp.database.cayenne.objects.BaseObject; import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsPostoRisco; import siprp.database.cayenne.objects.HsPostoRisco;
import siprp.database.cayenne.objects.HsRiscoEmpresa;
import siprp.database.cayenne.objects.HsRiscoMedida; import siprp.database.cayenne.objects.HsRiscoMedida;
import siprp.database.cayenne.objects.HsRiscoTema; import siprp.database.cayenne.objects.HsRiscoTema;
@ -19,6 +20,7 @@ public abstract class _HsRisco extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate"; public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description"; public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_POSTO_RISCO_ARRAY_PROPERTY = "hsPostoRiscoArray"; public static final String HS_POSTO_RISCO_ARRAY_PROPERTY = "hsPostoRiscoArray";
public static final String HS_RISCO_EMPRESA_ARRAY_PROPERTY = "hsRiscoEmpresaArray";
public static final String HS_RISCO_MEDIDA_ARRAY_PROPERTY = "hsRiscoMedidaArray"; public static final String HS_RISCO_MEDIDA_ARRAY_PROPERTY = "hsRiscoMedidaArray";
public static final String TO_HS_RISCO_TEMA_PROPERTY = "toHsRiscoTema"; public static final String TO_HS_RISCO_TEMA_PROPERTY = "toHsRiscoTema";
@ -50,6 +52,18 @@ public abstract class _HsRisco extends BaseObject {
} }
public void addToHsRiscoEmpresaArray(HsRiscoEmpresa obj) {
addToManyTarget("hsRiscoEmpresaArray", obj, true);
}
public void removeFromHsRiscoEmpresaArray(HsRiscoEmpresa obj) {
removeToManyTarget("hsRiscoEmpresaArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsRiscoEmpresa> getHsRiscoEmpresaArray() {
return (List<HsRiscoEmpresa>)readProperty("hsRiscoEmpresaArray");
}
public void addToHsRiscoMedidaArray(HsRiscoMedida obj) { public void addToHsRiscoMedidaArray(HsRiscoMedida obj) {
addToManyTarget("hsRiscoMedidaArray", obj, true); addToManyTarget("hsRiscoMedidaArray", obj, true);
} }

@ -2,8 +2,6 @@ package siprp.database.cayenne.providers;
import org.apache.cayenne.access.DataContext; import org.apache.cayenne.access.DataContext;
import siprp.database.cayenne.objects.BaseObject;
public class MainDAO public class MainDAO
{ {
protected static DataContext context = null; protected static DataContext context = null;
@ -21,31 +19,15 @@ public class MainDAO
context.commitChanges(); context.commitChanges();
} }
public BaseObject saveObject( BaseObject object ) public void rollback()
{
if( object != null )
{
if( object.isTransient() )
{ {
context.registerNewObject( object ); context.rollbackChanges();
} context.unregisterObjects( context.uncommittedObjects() );
context.commitChanges();
}
return object;
} }
public void deleteObject( BaseObject object ) public DataContext getContext()
{ {
if( object != null ) return context;
{
context.deleteObject( object );
context.commitChanges();
}
} }
public void rollback()
{
context.rollbackChanges();
context.unregisterObjects( context.uncommittedObjects() );
}
} }

@ -40,6 +40,7 @@ public class PlanoActuacaoDAO extends MainDAO
{ {
SelectQuery query = new SelectQuery( HsRiscoTema.class ); SelectQuery query = new SelectQuery( HsRiscoTema.class );
query.andQualifier( ExpressionFactory.matchExp( HsRiscoTema.DELETED_DATE_PROPERTY, null ) ); query.andQualifier( ExpressionFactory.matchExp( HsRiscoTema.DELETED_DATE_PROPERTY, null ) );
query.addOrdering( HsRiscoTema.DESCRIPTION_PROPERTY, true );
return context.performQuery( query ); return context.performQuery( query );
} }

@ -5,6 +5,7 @@ import java.util.List;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import leaf.ui.LeafError;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.Empresas; import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.Estabelecimentos; import siprp.database.cayenne.objects.Estabelecimentos;
@ -168,6 +169,8 @@ public class HigieneSegurancaLogic
} }
public static void reverterRelatorio( HsRelatorio relatorio ) public static void reverterRelatorio( HsRelatorio relatorio )
{
try
{ {
if(relatorio != null) if(relatorio != null)
{ {
@ -186,6 +189,10 @@ public class HigieneSegurancaLogic
relatorio.save(); relatorio.save();
} }
} }
} catch( Exception e )
{
LeafError.error(e);
}
} }
private static void reverterPostos( HsRelatorio relatorio, List<HsPostoEstabelecimento> postos ) private static void reverterPostos( HsRelatorio relatorio, List<HsPostoEstabelecimento> postos )

Loading…
Cancel
Save