钉钉氚云到金碟之一:金碟KIS专业版的DELPHI接口

近段,在琢磨将钉钉氚云中的业务审批数据打通后直接转化为金碟KIS专业版中的凭证数据,实现业务财务一体化。

通过几天的努力,在网上资料一鳞半爪的情况下,还是成功地初步生成了凭证。看到金碟KIS的凭证窗口出现的程序自动写入凭证,成就感油然而生。

这是第一部分(待续),从金碟KIS插件,用DELHI7自动生成的接口库文件。派生来自于文件KISProfessionalPlugin.DLL。

=============

unit KISProfessionalPlugin_TLB;

// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //

// PASTLWTR : 1.2
// File generated on 2022/7/11 7:47:22 from Type Library described below.

// ************************************************************************  //
// Type Lib: C:\Windows\SysWOW64\KISCOM\KISProfessionalPlugin.dll (1)
// LIBID: {50D1DAB2-3A93-45F4-BCC3-BE4856B7A867}
// LCID: 0
// Helpfile:
// HelpString:
// DepndLst:
//   (1) v2.0 stdole, (C:\Windows\SysWOW64\stdole2.tlb)
//   (2) v2.5 ADODB, (C:\Program Files (x86)\Common Files\System\ado\msado25.tlb)
// Errors:
//   Error creating palette bitmap of (TVoucher) : Server C:\Windows\SysWow64\KISCOM\KISPROFESSIONALPLUGIN.DLL contains no icons
//   Error creating palette bitmap of (TVoucherEntry) : Server C:\Windows\SysWow64\KISCOM\KISPROFESSIONALPLUGIN.DLL contains no icons
//   Error creating palette bitmap of (TclsDataBase) : Server C:\Windows\SysWow64\KISCOM\KISPROFESSIONALPLUGIN.DLL contains no icons
// ************************************************************************ //
// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses
  Windows, ActiveX, ADODB_TLB, Classes, Graphics, OleServer, StdVCL, Variants;
  


// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
//   Type Libraries     : LIBID_xxxx
//   CoClasses          : CLASS_xxxx
//   DISPInterfaces     : DIID_xxxx
//   Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  KISProfessionalPluginMajorVersion = 1;
  KISProfessionalPluginMinorVersion = 0;
  LIBID_KISProfessionalPlugin: TGUID = '{50D1DAB2-3A93-45F4-BCC3-BE4856B7A867}';
  IID__Voucher: TGUID = '{5402A478-6BC9-427E-A23D-DC2F910C1F25}';
  CLASS_Voucher: TGUID = '{8A78EB2C-37EB-4BEF-B967-F5E3668B8B6E}';
  IID__VoucherEntry: TGUID = '{AF59AED7-308B-4786-BC2B-422A34A0285E}';
  CLASS_VoucherEntry: TGUID = '{62F132B4-D6B9-42C5-8F04-BF49F0710EE3}';
  IID__clsDataBase: TGUID = '{75EA5873-91E3-4617-9935-775AB2DE74A8}';
  CLASS_clsDataBase: TGUID = '{F6CC3A8E-4540-424D-83BE-26C06C1864C6}';

type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
  _Voucher = interface;

  _VoucherDisp = dispinterface;

  _VoucherEntry = interface;

  _VoucherEntryDisp = dispinterface;

  _clsDataBase = interface;

  _clsDataBaseDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
  Voucher = _Voucher;

  VoucherEntry = _VoucherEntry;

  clsDataBase = _clsDataBase;


// *********************************************************************//
// Interface: _Voucher
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {5402A478-6BC9-427E-A23D-DC2F910C1F25}
// *********************************************************************//
  _Voucher = interface(IDispatch)
    ['{5402A478-6BC9-427E-A23D-DC2F910C1F25}']
    function Get_VchID: Integer; safecall;
    function Get_VchNum: Smallint; safecall;
    procedure Set_VchNum(Param1: Smallint); safecall;
    function Get_VchGroup: WideString; safecall;
    procedure Set_VchGroup(const Param1: WideString); safecall;
    function Get_VchReference: WideString; safecall;
    procedure Set_VchReference(const Param1: WideString); safecall;
    function Get_VchSerialNum: Smallint; safecall;
    procedure Set_VchSerialNum(Param1: Smallint); safecall;
    function DeleteVoucher(lngVoucherID: Integer): WordBool; safecall;
    function Save: WordBool; safecall;
    function InsertEntry: WordBool; safecall;
    function Get_VouchEntry(index: Integer): _VoucherEntry; safecall;
    procedure Set_VouchEntry(index: Integer; const Param2: _VoucherEntry); safecall;
    function Get_VchDate: WideString; safecall;
    procedure Set_VchDate(const Param1: WideString); safecall;
    function Get_VchTranDate: WideString; safecall;
    procedure Set_VchTranDate(const Param1: WideString); safecall;
    function Get_VchAttachment: Smallint; safecall;
    procedure Set_VchAttachment(Param1: Smallint); safecall;
    function Get_nCount: Smallint; safecall;
    function Get_ErrNumber: Integer; safecall;
    function Get_ErrDescription: WideString; safecall;
    property VchID: Integer read Get_VchID;
    property VchNum: Smallint read Get_VchNum write Set_VchNum;
    property VchGroup: WideString read Get_VchGroup write Set_VchGroup;
    property VchReference: WideString read Get_VchReference write Set_VchReference;
    property VchSerialNum: Smallint read Get_VchSerialNum write Set_VchSerialNum;
    property VouchEntry[index: Integer]: _VoucherEntry read Get_VouchEntry write
      Set_VouchEntry;
    property VchDate: WideString read Get_VchDate write Set_VchDate;
    property VchTranDate: WideString read Get_VchTranDate write Set_VchTranDate;
    property VchAttachment: Smallint read Get_VchAttachment write Set_VchAttachment;
    property nCount: Smallint read Get_nCount;
    property ErrNumber: Integer read Get_ErrNumber;
    property ErrDescription: WideString read Get_ErrDescription;
  end;

