|
|
|
|
@ -149,25 +149,28 @@ public class UtilizadoresDataProvider {
|
|
|
|
|
Statement st = createStatement();
|
|
|
|
|
String sql = "SELECT * FROM utilizadores WHERE id = " + id;
|
|
|
|
|
ResultSet rs = st.executeQuery(sql);
|
|
|
|
|
rs.first();
|
|
|
|
|
u.setId(new Integer(rs.getInt("id")));
|
|
|
|
|
u.setLogin(rs.getString("login"));
|
|
|
|
|
u.setPassword(rs.getString("password"));
|
|
|
|
|
u.setData_password(rs.getDate("data_password"));
|
|
|
|
|
u.setEmail(rs.getString("email"));
|
|
|
|
|
u.setEmpresa_id(new Integer(rs.getInt("empresa_id")));
|
|
|
|
|
u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id")));
|
|
|
|
|
u.setAdministrador(rs.getString("administrador"));
|
|
|
|
|
u.setTipo(new Integer(rs.getInt("tipo")));
|
|
|
|
|
u.setNumero_cedula(rs.getString("numero_cedula"));
|
|
|
|
|
u.setCap(rs.getString("cap"));
|
|
|
|
|
u.setNome(rs.getString("nome"));
|
|
|
|
|
u.setMedico_id(new Integer(rs.getInt("medico_id")));
|
|
|
|
|
u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id")));
|
|
|
|
|
u.setActivo(rs.getString("activo"));
|
|
|
|
|
u.setResponsavel_loja(rs.getString("responsavel_loja"));
|
|
|
|
|
u.setGestor_geral(rs.getString("gestor_geral"));
|
|
|
|
|
u.setApagado(rs.getString("apagado"));
|
|
|
|
|
|
|
|
|
|
if ( rs.first() )
|
|
|
|
|
{
|
|
|
|
|
u.setId(new Integer(rs.getInt("id")));
|
|
|
|
|
u.setLogin(rs.getString("login"));
|
|
|
|
|
u.setPassword(rs.getString("password"));
|
|
|
|
|
u.setData_password(rs.getDate("data_password"));
|
|
|
|
|
u.setEmail(rs.getString("email"));
|
|
|
|
|
u.setEmpresa_id(new Integer(rs.getInt("empresa_id")));
|
|
|
|
|
u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id")));
|
|
|
|
|
u.setAdministrador(rs.getString("administrador"));
|
|
|
|
|
u.setTipo(new Integer(rs.getInt("tipo")));
|
|
|
|
|
u.setNumero_cedula(rs.getString("numero_cedula"));
|
|
|
|
|
u.setCap(rs.getString("cap"));
|
|
|
|
|
u.setNome(rs.getString("nome"));
|
|
|
|
|
u.setMedico_id(new Integer(rs.getInt("medico_id")));
|
|
|
|
|
u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id")));
|
|
|
|
|
u.setActivo(rs.getString("activo"));
|
|
|
|
|
u.setResponsavel_loja(rs.getString("responsavel_loja"));
|
|
|
|
|
u.setGestor_geral(rs.getString("gestor_geral"));
|
|
|
|
|
u.setApagado(rs.getString("apagado"));
|
|
|
|
|
}
|
|
|
|
|
return u;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|