segunda-feira, 14 de março de 2016

WX - Aplicativo de armazenamento de fotos de Funcionários



Forum.pcsoft.fr/fr-FR/pcsoft.br.windev/292-aplicativo-armazenamento-fotos-funcionarios-335/read.awp?hl=funcionarios



Estrutura Table


>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 12 juin 2015 - 01:30
Cadastro Realizado com Sucesso


>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 12 juin 2015 - 01:31
//Le registro - ao clicar no browser embed code listbrowser: "Select Row"

ImagemBuffer is Buffer=""

EDT_Matricula=TABLE_NG0021_FotoTaxista[TABLE_NG0021_FotoTaxista].COL_Matricula

EDT_Nome=TABLE_NG0021_FotoTaxista[TABLE_NG0021_FotoTaxista].COL_Nome

EDT_Foto=TABLE_NG0021_FotoTaxista[TABLE_NG0021_FotoTaxista].COL_Foto

ImagemBuffer=Uncrypt(EDT_Foto,"",compressLZW+cryptAnsi,encodeBASE64)

IMG_Foto=ImagemBuffer

ExecuteProcess(IMG_Foto,trtChange)
>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 12 juin 2015 - 01:32
//Botao Incluir

IFEDT_Matricula<>""ANDEDT_Nome<>""ANDEDT_Foto<>""

ok isboolean=HExecuteQuery(QRY_Insert_FotoTaxista,hQueryDefault,EDT_Matricula,EDT_Nome,EDT_Foto)

IFok=TrueTHEN

Info("Gravou")

ELSE

Info(ErrorInfo())

END

TableDisplay(TABLE_NG0021_FotoTaxista,taReExecuteQuery)
TableDisplay(TABLE_NG0021_FotoTaxista,taInit)

ELSE
Info("Campos obrigatorios em branco")
END
>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 12 juin 2015 - 01:32
//Botao Alterar

IFEDT_Matricula<>""ANDEDT_Nome<>""ANDEDT_Foto<>""THEN

ok isboolean=HExecuteQuery(QRY_Update_FotoTaxista,hQueryDefault,EDT_Nome,EDT_Foto,EDT_Matricula)

IFok=TrueTHEN

Info("Gravou")

ELSE

Info(ErrorInfo())

END

TableDisplay(TABLE_NG0021_FotoTaxista,taReExecuteQuery)

TableDisplay(TABLE_NG0021_FotoTaxista,taInit)

ELSE
Info("Campos obrigatorios em branco")
END
>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 12 juin 2015 - 01:33
//Botão Excluir

IFEDT_Matricula<>""THEN

ok isboolean=HExecuteQuery(QRY_Delete_FotoTaxista,hQueryDefault,EDT_Matricula)

IFok=TrueTHEN

Info("Excluiu")

ELSE

Info(ErrorInfo())

END

TableDisplay(TABLE_NG0021_FotoTaxista,taReExecuteQuery)

TableDisplay(TABLE_NG0021_FotoTaxista,taInit)

ELSE
Info("Matricula em branco")
END
>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 12 juin 2015 - 01:38
Querys:

--//QRY_Delete_FotoTaxista
DELETE FROM
NG0021_FotoTaxista
WHERE
NG0021_FotoTaxista.Matricula= {pMatricula}



--//QRY_Insert_FotoTaxista
INSERT INTONG0021_FotoTaxista
(
Matricula,
Nome,
Foto
)
VALUES
(
{pMatricula},
{pNome},
{pFoto}
)



--//QRY_Select_FotoTaxista
SELECT
NG0021_FotoTaxista.MatriculaASMatricula,
NG0021_FotoTaxista.NomeASNome,
NG0021_FotoTaxista.FotoASFoto
FROM
NG0021_FotoTaxista



--//QRY_Select_FotoTaxista_Filtro
SELECT
NG0021_FotoTaxista.MatriculaASMatricula,
NG0021_FotoTaxista.NomeASNome,
NG0021_FotoTaxista.FotoASFoto
FROM
NG0021_FotoTaxista
WHERE
NG0021_FotoTaxista.Matricula= {pMatricula}



--//QRY_Update_FotoTaxista
UPDATE
NG0021_FotoTaxista
SET
Nome= {pNome},
Foto= {pFoto}
WHERE
NG0021_FotoTaxista.Matricula= {pMatricula}



-- Script generated by WinDev on 11/06/2015 20:38:07
-- Tables of FotoTaxista.wda analysis
-- for SQL Server

-- Creating the NG0021_FotoTaxista table
CREATETABLE[dbo.NG0021_FotoTaxista] (
[Matricula]INTEGERNOTNULLUNIQUEDEFAULT0,
[Nome]NVARCHAR(50)DEFAULT NULL,
[Foto]TEXT DEFAULT NULL);


>Obs.: Projeto é todo em ANSI




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 12 juin 2015 - 01:39
Atenção: Para consumir em um webservice é o mesmo metodo que ocorre ao clicar no Browserlist.




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 12 juin 2015 - 01:39
:merci:>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 22 juin 2015 - 21:21
//pra enviar:

ImagemString=Crypt(ImagemBuffer,"",cryptNone,encodeBASE64)

//para receber

ImagemString=Uncrypt(ImagemBuffer,"",cryptNone,encodeBASE64)



//Na versão 20 teve uma melhoria nesse processo usando o seguinte função nova chamada "cryptstandard":

//pra enviar:
sMessage is Buffer="Message à crypter"
bufCle is Buffer=HashString(HA_MD5_128,"mdp")
sRetorno is Buffer=CryptStandard(sMessage,bufCle,cryptAES128)


//para receber
Info(UncryptStandard(sRetorno,bufCle,cryptAES128))
>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 22 juin 2015 - 21:33
OBS.: É obrigatório o base64, mas não pode ser comprimido nas duas pontas, se colocar pra ser comprimido nao funciona.
>o ansi é pro windows, criptansi não pode no android.




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 23 juin 2015 - 19:11
//WINDEV MOBILE + Taget CODE

NoANDROID=
ImagemBuffer=Uncrypt(XML_Retorno,"",cryptNone)

NoiOS=
ImagemBuffer=Uncrypt(XML_Retorno,"",cryptNone,encodeBASE64)

----


//WINDEV DESKTOP OU WEBDEV
//Para enviar a foto para o servidor no Busca Foto - Webservice - banco de dados - tabela com campo varchar(max)

EDT_Foto=""

EDT_PathArquivo=""

sPhoto isstring=""

ImagemBuffer is Buffer=""

bufKey is Buffer=""

ImagemString isstring=""

sPhoto=fImageSelect(fExeDir,,"")

IFsPhoto~= “THEN

RETURN

ELSE

ImagemBuffer=fLoadBuffer(sPhoto)

ImagemString=Crypt(ImagemBuffer,"",cryptNone,encodeBASE64)

EDT_Foto=ImagemString

IMG_Foto=sPhoto

ExecuteProcess(IMG_Foto,trtChange)

END
>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 23 juin 2015 - 19:15

>




0
0




Membre enregistré
1 540 messages
Popularité : +89 (91 votes)
Posté le 23 juin 2015 - 19:16
Obs.: No Android a base 64 é default sendo necessário fazer um Target Code para o iOS pois ele necessita desse paramet








Teste

Teste
teste