mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
This commit is contained in:
parent
47a5d91b23
commit
7863944182
@ -396,6 +396,7 @@ begin
|
||||
// end;
|
||||
|
||||
// this maybe the id of the newly created person
|
||||
LogI(Person);
|
||||
Result := Random(1000);
|
||||
end;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user