📄 userserviceimpl.pas
字号:
{ Invokable implementation File for TUserService which implements IUserService }
unit UserServiceImpl;
interface
uses InvokeRegistry, classes,Types, XSBuiltIns,uUserMaint, UserServiceIntf;
type
{ TUserService }
TUserService = class(TInvokableClass, IUserService)
public
function GetDepList(out iCount:integer):TStringDynArray;stdcall;
function GetUserList(strName:String): String; stdcall;
function UpdateUserData(UserData:String):integer; stdcall;
end;
implementation
function TUserService.GetDepList(out iCount:integer):TStringDynArray;
var
ObjUser:TUserMaint;
i:integer;
tmpstrs:TStrings;
begin
tmpstrs:=TStringlist.Create;
ObjUser:=TUserMaint.create;
tmpstrs.Assign (ObjUser.GetDepList);
iCount:=tmpstrs.Count;
SetLength(result,iCount);
for i:=0 to iCount-1 do
Result[i]:=tmpstrs.Strings[i];
tmpstrs.Free;
ObjUser.free;
end;
function TUserService.GetUserList(strName:String): String;
var
ObjUser:TUserMaint;
begin
ObjUser:=TUserMaint.create;
try
result:=ObjUser.GetUserList(strName);
finally
ObjUser.free;
end;
end;
function TUserService.UpdateUserData(UserData:String):integer;
var
ObjUser:TUserMaint;
begin
ObjUser:=TUserMaint.create;
try
result:=ObjUser.UpdateUserData(UserData);
finally
ObjUser.free;
end;
end;
initialization
{ Invokable classes must be registered }
InvRegistry.RegisterInvokableClass(TUserService);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -