Dalsi zmeny
This commit is contained in:
@ -42,6 +42,11 @@ type
|
||||
function GetByParams (params: TDictionary<string, string>): TObjectList<TEMPNadoba>;
|
||||
end;
|
||||
|
||||
TEMPVytezeniDoklService = class(TServiceBase)
|
||||
public
|
||||
function FPrij_PostByID (const AID: integer): TJSONObject; // vrati se identifikace od providera
|
||||
end;
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
@ -50,6 +55,9 @@ uses
|
||||
FireDAC.Stan.Option,
|
||||
FireDAC.Comp.Client,
|
||||
FireDAC.Stan.Param,
|
||||
System.JSON.Builders,
|
||||
System.JSON.Writers,
|
||||
System.JSON.Types,
|
||||
MVCFramework.FireDAC.Utils,
|
||||
MVCFramework.DataSet.Utils,
|
||||
MVCFramework.Serializer.Commons,
|
||||
@ -195,7 +203,7 @@ uses
|
||||
try
|
||||
if not(lQry.EOF) then
|
||||
begin
|
||||
result:= FDM.sqlQry1.AsObject<TEMPNadoba>
|
||||
result:= FDM.sqlQry1.AsObject<TEMPNadoba>;
|
||||
end
|
||||
else
|
||||
raise EServiceException.Create('N<>doba s <20><>slem ' + ACislo + ' nebyla nalezena.');
|
||||
@ -239,4 +247,31 @@ uses
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
{ TEMPVytezeniDoklService }
|
||||
|
||||
function TEMPVytezeniDoklService.FPrij_PostByID (const AID: integer): TJSONObject; // vrati se identifikace od providera
|
||||
var lSQL, statusOut: string;
|
||||
resVal: TJSONObject;
|
||||
sB: TStringBuilder;
|
||||
sW: TStringWriter;
|
||||
w: TJsonTextWriter;
|
||||
b: TJSONObjectBuilder;
|
||||
p: TJSONCollectionBuilder.TPairs;
|
||||
begin
|
||||
result:= TJSONObject.Create;
|
||||
statusOut:= 'Not OK';
|
||||
|
||||
sB:= TStringBuilder.Create;
|
||||
sW:= TStringWriter.Create (sB);
|
||||
w:= TJsonTextWriter (sW);
|
||||
w.Formatting:= TJsonFormatting.Indented;
|
||||
b:= TJsonObjectBuilder.Create (w);
|
||||
p:= b.BeginObject.Add('status', statusOut);
|
||||
p.EndObject;
|
||||
result.FromJSON (sB.ToString);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user