transmanageri.pas

来自「拥有全套神州数码马易飞ERP源码,现上传部分源码」· PAS 代码 · 共 46 行

PAS
46
字号
unit TransManagerI;

interface

uses
  ComObj, ActiveX, Classes, SysUtils, Forms, Dialogs, TransManager_TLB, TransManagerD;

type
  TTxnManager = class(TAutoObject, ITxnManager)
  private
    aTxnObj : TbaseTxnDM;
  protected
    function DoIt(xValue: OleVariant): WordBool; safecall;
    function Get_ErrorCode: Integer; safecall;
    function Get_ErrorDescript: WideString; safecall;
    procedure CloseCom; safecall;
    function Get_ResultDesc: OleVariant; safecall;
    function Get_ReturnSeq: WideString; safecall;
    { Protected declarations }
  end;

  TbaseTxnDMClass = class of TbaseTxnDM;

implementation

uses ComServ;

function TTxnManager.DoIt(xValue: OleVariant): WordBool;
var
  mTxnCode:string;
  mResult:Boolean;
begin
  Result:=False;
  mTxnCode:=UpperCase(xValue[0]);

  try
    aTxnObj := (TbaseTxnDMClass(getClass(mTxnCode))).Create(nil);
  except
    showMessage('You must registerClass('+mTxnCode+') first !');
    exit;
  end;
  aTxnObj.Option := xValue;
  try
    aTxnObj.DoIt(mResult);
    if ((aTxnObj.Rollbacks = 0) and (aTxnObj.Total > 0)) then
//    if (aTxnObj.Rollbacks = 0) then  //虫ō礚戈

⌨️ 快捷键说明

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