// *********************************************************************//
// DispIntf:  _VoucherDisp
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {5402A478-6BC9-427E-A23D-DC2F910C1F25}
// *********************************************************************//
  _VoucherDisp = dispinterface
    ['{5402A478-6BC9-427E-A23D-DC2F910C1F25}']
    property VchID: Integer readonly dispid 1745027083;
    property VchNum: Smallint dispid 1745027082;
    property VchGroup: WideString dispid 1745027081;
    property VchReference: WideString dispid 1745027080;
    property VchSerialNum: Smallint dispid 1745027079;
    function DeleteVoucher(lngVoucherID: Integer): WordBool; dispid 1610809357;
    function Save: WordBool; dispid 1610809360;
    function InsertEntry: WordBool; dispid 1610809374;
    property VouchEntry[index: Integer]: _VoucherEntry dispid 1745027078;
    property VchDate: WideString dispid 1745027077;
    property VchTranDate: WideString dispid 1745027076;
    property VchAttachment: Smallint dispid 1745027075;
    property nCount: Smallint readonly dispid 1745027074;
    property ErrNumber: Integer readonly dispid 1745027073;
    property ErrDescription: WideString readonly dispid 1745027072;
  end;

// *********************************************************************//
// Interface: _VoucherEntry
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {AF59AED7-308B-4786-BC2B-422A34A0285E}
// *********************************************************************//
  _VoucherEntry = interface(IDispatch)
    ['{AF59AED7-308B-4786-BC2B-422A34A0285E}']
    function Get_AcctID: WideString; safecall;
    procedure Set_AcctID(const Param1: WideString); safecall;
    function Get_VchExp: WideString; safecall;
    procedure Set_VchExp(const Param1: WideString); safecall;
    function Get_VchCyid: WideString; safecall;
    procedure Set_VchCyid(const Param1: WideString); safecall;
    function Get_VchDebit: Currency; safecall;
    procedure Set_VchDebit(Param1: Currency); safecall;
    function Get_VchCredit: Currency; safecall;
    procedure Set_VchCredit(Param1: Currency); safecall;
    function Get_VchQty: Double; safecall;
    procedure Set_VchQty(Param1: Double); safecall;
    function Get_VchPrice: Double; safecall;
    procedure Set_VchPrice(Param1: Double); safecall;
    function Get_VchSettleNo: WideString; safecall;
    procedure Set_VchSettleNo(const Param1: WideString); safecall;
    function Get_VchSettleCode: WideString; safecall;
    procedure Set_VchSettleCode(const Param1: WideString); safecall;
    function Get_VchTransID: WideString; safecall;
    procedure Set_VchTransID(const Param1: WideString); safecall;
    function Get_ItemID: WideString; safecall;
    procedure Set_ItemID(const Param1: WideString); safecall;
    function Get_ExchangeRate: Double; safecall;
    procedure Set_ExchangeRate(Param1: Double); safecall;
    property AcctID: WideString read Get_AcctID write Set_AcctID;
    property VchExp: WideString read Get_VchExp write Set_VchExp;
    property VchCyid: WideString read Get_VchCyid write Set_VchCyid;
    property VchDebit: Currency read Get_VchDebit write Set_VchDebit;
    property VchCredit: Currency read Get_VchCredit write Set_VchCredit;
    property VchQty: Double read Get_VchQty write Set_VchQty;
    property VchPrice: Double read Get_VchPrice write Set_VchPrice;
    property VchSettleNo: WideString read Get_VchSettleNo write Set_VchSettleNo;
    property VchSettleCode: WideString read Get_VchSettleCode write Set_VchSettleCode;
    property VchTransID: WideString read Get_VchTransID write Set_VchTransID;
    property ItemID: WideString read Get_ItemID write Set_ItemID;
    property ExchangeRate: Double read Get_ExchangeRate write Set_ExchangeRate;
  end;

// *********************************************************************//
// DispIntf:  _VoucherEntryDisp
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {AF59AED7-308B-4786-BC2B-422A34A0285E}
// *********************************************************************//
  _VoucherEntryDisp = dispinterface
    ['{AF59AED7-308B-4786-BC2B-422A34A0285E}']
    property AcctID: WideString dispid 1745027083;
    property VchExp: WideString dispid 1745027082;
    property VchCyid: WideString dispid 1745027081;
    property VchDebit: Currency dispid 1745027080;
    property VchCredit: Currency dispid 1745027079;
    property VchQty: Double dispid 1745027078;
    property VchPrice: Double dispid 1745027077;
    property VchSettleNo: WideString dispid 1745027076;
    property VchSettleCode: WideString dispid 1745027075;
    property VchTransID: WideString dispid 1745027074;
    property ItemID: WideString dispid 1745027073;
    property ExchangeRate: Double dispid 1745027072;
  end;

// *********************************************************************//
// Interface: _clsDataBase
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {75EA5873-91E3-4617-9935-775AB2DE74A8}
// *********************************************************************//
  _clsDataBase = interface(IDispatch)
    ['{75EA5873-91E3-4617-9935-775AB2DE74A8}']
    function Get_Conn: _Connection; safecall;
    procedure BeginTrans; safecall;
    procedure CommitTrans; safecall;
    procedure RollBackTrans; safecall;
    procedure InitConnection(const strConnectionString: WideString); safecall;
    property Conn: _Connection read Get_Conn;
  end;

