no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@288 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Luis Flores 19 years ago
parent 7e1a032f4f
commit 9cc0f7d8b6

@ -0,0 +1,90 @@
/*
* LembretesDataProvider.java
*
* Created on February 5, 2007, 6:09 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package siprp.lembretes;
import com.evolute.utils.Singleton;
import com.evolute.utils.arrays.Virtual2DArray;
import com.evolute.utils.db.DBManager;
import com.evolute.utils.db.Executer;
import com.evolute.utils.sql.Field;
import com.evolute.utils.sql.Select;
import java.util.Date;
/**
*
* @author lflores
*/
public class LembretesDataProvider
{
private static final Object LOCK = new Object();
private static LembretesDataProvider instance = null;
private Executer EXECUTER;
/** Creates a new instance of LembretesDataProvider */
public LembretesDataProvider()
throws Exception
{
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
EXECUTER = dbm.getSharedExecuter( this );
}
public static LembretesDataProvider getProvider()
throws Exception
{
synchronized( LOCK )
{
if( instance == null )
{
instance = new LembretesDataProvider();
}
}
return instance;
}
public TipoLembrete[] getTiposLembrete()
throws Exception
{
Select select =
new Select( new String[]{ "lembretes_tipos" },
new String[]{ "id", "codigo", "descricao", "ordem" },
new Field( "activo" ).isEqual( "y" ),
new String[]{ "ordem" },
null );
Virtual2DArray array = EXECUTER.executeQuery( select );
TipoLembrete tipos[] = new TipoLembrete[ array.columnLength() ];
for( int n = 0; n < tipos.length; n++ )
{
Integer id = ( Integer ) array.get( n, 0 );
String codigo = ( String ) array.get( n, 1 );
String descricao = ( String ) array.get( n, 2 );
Integer ordem = ( Integer ) array.get( n, 3 );
tipos[ n ] = new TipoLembrete( id, codigo, descricao, ordem );
}
return tipos;
}
public void criarLembretes( Integer tipoID,
Date data,
String descricao,
String texto,
Integer empresaID,
Integer estabelecimentoID,
Integer trabalhadorID,
Integer marcacaoEstabelecimentoID,
Integer marcacaoTrabalhadorID,
boolean enviarEmail,
Integer periodicidadeDias,
Integer periodicidade_meses )
throws Exception
{
}
}

@ -0,0 +1,65 @@
/*
* TipoLembrete.java
*
* Created on February 5, 2007, 6:28 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package siprp.lembretes;
import com.evolute.utils.data.IDObject;
/**
*
* @author lflores
*/
public class TipoLembrete
implements IDObject, Comparable
{
protected Integer id;
protected String codigo;
protected String descricao;
protected Integer ordem;
/** Creates a new instance of TipoLembrete */
public TipoLembrete( Integer id, String codigo, String descricao,
Integer ordem )
{
this.id = id;
this.codigo = codigo;
this.descricao = descricao;
this.ordem = ordem;
}
public Integer getID()
{
return id;
}
protected String getCodigo()
{
return codigo;
}
protected String getDescricao()
{
return descricao;
}
protected Integer getOrdem()
{
return ordem;
}
public int compareTo( Object other )
{
if( !( other instanceof TipoLembrete ) )
{
return 0;
}
TipoLembrete otl = ( TipoLembrete ) other;
return getOrdem().compareTo( otl.getOrdem() );
}
}

@ -23,4 +23,11 @@ public interface MedicinaConstants
public static final Integer MOTIVO_OCASIONAL_INTEGER = new Integer( MOTIVO_OCASIONAL ); public static final Integer MOTIVO_OCASIONAL_INTEGER = new Integer( MOTIVO_OCASIONAL );
public static final int MOTIVO_PERIODICO_INICIAL = 5; public static final int MOTIVO_PERIODICO_INICIAL = 5;
public static final Integer MOTIVO_PERIODICO_INICIAL_INTEGER = new Integer( MOTIVO_PERIODICO_INICIAL ); public static final Integer MOTIVO_PERIODICO_INICIAL_INTEGER = new Integer( MOTIVO_PERIODICO_INICIAL );
public static final int ESTADO_POR_REALIZAR = 0;
public static final int ESTADO_PARCIALMENTE_REALIZADO = 1;
public static final int ESTADO_REALIZADO = 2;
public static final int ESTADO_DESMARCADO_TRABALHADOR = 3;
public static final int ESTADO_DESMARCADO_EMPRESA = 4;
public static final int ESTADO_FALTOU = 5;
} }

@ -29,12 +29,7 @@ import siprp.data.*;
public class MedicinaDataProvider extends MetaProvider public class MedicinaDataProvider extends MetaProvider
implements MedicinaConstants implements MedicinaConstants
{ {
public static final int ESTADO_POR_REALIZAR = 0;
public static final int ESTADO_PARCIALMENTE_REALIZADO = 1;
public static final int ESTADO_REALIZADO = 2;
public static final int ESTADO_DESMARCADO_TRABALHADOR = 3;
public static final int ESTADO_DESMARCADO_EMPRESA = 4;
public static final int ESTADO_FALTOU = 5;
public static final String TIPOS_CONSULTAS[] = public static final String TIPOS_CONSULTAS[] =
new String[]{ "", "Admiss\u00e3o", "Peri\u00f3dico", "Ocasional", "", "Peri\u00f3dico inicial" }; new String[]{ "", "Admiss\u00e3o", "Peri\u00f3dico", "Ocasional", "", "Peri\u00f3dico inicial" };

@ -0,0 +1,63 @@
/*
* PresencasDataProvider.java
*
* Created on February 5, 2007, 5:51 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package siprp.medicina.presencas;
import com.evolute.utils.Singleton;
import com.evolute.utils.db.DBManager;
import com.evolute.utils.db.Executer;
import com.evolute.utils.sql.Assignment;
import com.evolute.utils.sql.Field;
import com.evolute.utils.sql.Update;
import siprp.medicina.MedicinaConstants;
/**
*
* @author lflores
*/
public class PresencasDataProvider
implements MedicinaConstants
{
private static final Object LOCK = new Object();
private static PresencasDataProvider instance = null;
private Executer EXECUTER;
/** Creates a new instance of PresencasDataProvider */
public PresencasDataProvider()
throws Exception
{
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
EXECUTER = dbm.getSharedExecuter( this );
}
public static PresencasDataProvider getProvider()
throws Exception
{
synchronized( LOCK )
{
if( instance == null )
{
instance = new PresencasDataProvider();
}
}
return instance;
}
public void marcarFaltou( Integer id )
throws Exception
{
Update update =
new Update( "marcacoes_trabalhador",
new Assignment[]{
},
new Field( "id" ).isEqual( id ) );
EXECUTER.executeQuery( update );
}
}

@ -37,4 +37,5 @@ public class FaltouAction extends AbstractAction
{ {
} }
} }

Loading…
Cancel
Save