static function TSystemUtils.ReadUserInfo(const AScope, AID: string; var AValue: string; AStream: TStream): Boolean;
var
lQuery: TQuery;
begin
lQuery := TQuery.Create(nil);
try
lQuery.ConnectionString := cSysDatabaseConnectionString;
if Assigned(AStream) then
lQuery.CommandText := SysUtils.Format(cSQL_GetResInfo_2_ex, [BizSys.BizSystem.ClientAccount])
else
lQuery.CommandText := SysUtils.Format(cSQL_GetResInfo_1_ex, [BizSys.BizSystem.ClientAccount]);
with lQuery.Params do
begin
ParamByName('SCOPE').AsString := cUserScope + AScope;
ParamByName('ID').AsString := AID;
end;
lQuery.Open;
if lQuery.IsEmpty then
Result := False
else
begin
AValue := lQuery.FieldByName('FINFOVALUE').AsString;
if Assigned(AStream) then
with TBlobField(lQuery.FieldByName('FINFOVALUEEXT')) do
if not IsNull then SaveToStream(AStream);
Result := True;
end;
finally
lQuery.Free;
end;
end;