// *********************************************************************//
// DispIntf:  _clsDataBaseDisp
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {75EA5873-91E3-4617-9935-775AB2DE74A8}
// *********************************************************************//
  _clsDataBaseDisp = dispinterface
    ['{75EA5873-91E3-4617-9935-775AB2DE74A8}']
    property Conn: _Connection readonly dispid 1745027072;
    procedure BeginTrans; dispid 1610809345;
    procedure CommitTrans; dispid 1610809346;
    procedure RollBackTrans; dispid 1610809347;
    procedure InitConnection(const strConnectionString: WideString); dispid 1610809348;
  end;

// *********************************************************************//
// The Class CoVoucher provides a Create and CreateRemote method to
// create instances of the default interface _Voucher exposed by
// the CoClass Voucher. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
  CoVoucher = class
    class function Create: _Voucher;
    class function CreateRemote(const MachineName: string): _Voucher;
  end;


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object    : TVoucher
// Help String      :
// Default Interface: _Voucher
// Def. Intf. DISP? : No
// Event   Interface:
// TypeFlags        : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  TVoucherProperties = class;
{$ENDIF}

  TVoucher = class(TOleServer)
  private
    FIntf: _Voucher;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    FProps: TVoucherProperties;
    function GetServerProperties: TVoucherProperties;
{$ENDIF}
    function GetDefaultInterface: _Voucher;
  protected
    procedure InitServerData; override;
    function Get_VchID: Integer;
    function Get_VchNum: Smallint;
    procedure Set_VchNum(Param1: Smallint);
    function Get_VchGroup: WideString;
    procedure Set_VchGroup(const Param1: WideString);
    function Get_VchReference: WideString;
    procedure Set_VchReference(const Param1: WideString);
    function Get_VchSerialNum: Smallint;
    procedure Set_VchSerialNum(Param1: Smallint);
    function Get_VouchEntry(index: Integer): _VoucherEntry;
    procedure Set_VouchEntry(index: Integer; const Param2: _VoucherEntry);
    function Get_VchDate: WideString;
    procedure Set_VchDate(const Param1: WideString);
    function Get_VchTranDate: WideString;
    procedure Set_VchTranDate(const Param1: WideString);
    function Get_VchAttachment: Smallint;
    procedure Set_VchAttachment(Param1: Smallint);
    function Get_nCount: Smallint;
    function Get_ErrNumber: Integer;
    function Get_ErrDescription: WideString;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure Connect; override;
    procedure ConnectTo(svrIntf: _Voucher);
    procedure Disconnect; override;
    function DeleteVoucher(lngVoucherID: Integer): WordBool;
    function Save: WordBool;
    function InsertEntry: WordBool;
    property DefaultInterface: _Voucher read GetDefaultInterface;
    property VchID: Integer read Get_VchID;
    property VouchEntry[index: Integer]: _VoucherEntry read Get_VouchEntry write
      Set_VouchEntry;
    property nCount: Smallint read Get_nCount;
    property ErrNumber: Integer read Get_ErrNumber;
    property ErrDescription: WideString read Get_ErrDescription;
    property VchNum: Smallint read Get_VchNum write Set_VchNum;
    property VchGroup: WideString read Get_VchGroup write Set_VchGroup;
    property VchReference: WideString read Get_VchReference write Set_VchReference;
    property VchSerialNum: Smallint read Get_VchSerialNum write Set_VchSerialNum;
    property VchDate: WideString read Get_VchDate write Set_VchDate;
    property VchTranDate: WideString read Get_VchTranDate write Set_VchTranDate;
    property VchAttachment: Smallint read Get_VchAttachment write Set_VchAttachment;
  published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    property Server: TVoucherProperties read GetServerProperties;
{$ENDIF}
  end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object    : TVoucher
// (This object is used by the IDE's Property Inspector to allow editing
//  of the properties of this server)
// *********************************************************************//
  TVoucherProperties = class(TPersistent)
  private
    FServer: TVoucher;
    function GetDefaultInterface: _Voucher;
    constructor Create(AServer: TVoucher);
  protected
    function Get_VchID: Integer;
    function Get_VchNum: Smallint;
    procedure Set_VchNum(Param1: Smallint);
    function Get_VchGroup: WideString;
    procedure Set_VchGroup(const Param1: WideString);
    function Get_VchReference: WideString;
    procedure Set_VchReference(const Param1: WideString);
    function Get_VchSerialNum: Smallint;
    procedure Set_VchSerialNum(Param1: Smallint);
    function Get_VouchEntry(index: Integer): _VoucherEntry;
    procedure Set_VouchEntry(index: Integer; const Param2: _VoucherEntry);
    function Get_VchDate: WideString;
    procedure Set_VchDate(const Param1: WideString);
    function Get_VchTranDate: WideString;
    procedure Set_VchTranDate(const Param1: WideString);
    function Get_VchAttachment: Smallint;
    procedure Set_VchAttachment(Param1: Smallint);
    function Get_nCount: Smallint;
    function Get_ErrNumber: Integer;
    function Get_ErrDescription: WideString;
  public
    property DefaultInterface: _Voucher read GetDefaultInterface;
  published
    property VchNum: Smallint read Get_VchNum write Set_VchNum;
    property VchGroup: WideString read Get_VchGroup write Set_VchGroup;
    property VchReference: WideString read Get_VchReference write Set_VchReference;
    property VchSerialNum: Smallint read Get_VchSerialNum write Set_VchSerialNum;
    property VchDate: WideString read Get_VchDate write Set_VchDate;
    property VchTranDate: WideString read Get_VchTranDate write Set_VchTranDate;
    property VchAttachment: Smallint read Get_VchAttachment write Set_VchAttachment;
  end;
{$ENDIF}


// *********************************************************************//
// The Class CoVoucherEntry provides a Create and CreateRemote method to
// create instances of the default interface _VoucherEntry exposed by
// the CoClass VoucherEntry. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//

  CoVoucherEntry = class
    class function Create: _VoucherEntry;
    class function CreateRemote(const MachineName: string): _VoucherEntry;
  end;


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object    : TVoucherEntry
// Help String      :
// Default Interface: _VoucherEntry
// Def. Intf. DISP? : No
// Event   Interface:
// TypeFlags        : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  TVoucherEntryProperties = class;
{$ENDIF}

  TVoucherEntry = class(TOleServer)
  private
    FIntf: _VoucherEntry;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    FProps: TVoucherEntryProperties;
    function GetServerProperties: TVoucherEntryProperties;
{$ENDIF}
    function GetDefaultInterface: _VoucherEntry;
  protected
    procedure InitServerData; override;
    function Get_AcctID: WideString;
    procedure Set_AcctID(const Param1: WideString);
    function Get_VchExp: WideString;
    procedure Set_VchExp(const Param1: WideString);
    function Get_VchCyid: WideString;
    procedure Set_VchCyid(const Param1: WideString);
    function Get_VchDebit: Currency;
    procedure Set_VchDebit(Param1: Currency);
    function Get_VchCredit: Currency;
    procedure Set_VchCredit(Param1: Currency);
    function Get_VchQty: Double;
    procedure Set_VchQty(Param1: Double);
    function Get_VchPrice: Double;
    procedure Set_VchPrice(Param1: Double);
    function Get_VchSettleNo: WideString;
    procedure Set_VchSettleNo(const Param1: WideString);
    function Get_VchSettleCode: WideString;
    procedure Set_VchSettleCode(const Param1: WideString);
    function Get_VchTransID: WideString;
    procedure Set_VchTransID(const Param1: WideString);
    function Get_ItemID: WideString;
    procedure Set_ItemID(const Param1: WideString);
    function Get_ExchangeRate: Double;
    procedure Set_ExchangeRate(Param1: Double);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure Connect; override;
    procedure ConnectTo(svrIntf: _VoucherEntry);
    procedure Disconnect; override;
    property DefaultInterface: _VoucherEntry read GetDefaultInterface;
    property AcctID: WideString read Get_AcctID write Set_AcctID;
    property VchExp: WideString read Get_VchExp write Set_VchExp;
    property VchCyid: WideString read Get_VchCyid write Set_VchCyid;
    property VchDebit: Currency read Get_VchDebit write Set_VchDebit;
    property VchCredit: Currency read Get_VchCredit write Set_VchCredit;
    property VchQty: Double read Get_VchQty write Set_VchQty;
    property VchPrice: Double read Get_VchPrice write Set_VchPrice;
    property VchSettleNo: WideString read Get_VchSettleNo write Set_VchSettleNo;
    property VchSettleCode: WideString read Get_VchSettleCode write Set_VchSettleCode;
    property VchTransID: WideString read Get_VchTransID write Set_VchTransID;
    property ItemID: WideString read Get_ItemID write Set_ItemID;
    property ExchangeRate: Double read Get_ExchangeRate write Set_ExchangeRate;
  published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    property Server: TVoucherEntryProperties read GetServerProperties;
{$ENDIF}
  end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object    : TVoucherEntry
// (This object is used by the IDE's Property Inspector to allow editing
//  of the properties of this server)
// *********************************************************************//
  TVoucherEntryProperties = class(TPersistent)
  private
    FServer: TVoucherEntry;
    function GetDefaultInterface: _VoucherEntry;
    constructor Create(AServer: TVoucherEntry);
  protected
    function Get_AcctID: WideString;
    procedure Set_AcctID(const Param1: WideString);
    function Get_VchExp: WideString;
    procedure Set_VchExp(const Param1: WideString);
    function Get_VchCyid: WideString;
    procedure Set_VchCyid(const Param1: WideString);
    function Get_VchDebit: Currency;
    procedure Set_VchDebit(Param1: Currency);
    function Get_VchCredit: Currency;
    procedure Set_VchCredit(Param1: Currency);
    function Get_VchQty: Double;
    procedure Set_VchQty(Param1: Double);
    function Get_VchPrice: Double;
    procedure Set_VchPrice(Param1: Double);
    function Get_VchSettleNo: WideString;
    procedure Set_VchSettleNo(const Param1: WideString);
    function Get_VchSettleCode: WideString;
    procedure Set_VchSettleCode(const Param1: WideString);
    function Get_VchTransID: WideString;
    procedure Set_VchTransID(const Param1: WideString);
    function Get_ItemID: WideString;
    procedure Set_ItemID(const Param1: WideString);
    function Get_ExchangeRate: Double;
    procedure Set_ExchangeRate(Param1: Double);
  public
    property DefaultInterface: _VoucherEntry read GetDefaultInterface;
  published
    property AcctID: WideString read Get_AcctID write Set_AcctID;
    property VchExp: WideString read Get_VchExp write Set_VchExp;
    property VchCyid: WideString read Get_VchCyid write Set_VchCyid;
    property VchDebit: Currency read Get_VchDebit write Set_VchDebit;
    property VchCredit: Currency read Get_VchCredit write Set_VchCredit;
    property VchQty: Double read Get_VchQty write Set_VchQty;
    property VchPrice: Double read Get_VchPrice write Set_VchPrice;
    property VchSettleNo: WideString read Get_VchSettleNo write Set_VchSettleNo;
    property VchSettleCode: WideString read Get_VchSettleCode write Set_VchSettleCode;
    property VchTransID: WideString read Get_VchTransID write Set_VchTransID;
    property ItemID: WideString read Get_ItemID write Set_ItemID;
    property ExchangeRate: Double read Get_ExchangeRate write Set_ExchangeRate;
  end;
{$ENDIF}


// *********************************************************************//
// The Class CoclsDataBase provides a Create and CreateRemote method to
// create instances of the default interface _clsDataBase exposed by
// the CoClass clsDataBase. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//

  CoclsDataBase = class
    class function Create: _clsDataBase;
    class function CreateRemote(const MachineName: string): _clsDataBase;
  end;


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object    : TclsDataBase
// Help String      :
// Default Interface: _clsDataBase
// Def. Intf. DISP? : No
// Event   Interface:
// TypeFlags        : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  TclsDataBaseProperties = class;
{$ENDIF}

  TclsDataBase = class(TOleServer)
  private
    FIntf: _clsDataBase;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    FProps: TclsDataBaseProperties;
    function GetServerProperties: TclsDataBaseProperties;
{$ENDIF}
    function GetDefaultInterface: _clsDataBase;
  protected
    procedure InitServerData; override;
    function Get_Conn: _Connection;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure Connect; override;
    procedure ConnectTo(svrIntf: _clsDataBase);
    procedure Disconnect; override;
    procedure BeginTrans;
    procedure CommitTrans;
    procedure RollBackTrans;
    procedure InitConnection(const strConnectionString: WideString);
    property DefaultInterface: _clsDataBase read GetDefaultInterface;
    property Conn: _Connection read Get_Conn;
  published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    property Server: TclsDataBaseProperties read GetServerProperties;
{$ENDIF}
  end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object    : TclsDataBase
// (This object is used by the IDE's Property Inspector to allow editing
//  of the properties of this server)
// *********************************************************************//
  TclsDataBaseProperties = class(TPersistent)
  private
    FServer: TclsDataBase;
    function GetDefaultInterface: _clsDataBase;
    constructor Create(AServer: TclsDataBase);
  protected
    function Get_Conn: _Connection;
  public
    property DefaultInterface: _clsDataBase read GetDefaultInterface;
  published
  end;
{$ENDIF}

procedure Register;

resourcestring
  dtlServerPage = 'ActiveX';
  dtlOcxPage = 'ActiveX';

implementation

uses
  ComObj;

class function CoVoucher.Create: _Voucher;
begin
  Result := CreateComObject(CLASS_Voucher) as _Voucher;
end;

class function CoVoucher.CreateRemote(const MachineName: string): _Voucher;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_Voucher) as _Voucher;
end;

procedure TVoucher.InitServerData;
const
  CServerData: TServerData = (
    ClassID: '{8A78EB2C-37EB-4BEF-B967-F5E3668B8B6E}';
    IntfIID: '{5402A478-6BC9-427E-A23D-DC2F910C1F25}';
    EventIID: '';
    LicenseKey: nil;
    Version: 500
  );
begin
  ServerData := @CServerData;
end;

procedure TVoucher.Connect;
var
  punk: IUnknown;
begin
  if FIntf = nil then
  begin
    punk := GetServer;
    Fintf := punk as _Voucher;
  end;
end;

procedure TVoucher.ConnectTo(svrIntf: _Voucher);
begin
  Disconnect;
  FIntf := svrIntf;
end;

procedure TVoucher.DisConnect;
begin
  if Fintf <> nil then
  begin
    FIntf := nil;
  end;
end;

