⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dmdemomodule.pas

📁 Delphi三层原代码掩饰及补丁
💻 PAS
字号:
unit dmDemoModule;

interface

uses
  SysUtils, Variants, Classes, dmBaseModuleImp, hmStrTools, hmSqlTools, hmDateTools, hmTimeTools;

type
  TdmDemo = class(TBaseDataModule)
  protected
    function ActionList(CmdIndex: integer; var Data, Msg: OleVariant): WordBool; override;
    function Action1(var Data, Msg: OleVariant): WordBool;
    function Action2(var Data, Msg: OleVariant): WordBool;
    function Action3(var Data, Msg: OleVariant): WordBool;
  end;

  TdmDemoInfo = class(TBaseDataModuleInfo)
  public
    function GetModuleName: WideString; override; stdcall;
    function GetVersion: Widestring; override; stdcall;
    function GetMemo: Widestring; override; stdcall;
    function GetLastUpdate: WideString; override; stdcall;
    function GetModuleIndex: Integer; override; stdcall;
  end;

implementation

uses DB, swModuleIndex;

{ TdmSystem }

function TdmDemo.ActionList(CmdIndex: integer; var Data, Msg: OleVariant): WordBool;
begin
  case CmdIndex of
    1: Result := Action1(Data, Msg);
    2: Result := Action2(Data, Msg);
    3: Result := Action3(Data, Msg);
  else
    Result := inherited ActionList(CmdIndex, Data, Msg);
  end;
end;

function TdmDemo.Action1(var Data, Msg: OleVariant): WordBool;
begin
  Self.CheckTranstion;
  try
    Service.BeginTrans;
    StoreProc.LoadFromStore(100006);
    StoreProc['@mm_id'] := '1389';
    StoreProc['@mm_pay'] := 1.15;
    Service.Execute(StoreProc.SqlLanguage);
    StoreProc['@mm_id'] := '0877';
    StoreProc['@mm_pay'] := 0.88;
    Service.Execute(StoreProc.SqlLanguage);
    Service.CommitTrans;
    Service.ReceiveDataWithNoData;
    Msg := 'Update Price Success';
    Result := True;
  except
    Service.RollbackTrans;
    Service.ReceiveDataWithNoData;
    Msg := 'Update Price Faild.';
    Result := False;
  end;
end;

function TdmDemo.Action2(var Data, Msg: OleVariant): WordBool;
begin
  Result := True;
end;

function TdmDemo.Action3(var Data, Msg: OleVariant): WordBool;
begin
  Result := True;
end;

{ TdmSystemInfo }

function TdmDemoInfo.GetLastUpdate: WideString;
begin
  Result := '2004-05-26';
end;

function TdmDemoInfo.GetMemo: Widestring;
begin
  Result := 'This is my first rule dll demo';
end;

function TdmDemoInfo.GetModuleIndex: Integer;
begin
  Result := dmFirstDemo; //result your moudle index
end;

function TdmDemoInfo.GetModuleName: WideString;
begin
  Result := 'My First Demo Module';
end;

function TdmDemoInfo.GetVersion: Widestring;
begin
  Result := '1.0.0.0';
end;

end.

⌨️ 快捷键说明

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