goodscatedm.pas
来自「非常地全面完整的物流供应链管理系统 包含全部的需求文档」· PAS 代码 · 共 74 行
PAS
74 行
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 + =
减小字号Ctrl + -
显示快捷键?