function TVoucher.GetDefaultInterface: _Voucher;
begin
  if FIntf = nil then
    Connect;
  Assert(FIntf <> nil,
    'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  Result := FIntf;
end;

constructor TVoucher.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TVoucherProperties.Create(Self);
{$ENDIF}
end;

destructor TVoucher.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps.Free;
{$ENDIF}
  inherited Destroy;
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TVoucher.GetServerProperties: TVoucherProperties;
begin
  Result := FProps;
end;
{$ENDIF}

function TVoucher.Get_VchID: Integer;
begin
  Result := DefaultInterface.VchID;
end;

function TVoucher.Get_VchNum: Smallint;
begin
  Result := DefaultInterface.VchNum;
end;

procedure TVoucher.Set_VchNum(Param1: Smallint);
begin
  DefaultInterface.Set_VchNum(Param1);
end;

function TVoucher.Get_VchGroup: WideString;
begin
  Result := DefaultInterface.VchGroup;
end;

procedure TVoucher.Set_VchGroup(const Param1: WideString);
  { Warning: The property VchGroup has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchGroup := Param1;
end;

function TVoucher.Get_VchReference: WideString;
begin
  Result := DefaultInterface.VchReference;
end;

procedure TVoucher.Set_VchReference(const Param1: WideString);
  { Warning: The property VchReference has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchReference := Param1;
end;

function TVoucher.Get_VchSerialNum: Smallint;
begin
  Result := DefaultInterface.VchSerialNum;
end;

procedure TVoucher.Set_VchSerialNum(Param1: Smallint);
begin
  DefaultInterface.Set_VchSerialNum(Param1);
end;

function TVoucher.Get_VouchEntry(index: Integer): _VoucherEntry;
begin
  Result := DefaultInterface.VouchEntry[index];
end;

procedure TVoucher.Set_VouchEntry(index: Integer; const Param2: _VoucherEntry);
begin
  DefaultInterface.VouchEntry[index] := Param2;
end;

function TVoucher.Get_VchDate: WideString;
begin
  Result := DefaultInterface.VchDate;
end;

procedure TVoucher.Set_VchDate(const Param1: WideString);
  { Warning: The property VchDate has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchDate := Param1;
end;

function TVoucher.Get_VchTranDate: WideString;
begin
  Result := DefaultInterface.VchTranDate;
end;

procedure TVoucher.Set_VchTranDate(const Param1: WideString);
  { Warning: The property VchTranDate has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchTranDate := Param1;
end;

function TVoucher.Get_VchAttachment: Smallint;
begin
  Result := DefaultInterface.VchAttachment;
end;

procedure TVoucher.Set_VchAttachment(Param1: Smallint);
begin
  DefaultInterface.Set_VchAttachment(Param1);
end;

function TVoucher.Get_nCount: Smallint;
begin
  Result := DefaultInterface.nCount;
end;

function TVoucher.Get_ErrNumber: Integer;
begin
  Result := DefaultInterface.ErrNumber;
end;

function TVoucher.Get_ErrDescription: WideString;
begin
  Result := DefaultInterface.ErrDescription;
end;

function TVoucher.DeleteVoucher(lngVoucherID: Integer): WordBool;
begin
  Result := DefaultInterface.DeleteVoucher(lngVoucherID);
end;

function TVoucher.Save: WordBool;
begin
  Result := DefaultInterface.Save;
end;

function TVoucher.InsertEntry: WordBool;
begin
  Result := DefaultInterface.InsertEntry;
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TVoucherProperties.Create(AServer: TVoucher);
begin
  inherited Create;
  FServer := AServer;
end;

function TVoucherProperties.GetDefaultInterface: _Voucher;
begin
  Result := FServer.DefaultInterface;
end;

function TVoucherProperties.Get_VchID: Integer;
begin
  Result := DefaultInterface.VchID;
end;

function TVoucherProperties.Get_VchNum: Smallint;
begin
  Result := DefaultInterface.VchNum;
end;

procedure TVoucherProperties.Set_VchNum(Param1: Smallint);
begin
  DefaultInterface.Set_VchNum(Param1);
end;

function TVoucherProperties.Get_VchGroup: WideString;
begin
  Result := DefaultInterface.VchGroup;
end;

procedure TVoucherProperties.Set_VchGroup(const Param1: WideString);
  { Warning: The property VchGroup has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchGroup := Param1;
end;

function TVoucherProperties.Get_VchReference: WideString;
begin
  Result := DefaultInterface.VchReference;
end;

procedure TVoucherProperties.Set_VchReference(const Param1: WideString);
  { Warning: The property VchReference has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchReference := Param1;
end;

function TVoucherProperties.Get_VchSerialNum: Smallint;
begin
  Result := DefaultInterface.VchSerialNum;
end;

procedure TVoucherProperties.Set_VchSerialNum(Param1: Smallint);
begin
  DefaultInterface.Set_VchSerialNum(Param1);
end;

function TVoucherProperties.Get_VouchEntry(index: Integer): _VoucherEntry;
begin
  Result := DefaultInterface.VouchEntry[index];
end;

procedure TVoucherProperties.Set_VouchEntry(index: Integer; const Param2: _VoucherEntry);
begin
  DefaultInterface.VouchEntry[index] := Param2;
end;

function TVoucherProperties.Get_VchDate: WideString;
begin
  Result := DefaultInterface.VchDate;
end;

procedure TVoucherProperties.Set_VchDate(const Param1: WideString);
  { Warning: The property VchDate has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchDate := Param1;
end;

function TVoucherProperties.Get_VchTranDate: WideString;
begin
  Result := DefaultInterface.VchTranDate;
end;

procedure TVoucherProperties.Set_VchTranDate(const Param1: WideString);
  { Warning: The property VchTranDate has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchTranDate := Param1;
end;

function TVoucherProperties.Get_VchAttachment: Smallint;
begin
  Result := DefaultInterface.VchAttachment;
end;

procedure TVoucherProperties.Set_VchAttachment(Param1: Smallint);
begin
  DefaultInterface.Set_VchAttachment(Param1);
end;

function TVoucherProperties.Get_nCount: Smallint;
begin
  Result := DefaultInterface.nCount;
end;

function TVoucherProperties.Get_ErrNumber: Integer;
begin
  Result := DefaultInterface.ErrNumber;
end;

function TVoucherProperties.Get_ErrDescription: WideString;
begin
  Result := DefaultInterface.ErrDescription;
end;

{$ENDIF}

class function CoVoucherEntry.Create: _VoucherEntry;
begin
  Result := CreateComObject(CLASS_VoucherEntry) as _VoucherEntry;
end;

class function CoVoucherEntry.CreateRemote(const MachineName: string): _VoucherEntry;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_VoucherEntry) as _VoucherEntry;
end;

procedure TVoucherEntry.InitServerData;
const
  CServerData: TServerData = (
    ClassID: '{62F132B4-D6B9-42C5-8F04-BF49F0710EE3}';
    IntfIID: '{AF59AED7-308B-4786-BC2B-422A34A0285E}';
    EventIID: '';
    LicenseKey: nil;
    Version: 500
  );
begin
  ServerData := @CServerData;
end;

procedure TVoucherEntry.Connect;
var
  punk: IUnknown;
begin
  if FIntf = nil then
  begin
    punk := GetServer;
    Fintf := punk as _VoucherEntry;
  end;
end;

procedure TVoucherEntry.ConnectTo(svrIntf: _VoucherEntry);
begin
  Disconnect;
  FIntf := svrIntf;
end;

procedure TVoucherEntry.DisConnect;
begin
  if Fintf <> nil then
  begin
    FIntf := nil;
  end;
end;

function TVoucherEntry.GetDefaultInterface: _VoucherEntry;
begin
  if FIntf = nil then
    Connect;
  Assert(FIntf <> nil,
    'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  Result := FIntf;
end;

constructor TVoucherEntry.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TVoucherEntryProperties.Create(Self);
{$ENDIF}
end;

destructor TVoucherEntry.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps.Free;
{$ENDIF}
  inherited Destroy;
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TVoucherEntry.GetServerProperties: TVoucherEntryProperties;
begin
  Result := FProps;
end;
{$ENDIF}

function TVoucherEntry.Get_AcctID: WideString;
begin
  Result := DefaultInterface.AcctID;
end;

procedure TVoucherEntry.Set_AcctID(const Param1: WideString);
  { Warning: The property AcctID has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.AcctID := Param1;
end;

function TVoucherEntry.Get_VchExp: WideString;
begin
  Result := DefaultInterface.VchExp;
end;

procedure TVoucherEntry.Set_VchExp(const Param1: WideString);
  { Warning: The property VchExp has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchExp := Param1;
end;

function TVoucherEntry.Get_VchCyid: WideString;
begin
  Result := DefaultInterface.VchCyid;
end;

procedure TVoucherEntry.Set_VchCyid(const Param1: WideString);
  { Warning: The property VchCyid has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchCyid := Param1;
end;

function TVoucherEntry.Get_VchDebit: Currency;
begin
  Result := DefaultInterface.VchDebit;
end;

procedure TVoucherEntry.Set_VchDebit(Param1: Currency);
begin
  DefaultInterface.Set_VchDebit(Param1);
end;

function TVoucherEntry.Get_VchCredit: Currency;
begin
  Result := DefaultInterface.VchCredit;
end;

procedure TVoucherEntry.Set_VchCredit(Param1: Currency);
begin
  DefaultInterface.Set_VchCredit(Param1);
end;

function TVoucherEntry.Get_VchQty: Double;
begin
  Result := DefaultInterface.VchQty;
end;

procedure TVoucherEntry.Set_VchQty(Param1: Double);
begin
  DefaultInterface.Set_VchQty(Param1);
end;

function TVoucherEntry.Get_VchPrice: Double;
begin
  Result := DefaultInterface.VchPrice;
end;

procedure TVoucherEntry.Set_VchPrice(Param1: Double);
begin
  DefaultInterface.Set_VchPrice(Param1);
end;

function TVoucherEntry.Get_VchSettleNo: WideString;
begin
  Result := DefaultInterface.VchSettleNo;
end;

procedure TVoucherEntry.Set_VchSettleNo(const Param1: WideString);
  { Warning: The property VchSettleNo has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchSettleNo := Param1;
end;

function TVoucherEntry.Get_VchSettleCode: WideString;
begin
  Result := DefaultInterface.VchSettleCode;
end;

procedure TVoucherEntry.Set_VchSettleCode(const Param1: WideString);
  { Warning: The property VchSettleCode has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchSettleCode := Param1;
end;

function TVoucherEntry.Get_VchTransID: WideString;
begin
  Result := DefaultInterface.VchTransID;
end;

procedure TVoucherEntry.Set_VchTransID(const Param1: WideString);
  { Warning: The property VchTransID has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchTransID := Param1;
end;

function TVoucherEntry.Get_ItemID: WideString;
begin
  Result := DefaultInterface.ItemID;
end;

procedure TVoucherEntry.Set_ItemID(const Param1: WideString);
  { Warning: The property ItemID has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.ItemID := Param1;
end;

function TVoucherEntry.Get_ExchangeRate: Double;
begin
  Result := DefaultInterface.ExchangeRate;
end;

procedure TVoucherEntry.Set_ExchangeRate(Param1: Double);
begin
  DefaultInterface.Set_ExchangeRate(Param1);
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TVoucherEntryProperties.Create(AServer: TVoucherEntry);
begin
  inherited Create;
  FServer := AServer;
end;

function TVoucherEntryProperties.GetDefaultInterface: _VoucherEntry;
begin
  Result := FServer.DefaultInterface;
end;

function TVoucherEntryProperties.Get_AcctID: WideString;
begin
  Result := DefaultInterface.AcctID;
end;

procedure TVoucherEntryProperties.Set_AcctID(const Param1: WideString);
  { Warning: The property AcctID has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.AcctID := Param1;
end;

function TVoucherEntryProperties.Get_VchExp: WideString;
begin
  Result := DefaultInterface.VchExp;
end;

procedure TVoucherEntryProperties.Set_VchExp(const Param1: WideString);
  { Warning: The property VchExp has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchExp := Param1;
end;

function TVoucherEntryProperties.Get_VchCyid: WideString;
begin
  Result := DefaultInterface.VchCyid;
end;

procedure TVoucherEntryProperties.Set_VchCyid(const Param1: WideString);
  { Warning: The property VchCyid has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchCyid := Param1;
end;

function TVoucherEntryProperties.Get_VchDebit: Currency;
begin
  Result := DefaultInterface.VchDebit;
end;

procedure TVoucherEntryProperties.Set_VchDebit(Param1: Currency);
begin
  DefaultInterface.Set_VchDebit(Param1);
end;

function TVoucherEntryProperties.Get_VchCredit: Currency;
begin
  Result := DefaultInterface.VchCredit;
end;

procedure TVoucherEntryProperties.Set_VchCredit(Param1: Currency);
begin
  DefaultInterface.Set_VchCredit(Param1);
end;

function TVoucherEntryProperties.Get_VchQty: Double;
begin
  Result := DefaultInterface.VchQty;
end;

procedure TVoucherEntryProperties.Set_VchQty(Param1: Double);
begin
  DefaultInterface.Set_VchQty(Param1);
end;

function TVoucherEntryProperties.Get_VchPrice: Double;
begin
  Result := DefaultInterface.VchPrice;
end;

procedure TVoucherEntryProperties.Set_VchPrice(Param1: Double);
begin
  DefaultInterface.Set_VchPrice(Param1);
end;

function TVoucherEntryProperties.Get_VchSettleNo: WideString;
begin
  Result := DefaultInterface.VchSettleNo;
end;

procedure TVoucherEntryProperties.Set_VchSettleNo(const Param1: WideString);
  { Warning: The property VchSettleNo has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchSettleNo := Param1;
end;

function TVoucherEntryProperties.Get_VchSettleCode: WideString;
begin
  Result := DefaultInterface.VchSettleCode;
end;

procedure TVoucherEntryProperties.Set_VchSettleCode(const Param1: WideString);
  { Warning: The property VchSettleCode has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchSettleCode := Param1;
end;

function TVoucherEntryProperties.Get_VchTransID: WideString;
begin
  Result := DefaultInterface.VchTransID;
end;

procedure TVoucherEntryProperties.Set_VchTransID(const Param1: WideString);
  { Warning: The property VchTransID has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.VchTransID := Param1;
end;

function TVoucherEntryProperties.Get_ItemID: WideString;
begin
  Result := DefaultInterface.ItemID;
end;

procedure TVoucherEntryProperties.Set_ItemID(const Param1: WideString);
  { Warning: The property ItemID has a setter and a getter whose
    types do not match. Delphi was unable to generate a property of
    this sort and so is using a Variant as a passthrough. }
var
  InterfaceVariant: OleVariant;
begin
  InterfaceVariant := DefaultInterface;
  InterfaceVariant.ItemID := Param1;
end;

function TVoucherEntryProperties.Get_ExchangeRate: Double;
begin
  Result := DefaultInterface.ExchangeRate;
end;

procedure TVoucherEntryProperties.Set_ExchangeRate(Param1: Double);
begin
  DefaultInterface.Set_ExchangeRate(Param1);
end;

{$ENDIF}

class function CoclsDataBase.Create: _clsDataBase;
begin
  Result := CreateComObject(CLASS_clsDataBase) as _clsDataBase;
end;

class function CoclsDataBase.CreateRemote(const MachineName: string): _clsDataBase;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_clsDataBase) as _clsDataBase;
end;

procedure TclsDataBase.InitServerData;
const
  CServerData: TServerData = (
    ClassID: '{F6CC3A8E-4540-424D-83BE-26C06C1864C6}';
    IntfIID: '{75EA5873-91E3-4617-9935-775AB2DE74A8}';
    EventIID: '';
    LicenseKey: nil;
    Version: 500
  );
begin
  ServerData := @CServerData;
end;

procedure TclsDataBase.Connect;
var
  punk: IUnknown;
begin
  if FIntf = nil then
  begin
    punk := GetServer;
    Fintf := punk as _clsDataBase;
  end;
end;

procedure TclsDataBase.ConnectTo(svrIntf: _clsDataBase);
begin
  Disconnect;
  FIntf := svrIntf;
end;

procedure TclsDataBase.DisConnect;
begin
  if Fintf <> nil then
  begin
    FIntf := nil;
  end;
end;

function TclsDataBase.GetDefaultInterface: _clsDataBase;
begin
  if FIntf = nil then
    Connect;
  Assert(FIntf <> nil,
    'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  Result := FIntf;
end;

constructor TclsDataBase.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TclsDataBaseProperties.Create(Self);
{$ENDIF}
end;

destructor TclsDataBase.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps.Free;
{$ENDIF}
  inherited Destroy;
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TclsDataBase.GetServerProperties: TclsDataBaseProperties;
begin
  Result := FProps;
end;
{$ENDIF}

function TclsDataBase.Get_Conn: _Connection;
begin
  Result := DefaultInterface.Conn;
end;

procedure TclsDataBase.BeginTrans;
begin
  DefaultInterface.BeginTrans;
end;

procedure TclsDataBase.CommitTrans;
begin
  DefaultInterface.CommitTrans;
end;

procedure TclsDataBase.RollBackTrans;
begin
  DefaultInterface.RollBackTrans;
end;

procedure TclsDataBase.InitConnection(const strConnectionString: WideString);
begin
  DefaultInterface.InitConnection(strConnectionString);
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TclsDataBaseProperties.Create(AServer: TclsDataBase);
begin
  inherited Create;
  FServer := AServer;
end;

function TclsDataBaseProperties.GetDefaultInterface: _clsDataBase;
begin
  Result := FServer.DefaultInterface;
end;

function TclsDataBaseProperties.Get_Conn: _Connection;
begin
  Result := DefaultInterface.Conn;
end;

{$ENDIF}

procedure Register;
begin
  RegisterComponents(dtlServerPage, [TVoucher, TVoucherEntry, TclsDataBase]);
end;

end.
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值