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

📄 goodscatedm.pas

📁 物流供应链管理系统
💻 PAS
字号:
unit GoodsCateDm;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComServ, ComObj, VCLCom, StdVcl, bdemts, DataBkr, DBClient,
  MtsRdm, Mtx, GoodsCateData_TLB, Provider, DB, ADODB;

type
  TmtsGoodsCateObj = class(TMtsDataModule, ImtsGoodsCateObj)
    ADOConnection: TADOConnection;
    ADOTable: TADOTable;
    dspGoodsCate: TDataSetProvider;
    procedure MtsDataModuleActivate(Sender: TObject);
    procedure MtsDataModuleDeactivate(Sender: TObject);
    procedure MtsDataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  protected
    class procedure UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); override;
  public
    { Public declarations }
  end;

var
  mtsGoodsCateObj: TmtsGoodsCateObj;

implementation
uses uDBConfig, uGlobal;
{$R *.DFM}

class procedure TmtsGoodsCateObj.UpdateRegistry(Register: Boolean; const ClassID, ProgID: string);
begin
  if Register then
  begin
    inherited UpdateRegistry(Register, ClassID, ProgID);
    EnableSocketTransport(ClassID);
    EnableWebTransport(ClassID);
  end else
  begin
    DisableSocketTransport(ClassID);
    DisableWebTransport(ClassID);
    inherited UpdateRegistry(Register, ClassID, ProgID);
  end;
end;

procedure TmtsGoodsCateObj.MtsDataModuleActivate(Sender: TObject);
begin
  try
    ADOConnection.Connected := true;
    ADOTable.Active := true;
  except
    raise Exception.Create(ERRORDBCONNECT);
  end;
end;

procedure TmtsGoodsCateObj.MtsDataModuleDeactivate(Sender: TObject);
begin
  ADOConnection.Connected := false;
end;

procedure TmtsGoodsCateObj.MtsDataModuleCreate(Sender: TObject);
begin
  ADOConnection.Close;
  ADOConnection.ConnectionString := GetConnectionString;
end;

initialization
  TComponentFactory.Create(ComServer, TmtsGoodsCateObj,
    Class_mtsGoodsCateObj, ciMultiInstance, tmApartment);
end.

⌨️ 快捷键说明

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