Fórum Colocar mensagem #176770
22/08/2003
0
BOA TARDE SENHORES, ESTOU NOVAMENTE EM SÉRIOS APUROS COM UM SISTEMA DE PONTO QUE ESTOU FAZENDO, GOSTARIA DE SABER COMO FAÇO PARA CADASTRAR UMA CAMPO QUE POSSUO EM UMA OUTRA TABELA NUMA TABELA DE CONTROLE QUE CRIEI.
EX.: TENHO UMA TABELA AONDE DEFINI ´BOM DIA´ ; ´BOM ALMOÇO´ E ASSIM POR DIANTE, GOSTARIA QUE QUANDO O USUÁRIO PASASSE O SEU CARTÃO EM HORÁRIOS ESTABELECIDOS, ESSAS MENSAGENS FOSSEM CADASTRADAS DENTRO DA TABELA CONTROLE, OU QUE EU PUDESSE VIZUALIZAR AS MESMAS PESQUISANDO PELO ´CPF´ DO USUÁRIO.
ATENCIOSAMENTE
EX.: TENHO UMA TABELA AONDE DEFINI ´BOM DIA´ ; ´BOM ALMOÇO´ E ASSIM POR DIANTE, GOSTARIA QUE QUANDO O USUÁRIO PASASSE O SEU CARTÃO EM HORÁRIOS ESTABELECIDOS, ESSAS MENSAGENS FOSSEM CADASTRADAS DENTRO DA TABELA CONTROLE, OU QUE EU PUDESSE VIZUALIZAR AS MESMAS PESQUISANDO PELO ´CPF´ DO USUÁRIO.
ATENCIOSAMENTE
Rscrj
Curtir tópico
+ 0
Responder
Posts
23/08/2003
Bacalhau
Primeiro passo: detectas a hora e guardas numa variável do tipo TTime
var hora :: TTime;
<aqui é detectada a hora>
if ((hora >= strtotime(´09:00:00´)) and (hora <= strtotime(´10:30:00´))
then <mostra bom dia>;
if ((hora >= strtotime(´12:00:00´)) and (hora <= strtotime(´14:30:00´))
then <mostra bom almoço>
e por aí fora.
Como é óbvio, na tabela que contém as mensagens tem de haver uma forma de lhe aceder através da hora a que passou o cartão.
Por exemplo
if ((hora >= strtotime(´09:00:00´)) and (hora >= strtotime(´10:30:00´))
then
begin
table1.open;
table1.first;
table1.moveby(5)
showmessage(table1.fieldbyname(´Mensagem´).asstring);
// nesta caso se é de manhã (entre as 9 e 10:30), mostra a mensagem
// contida no 5º registo da tabela. Haverá muitos outros processos
end;
Abraço
bacalhau
var hora :: TTime;
<aqui é detectada a hora>
if ((hora >= strtotime(´09:00:00´)) and (hora <= strtotime(´10:30:00´))
then <mostra bom dia>;
if ((hora >= strtotime(´12:00:00´)) and (hora <= strtotime(´14:30:00´))
then <mostra bom almoço>
e por aí fora.
Como é óbvio, na tabela que contém as mensagens tem de haver uma forma de lhe aceder através da hora a que passou o cartão.
Por exemplo
if ((hora >= strtotime(´09:00:00´)) and (hora >= strtotime(´10:30:00´))
then
begin
table1.open;
table1.first;
table1.moveby(5)
showmessage(table1.fieldbyname(´Mensagem´).asstring);
// nesta caso se é de manhã (entre as 9 e 10:30), mostra a mensagem
// contida no 5º registo da tabela. Haverá muitos outros processos
end;
Abraço
bacalhau
Responder
Gostei + 0
25/08/2003
Rscrj
A Ajuda veio em boa hora, o controle esta funcionando perfeitamente.
Obrigado.
Obrigado.
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)