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

📄 dmbasemoduleimp.pas

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

interface

uses
  Classes, SysUtils, Variants, dmBaseModule,
  hmSqlStoreProc, hmOleVariant, hmStrTools, hmSqlTools,
  hmOleDataSet,hmDateTools;

type
  TSqlLoadType = (slSql, slProc);

type
  THMSqlEx = class(THMSQL)
  private
    FModule: integer;
    Service: IBaseService;
    function GetSqlLanguage: WideString;
  public
    procedure LoadFromStore(index: integer);
    procedure LoadParamV(index: string);
    procedure LoadParamF(index: string);
    property Module: integer read FModule write FModule;
    property BaseService: IBaseService read Service write Service;
    property SqlLanguage: WideString read GetSqlLanguage;
  end;

  THMSqlStoreProcEx = class(THMSqlStoreProc)
  private
    FModule: integer;
    Service: IBaseService;
    function GetSqlLanguage: WideString;
  public
    procedure LoadFromStore(index: integer);
    procedure LoadOleParam(index: string);
    procedure LoadOleFunc(index: string);
    property Module: integer read FModule write FModule;
    property BaseService: IBaseService read Service write Service;
    property SqlLanguage: WideString read GetSqlLanguage;
  end;

type
  TBaseDataModule = class(TInterfacedObject, IBaseDataModule)
  private
    FModule: integer;
    function GetOle: IHMOleVariant;
  protected
    Sql: THMSqlEx;
    StoreProc: THMSqlStoreProcEx;
    MsgList: TStringList;
    Service: IBaseService;
  protected
    function ActionList(CmdIndex: integer; var Data, Msg: OleVariant): WordBool; virtual;
    procedure ShowDebug(Msg: string);
    procedure ApplyUpdates(Delta: OleVariant; TableName, KeyField: string);
    function UpdateSingleRI(var Data, Msg: OleVariant): WordBool;
    function GetInnerModuleInfo: WideString; virtual;
    procedure CheckTranstion;

    procedure CallServiceReceiveDataV;
    procedure CallServiceReceiveDataT;
    procedure LoadFromStore(Index: integer; LoadType: TSqlLoadType);

    property Ole: IHMOleVariant read GetOle;

  public
    constructor Create(const BaseService: IBaseService);
    destructor Destroy; override;

    function GetModuleInfo: WideString; stdcall;

    function GetBaseService: IBaseService; stdcall;
    procedure SetBaseService(const Value: IBaseService); stdcall;

    function GetModule(): integer; stdcall;
    procedure SetModule(const value: integer); stdcall;

    function Operation(var Data, Msg: OleVariant): WordBool; stdcall;
    procedure LoadOleParam(const Param: OleVariant); stdcall;

  end;

  TBaseDataModuleInfo = class(TInterfacedObject, IDataModuleInfo)
  public
    function GetModuleName: WideString; virtual; stdcall;
    function GetVersion: Widestring; virtual; stdcall;
    function GetDesignner: Widestring; virtual; stdcall;
    function GetMemo: Widestring; virtual; stdcall;
    function GetLastUpdate: WideString; virtual; stdcall;
    function GetModuleIndex: Integer; virtual; stdcall;
  end;

type
  ErrSystemBusy = class(Exception)
  public
    constructor Create;
  end;

implementation

uses swModuleIndex;

{ TBaseDataModule }

constructor TBaseDataModule.Create(const BaseService: IBaseService);
begin
  inherited Create;
  Service := BaseService;
  Sql := THMSqlEx.Create;
  StoreProc := THMSqlStoreProcEx.Create;
  MsgList := TStringList.Create;
  Sql.BaseService := BaseService;
  StoreProc.BaseService := BaseService;
end;

destructor TBaseDataModule.Destroy;
begin
  Sql.Free;
  StoreProc.Free;
  MsgList.Free;
  inherited Destroy;
end;

(* Operation : 硄ノ磅︽ㄧ计,DataServer盢硄筁ウㄓ磅︽     *)
(* ActionList: ず场

⌨️ 快捷键说明

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