Small refactoring
Some checks are pending
TOC Generator / TOC Generator (push) Waiting to run

This commit is contained in:
Daniele Teti 2024-10-10 17:36:54 +02:00
parent 47a5d91b23
commit 7863944182
2 changed files with 9 additions and 7 deletions

View File

@ -396,6 +396,7 @@ begin
// end;
// this maybe the id of the newly created person
LogI(Person);
Result := Random(1000);
end;

View File

@ -312,11 +312,12 @@ begin
// Remember that TObject descendants (but TDataset, TJDOJSONObject and TJDOJSONArray)
// are serialized as JSON objects, so you can always read the JSON object
// lJSON := Resp.Result.AsObject as TJsonObject;
// lbPerson.Items.Add('First Name:'.PadRight(15) + lJSON.S['firstname']);
// lbPerson.Items.Add('Last Name:'.PadRight(15) + lJSON.S['lastname']);
// lbPerson.Items.Add('Married:'.PadRight(15) + lJSON.B['married'].ToString(TUseBoolStrs.True));
// lbPerson.Items.Add('DOB:'.PadRight(15) + DateToStr(lJSON.D['dob']));
// var lJSON := lResp.Result.AsObject as TJsonObject;
// lbPerson.Items.Add('First Name:'.PadRight(15) + lJSON.S['firstname']);
// lbPerson.Items.Add('Last Name:'.PadRight(15) + lJSON.S['lastname']);
// lbPerson.Items.Add('Married:'.PadRight(15) + lJSON.B['married'].ToString(TUseBoolStrs.True));
// lbPerson.Items.Add('DOB:'.PadRight(15) + DateToStr(lJSON.D['dob']));
var lPerson := TPerson.Create;
try
lResp.ResultAs(lPerson);
@ -747,9 +748,9 @@ begin
FDMemTable1.Active := False;
lReq := TJSONRPCRequest.Create(Random(1000), 'getcustomers');
lReq.Params.AddByName('FilterString', edtFilter.Text);
lResp := FExecutor.ExecuteRequest('/jsonrpc', lReq, jrpcPOST);
lResp := FExecutor.ExecuteRequest('/jsonrpc', lReq);
FDMemTable1.Active := True;
FDMemTable1.LoadFromTValue(lResp.Result);
FDMemTable1.LoadFromJSONRPCResponse(lResp);
FDMemTable1.First;
end;