1
good afternoon!
I have a problem and I’d like to see if you can help me.
I have a Datasnap server, which is working normally. In it, I include and query in the database by mobile devices.
In the function where I register, it is configured like this...
function TSM.updateClientes(TObjJSON: TJSONObject): TJSONValue;
var
vCliente: TCliente;
begin
vCliente:=TJson.JsonToObject<TCliente>(TObjJSON.ToJSON);
try
tbUsuarios.Open;
if not (tbUsuarios.Locate('email', vCliente.Email,[])) then
begin
tbUsuarios.Append;
tbUsuarios.FieldByName('nome').AsString:=vCliente.Nome;
tbUsuarios.FieldByName('email').AsString:=vCliente.Email;
tbUsuarios.FieldByName('login').AsString:='@'+vCliente.Login;
tbUsuarios.FieldByName('senha').AsString:=Encode64(vCliente.Senha, IndyTextEncoding_UTF8);
tbUsuarios.FieldByName('data_cadastro').AsDateTime:=Now;
tbUsuarios.Insert;
Result:=TJSONString.Create('Cadastro realizado com sucesso.');
end
else
begin
Result:=TJSONString.Create('Email já cadastrado.');
end;
finally
tbUsuarios.Close;
VCliente.Free;
end;
end;
I can print those Tjsonstring in a Tmemo, via Bind Visually, but I can’t get the value of these messages and put them in a Showmessage for example. In Tmemo, it is displayed as below (Jsonvalue)...
{
"result":
[
"Cadastro realizado com sucesso."
]
}
Someone knows how to tell me how to pick up only these messages Result by the client?
From now on, I thank you all!