112 lines
3.2 KiB
ObjectPascal
112 lines
3.2 KiB
ObjectPascal
|
|
unit FirstSampleService_Impl;
|
||
|
|
|
||
|
|
{----------------------------------------------------------------------------}
|
||
|
|
{ This unit was automatically generated by the RemObjects SDK after reading }
|
||
|
|
{ the RODL file associated with this project . }
|
||
|
|
{ }
|
||
|
|
{ This is where you are supposed to code the implementation of your objects. }
|
||
|
|
{----------------------------------------------------------------------------}
|
||
|
|
|
||
|
|
interface
|
||
|
|
|
||
|
|
uses
|
||
|
|
{vcl:} Classes, SysUtils,
|
||
|
|
{RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions,
|
||
|
|
{Required:} uRORemoteDataModule,
|
||
|
|
{Generated:} FirstSample_Intf;
|
||
|
|
|
||
|
|
type
|
||
|
|
{ TFirstSampleService }
|
||
|
|
TFirstSampleService = class(TRORemoteDataModule, IFirstSampleService)
|
||
|
|
private
|
||
|
|
protected
|
||
|
|
{ IFirstSampleService methods }
|
||
|
|
function Nicknames(const FullName: string): string;
|
||
|
|
function VerifyName(const NickName: string; const FullName: string): Boolean;
|
||
|
|
function CheckName(const NickName: string): Boolean;
|
||
|
|
function FullNames(const Nickname: string): string;
|
||
|
|
end;
|
||
|
|
|
||
|
|
var
|
||
|
|
FirstSampleService: TFirstSampleService;
|
||
|
|
|
||
|
|
implementation
|
||
|
|
|
||
|
|
{$R *.dfm}
|
||
|
|
uses
|
||
|
|
{Generated:} FirstSample_Invk, FirstSampleServerMain;
|
||
|
|
|
||
|
|
procedure Create_FirstSampleService(out anInstance: IUnknown);
|
||
|
|
begin
|
||
|
|
anInstance := TFirstSampleService.Create(nil);
|
||
|
|
end;
|
||
|
|
|
||
|
|
{ FirstSampleService }
|
||
|
|
|
||
|
|
function TFirstSampleService.Nicknames(const FullName: string): string;
|
||
|
|
var
|
||
|
|
i: integer;
|
||
|
|
begin
|
||
|
|
Result := '';
|
||
|
|
with FirstSampleServerMainForm do begin
|
||
|
|
MultiReadSingleWriter.BeginRead;
|
||
|
|
try
|
||
|
|
with ValueListEditor.Strings do
|
||
|
|
for i := 0 to Count - 1 do
|
||
|
|
if (Fullname = '') or (CompareText(Values[Names[i]], FullName) = 0) then
|
||
|
|
Result := Result + ',' + Names[i];
|
||
|
|
finally
|
||
|
|
MultiReadSingleWriter.EndRead;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
if Result <> '' then Delete(Result, 1, 1);
|
||
|
|
end;
|
||
|
|
|
||
|
|
function TFirstSampleService.VerifyName(const NickName: string; const FullName: string): Boolean;
|
||
|
|
begin
|
||
|
|
with FirstSampleServerMainForm do begin
|
||
|
|
MultiReadSingleWriter.BeginRead;
|
||
|
|
try
|
||
|
|
with ValueListEditor.Strings do
|
||
|
|
Result := (IndexOfName(NickName) <> -1) and (CompareText(Values[NickName], FullName) = 0);
|
||
|
|
finally
|
||
|
|
MultiReadSingleWriter.EndRead;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
|
||
|
|
function TFirstSampleService.CheckName(const NickName: string): Boolean;
|
||
|
|
begin
|
||
|
|
with FirstSampleServerMainForm do begin
|
||
|
|
MultiReadSingleWriter.BeginRead;
|
||
|
|
try
|
||
|
|
Result := ValueListEditor.Strings.IndexOfName(NickName) <> -1;
|
||
|
|
finally
|
||
|
|
MultiReadSingleWriter.EndRead;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
|
||
|
|
function TFirstSampleService.FullNames(const Nickname: string): string;
|
||
|
|
begin
|
||
|
|
Result := '';
|
||
|
|
with FirstSampleServerMainForm do begin
|
||
|
|
MultiReadSingleWriter.BeginRead;
|
||
|
|
try
|
||
|
|
with ValueListEditor.Strings do
|
||
|
|
if IndexOfName(NickName) <> -1 then
|
||
|
|
Result := Values[NickName];
|
||
|
|
finally
|
||
|
|
MultiReadSingleWriter.EndRead;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
|
||
|
|
initialization
|
||
|
|
TROClassFactory.Create('FirstSampleService', Create_FirstSampleService, TFirstSampleService_Invoker);
|
||
|
|
|
||
|
|
finalization
|
||
|
|
|
||
|
|
end.
|
||
|
|
|