waddemoserviceimpl.~pas

来自「Delphi开发webservice的一套例子」· ~PAS 代码 · 共 49 行

~PAS
49
字号
{ Invokable implementation declaration unit for TWADDemoService,
  which implements IWADDemoService }

unit WADDemoServiceImpl;

interface

uses
  WADDemoServiceIntf, InvokeRegistry, XSBuiltIns, Sysutils;

type
  TWADDemoService = class(TInterfacedObject, IWADDemoService)
    // Make sure you have your invokable logic implemented in IWADDemoService
    // first, then use CodeInsight(tm) to fill in this implementation
    // section by pressing Ctrl+Space, marking all the interface
    // declarations for IWADDemoService, and pressing Enter.
    // Once the declarations are inserted here, use ClassCompletion(tm)
    // to write the implementation stubs by pressing Ctrl+Shift+C
  public
    function BuyBooks(const sBookName, sMemberID  : String;
                      const iCopies : Integer; bDate : TXSDate;
                      var iConfirmID : Integer; var cDate : TXSDate) : Boolean; stdcall;
  end;

implementation

procedure WADDemoServiceFactory(out Obj: TObject);
begin
  Obj := TWADDemoService.Create;
end;

{ TWADDemoService }

function TWADDemoService.BuyBooks(const sBookName, sMemberID: String;
  const iCopies: Integer; bDate: TXSDate; var iConfirmID: Integer;
  var cDate: TXSDate): Boolean;
begin
  Randomize;
  iConfirmID := Random(10000);
  cDate.AsDate := Now;
  Result := True;

end;

initialization
  InvRegistry.RegisterInvokableClass(TWADDemoService, @WADDemoServiceFactory);

end.
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?