forked from Coded/SIPRP
				
			git-svn-id: https://svn.coded.pt/svn/SIPRP@727 bb69d46d-e84e-40c8-a05a-06db0d633741
	
		
	
				
					
				
			
							parent
							
								
									7198774813
								
							
						
					
					
						commit
						ffff4064f2
					
				| @ -1,31 +0,0 @@ | |||||||
| /* |  | ||||||
|  * LembretesPanel.java |  | ||||||
|  * |  | ||||||
|  * Created on February 6, 2007, 5:14 PM |  | ||||||
|  * |  | ||||||
|  * To change this template, choose Tools | Template Manager |  | ||||||
|  * and open the template in the editor. |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| package siprp.lembretes; |  | ||||||
| 
 |  | ||||||
| import java.awt.*; |  | ||||||
| import javax.swing.*; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * |  | ||||||
|  * @author fpalma |  | ||||||
|  */ |  | ||||||
| public class LembretesPanel extends JPanel |  | ||||||
| { |  | ||||||
| 	 |  | ||||||
| 	/** Creates a new instance of LembretesPanel */ |  | ||||||
| 	public LembretesPanel() |  | ||||||
| 	{ |  | ||||||
| 		setupComponents(); |  | ||||||
| 	} |  | ||||||
| 	 |  | ||||||
| 	private void setupComponents() |  | ||||||
| 	{ |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
| @ -0,0 +1,69 @@ | |||||||
|  | /* | ||||||
|  |  * LembretesRemarcacaoPanel.java | ||||||
|  |  * | ||||||
|  |  * Created on 13 de Fevereiro de 2007, 23:24 | ||||||
|  |  * | ||||||
|  |  * To change this template, choose Tools | Template Manager | ||||||
|  |  * and open the template in the editor. | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | package siprp.lembretes.marcacoes; | ||||||
|  | 
 | ||||||
|  | import java.awt.BorderLayout; | ||||||
|  | import java.awt.GridLayout; | ||||||
|  | 
 | ||||||
|  | import javax.swing.JLabel; | ||||||
|  | import javax.swing.JPanel; | ||||||
|  | import javax.swing.JScrollPane; | ||||||
|  | 
 | ||||||
|  | import siprp.lembretes.LembretesConstants; | ||||||
|  | 
 | ||||||
|  | import com.evolute.utils.jdo.JDOProvider; | ||||||
|  | import com.evolute.utils.ui.panel.multipleactionlist.MultipleActionListPanel; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | public class LembretesMarcacaoPanel extends JPanel | ||||||
|  | 	implements LembretesConstants | ||||||
|  | { | ||||||
|  | 	protected JScrollPane listTrabalhadoresScroll; | ||||||
|  | 	protected MultipleActionListPanel listTrabalhadoresPanel; | ||||||
|  | 	 | ||||||
|  | 	protected MarcacoesDataProvider provider; | ||||||
|  | 	 | ||||||
|  | 	private final Integer empresaID; | ||||||
|  | 	private final Integer estabelecimentoID; | ||||||
|  | 	 | ||||||
|  | 	private JDOProvider JDO; | ||||||
|  | 	 | ||||||
|  | 	/** Creates a new instance of LembretesRemarcacaoPanel */ | ||||||
|  | 	public LembretesMarcacaoPanel( Integer empresaID, Integer estabelecimentoID ) | ||||||
|  | 		throws Exception | ||||||
|  | 	{ | ||||||
|  | 		this.empresaID = empresaID; | ||||||
|  | 		this.estabelecimentoID = estabelecimentoID; | ||||||
|  | 		provider = MarcacoesDataProvider.getProvider(); | ||||||
|  | 		setupComponents(); | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	private void setupComponents() | ||||||
|  | 		throws Exception | ||||||
|  | 	{ | ||||||
|  | 		listTrabalhadoresPanel =  | ||||||
|  | 				new MultipleActionListPanel(  | ||||||
|  | 					new MarcacoesActionFactory[]{ }, | ||||||
|  | 					new MarcacoesActionFactory[]{ new MarcacoesActionFactory( MarcacoesActionFactory.TRABALHADOR ) } ); | ||||||
|  | 		listTrabalhadoresScroll =  | ||||||
|  | 			new JScrollPane( listTrabalhadoresPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, | ||||||
|  | 								JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); | ||||||
|  | 		setLayout( new GridLayout( 1, 2 ) ); | ||||||
|  | 		JPanel trabalhadoresPanel = new JPanel(); | ||||||
|  | 		add( trabalhadoresPanel ); | ||||||
|  | 		 | ||||||
|  | 		trabalhadoresPanel.setLayout( new BorderLayout() ); | ||||||
|  | 		trabalhadoresPanel.add( new JLabel( "Consultas / ECDs", JLabel.CENTER ), BorderLayout.NORTH ); | ||||||
|  | 		trabalhadoresPanel.add( listTrabalhadoresScroll, BorderLayout.CENTER ); | ||||||
|  | 	 | ||||||
|  | 		listTrabalhadoresPanel.showList( provider.getLembretesMarcacaoTrabalhador( empresaID, estabelecimentoID ) ); | ||||||
|  | //		listEstabelecimentosPanel.showList( estabelecimentos.toArray( new IDObject[ estabelecimentos.size() ] ) );
 | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @ -0,0 +1,54 @@ | |||||||
|  | /* | ||||||
|  |  * RemarcacoesActionFactory.java | ||||||
|  |  * | ||||||
|  |  * Created on January 31, 2007, 6:37 PM | ||||||
|  |  * | ||||||
|  |  * To change this template, choose Tools | Template Manager | ||||||
|  |  * and open the template in the editor. | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | package siprp.lembretes.marcacoes; | ||||||
|  | 
 | ||||||
|  | import javax.swing.Action; | ||||||
|  | 
 | ||||||
|  | import siprp.lembretes.marcacoes.actions.TratarCriacaoProcessoTrabalhadorAction; | ||||||
|  | 
 | ||||||
|  | import com.evolute.utils.data.IDObject; | ||||||
|  | import com.evolute.utils.ui.panel.multipleactionlist.ActionFactory; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * | ||||||
|  |  * @author fpalma | ||||||
|  |  */ | ||||||
|  | public class MarcacoesActionFactory implements ActionFactory<IDObject> | ||||||
|  | { | ||||||
|  | 	public static final int TRABALHADOR = 0; | ||||||
|  | 	 | ||||||
|  | 	protected final int TIPO; | ||||||
|  | 	 | ||||||
|  | 	/** | ||||||
|  | 	 * Creates a new instance of RemarcacoesActionFactory | ||||||
|  | 	 */ | ||||||
|  | 	public MarcacoesActionFactory( int tipo ) | ||||||
|  | 	{ | ||||||
|  | 		TIPO = tipo; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public Action createAction(IDObject[] objects) | ||||||
|  | 	{ | ||||||
|  | 		return null; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public Action createAction(IDObject object) | ||||||
|  | 	{ | ||||||
|  | 		switch( TIPO ) | ||||||
|  | 		{ | ||||||
|  | 			case TRABALHADOR: | ||||||
|  | 				return new TratarCriacaoProcessoTrabalhadorAction( object ); | ||||||
|  | 				 | ||||||
|  | 			default: | ||||||
|  | 				return null; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | } | ||||||
| @ -0,0 +1,61 @@ | |||||||
|  | /* | ||||||
|  |  * V8_1_To_V8_2.java | ||||||
|  |  * | ||||||
|  |  * Created on December 19, 2007, 3:12 PM | ||||||
|  |  * | ||||||
|  |  * To change this template, choose Tools | Template Manager | ||||||
|  |  * and open the template in the editor. | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | package siprp.update.updates; | ||||||
|  | 
 | ||||||
|  | import com.evolute.utils.Singleton; | ||||||
|  | import com.evolute.utils.db.DBManager; | ||||||
|  | import com.evolute.utils.db.Executer; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * | ||||||
|  |  * @author fpalma | ||||||
|  |  */ | ||||||
|  | public class V8_8_To_V8_9 | ||||||
|  | 		implements siprp.update.Update | ||||||
|  | { | ||||||
|  | 	 | ||||||
|  | 	/** | ||||||
|  | 	 * Creates a new instance of V8_6_To_V8_7 | ||||||
|  | 	 */ | ||||||
|  | 	public V8_8_To_V8_9() | ||||||
|  | 	{ | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	public String []listChanges() | ||||||
|  | 	{ | ||||||
|  | 		return new String[]{ "Adicionada coluna em 'lembretes' para marcar lembretes já tratados" }; | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	public double getStartVersion() | ||||||
|  | 	{ | ||||||
|  | 		return 8.8; | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	public double getEndVersion() | ||||||
|  | 	{ | ||||||
|  | 		return 8.9; | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	public void doUpdate() | ||||||
|  | 		throws Exception | ||||||
|  | 	{ | ||||||
|  | 		DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER ); | ||||||
|  | 		Executer executer = dbm.getSharedExecuter(); | ||||||
|  | 		com.evolute.utils.sql.Update update =  | ||||||
|  | 			new com.evolute.utils.sql.Update(  | ||||||
|  | 				"alter table lembretes add column deleted_date timestamp;" ); | ||||||
|  | 		executer.executeQuery( update ); | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	public String toString() | ||||||
|  | 	{ | ||||||
|  | 		return "v" + getStartVersion() + " para v" + getEndVersion(); | ||||||
|  | 	} | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in new issue