PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → Sugestões de codigo para Webservice
Sugestões de codigo para Webservice
Iniciado por Adriano Boller, nov., 08 2019 1:10 AM - Sem resposta
Publicado em novembro, 08 2019 - 1:10 AM
Procedure Ws_Consultar_t000_Config(Token)

bufResult is Buffer
arrQuery is array of string

IF Token = GloToken

HOpenConnection(MyConnHfsql)
HChangeConnection("*",MyConnHfsql)

IF HExecuteQuery(QRY_T000_Config_Select,hQueryDefault+hCheckDuplicates+hCheckIntegrity) = True THEN

FOR EACH QRY_T000_Config_Select
Add(arrQuery,QRY_T000_Config_Select.t000_configID +";"+ QRY_T000_Config_Select.t000_descricao +";"+ QRY_T000_Config_Select.t000_valor)
END

Serialize(arrQuery,bufResult,psdXML)

END

END

RESULT bufResult




Procedure Ws_Incluir_t000_Config(Token,Valores)

ok is boolean

IF Token = GloToken AND StringCount(Valores,",",IgnoreCase) > 0 THEN

HOpenConnection(MyConnHfsql)
HChangeConnection("*",MyConnHfsql)

QRY_T000_Config_Insert.Paramt000_descricao = ExtractString(Valores,1,",",FromBeginning)
QRY_T000_Config_Insert.Paramt000_valor = ExtractString(Valores,2,",",FromBeginning)

IF HExecuteQuery(QRY_T000_Config_Insert,hQueryDefault+hCheckDuplicates+hCheckIntegrity) = True THEN

ok = True

END

END

RESULT ok




Procedure Ws_Alterar_t000_Config(Token, Valores)

ok is boolean

IF Token = GloToken AND StringCount(Valores,",",IgnoreCase) > 0 THEN

HOpenConnection(MyConnHfsql)
HChangeConnection("*",MyConnHfsql)

QRY_T000_Config_Update.Paramt000_configID = ExtractString(Valores,1,",",FromBeginning)
QRY_T000_Config_Update.Paramt000_descricao = ExtractString(Valores,2,",",FromBeginning)
QRY_T000_Config_Update.Paramt000_valor = ExtractString(Valores,3,",",FromBeginning)

IF HExecuteQuery(QRY_T000_Config_Update,hQueryDefault+hCheckDuplicates+hCheckIntegrity) = True THEN

ok = True

END

END

RESULT ok



Procedure Ws_Excluir_t000_Config(Token, ID)

ok is boolean

IF Token = GloToken AND ID > 0 THEN

HOpenConnection(MyConnHfsql)
HChangeConnection("*",MyConnHfsql)

QRY_T000_Config_Delete.Paramt000_configID = ID

IF HExecuteQuery(QRY_T000_Config_Delete,hQueryDefault+hCheckDuplicates+hCheckIntegrity) = True THEN

ok = True

END

END

RESULT ok