📄 goodsdm.pas
字号:
unit GoodsDm;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComServ, ComObj, VCLCom, StdVcl, bdemts, DataBkr, DBClient,
MtsRdm, Mtx, GoodsData_TLB, Provider, DB, ADODB;
type
TmtsGoodsObj = class(TMtsDataModule, ImtsGoodsObj)
ADOConnection: TADOConnection;
dspGoodsMaster: TDataSetProvider;
ADOTGoodsMaster: TADOTable;
ADOTGoodsSlave: TADOTable;
dspGoodsSlave: TDataSetProvider;
ADOTVendor: TADOTable;
dspVendor: TDataSetProvider;
dspABCCate: TDataSetProvider;
ADOTABCCate: TADOTable;
ADOTGoodsCate: 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
mtsGoodsObj: TmtsGoodsObj;
implementation
uses uDBConfig, uGlobal;
{$R *.DFM}
class procedure TmtsGoodsObj.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 TmtsGoodsObj.MtsDataModuleActivate(Sender: TObject);
begin
try
ADOConnection.Connected := true;
ADOTGoodsMaster.Active := true;
ADOTGoodsSlave.Active := true;
ADOTVendor.Active := true;
ADOTABCCate.Active := true;
ADOTGoodsCate.Active := true;
except
raise Exception.Create(ERRORDBCONNECT);
end;
end;
procedure TmtsGoodsObj.MtsDataModuleDeactivate(Sender: TObject);
begin
ADOConnection.Connected := false;
end;
procedure TmtsGoodsObj.MtsDataModuleCreate(Sender: TObject);
begin
ADOConnection.Close;
ADOConnection.ConnectionString := GetConnectionString;
end;
initialization
TComponentFactory.Create(ComServer, TmtsGoodsObj,
CLASS_mtsGoodsObj, ciMultiInstance, tmApartment);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -