📄 zuofeidata.dpr
字号:
library ZuoFeiData;
uses
Forms,
windows,
Dialogs,
MainOutUnit in '..\..\MainOutUnit.pas',
UnitDataMD in 'UnitDataMD.pas' {DataMd: TDataModule};
var
OldHandle:THandle;
{$R *.res}
procedure DLL_Create(AOwnerHandle:THandle);
begin
OldHandle:=Application.Handle;
DCntString:='';
DCurHUHAO :='';
DCurYHID :=-1;
DCurLSH :='';
DCurSFXH :=-1;
DCurOpID :=-1;
DCurOpName:='';
Application.Handle:=AOwnerHandle;
InitMainOutFun;
end;
procedure DLL_Destory;
begin
Application.Handle:=OldHandle;
end;
procedure DLL_InitDatabase(ConnectionStr,HuHao,LSH,OpName:PChar;YongHuID,ShouFeiXH,OpID:Integer);
begin
DCntString:=ConnectionStr;
DCurHUHAO :=HuHao; //户号
DCurYHID :=YongHuID; //ID号
DCurLSH :=LSH; //流水号
DCurSFXH :=ShouFeiXH; //收费序号
DCurOpID :=OpID; //操作员ID
DCurOpName:=OpName; //操作员
with DataMD do begin
ADOConnection.ConnectionString:=ConnectionStr;
ADOConnection.Connected:=True;
end;
end;
procedure DLL_ZuoFei;
begin
if DCurSFXH>-1 then begin
if Application.MessageBox('您确定要作废这条记录吗?','',MB_OKCANCEL+MB_ICONQUESTION)=ID_OK then begin
//作废sf_shoufei_ys中的数据
DataMD.ADOSPzuofeiData.Parameters.ParamByName('@lsh').Value:=DCurLSH;
DataMD.ADOSPzuofeiData.Parameters.ParamByName('@IsPrepay').Value:='T';
DataMD.ADOSPzuofeiData.Parameters.ParamByName('@OpName').Value:=DCurOpName;
DataMD.ADOSPzuofeiData.ExecProc;
PRefreshDesk(2);
end;
end
else if DCurLSH<>'' then begin
if Application.MessageBox('您确定要作废这条记录吗?','',MB_OKCANCEL+MB_ICONQUESTION)=ID_OK then begin
//作废sf_shoufei中的数据
DataMD.ADOSPzuofeiData.Parameters.ParamByName('@lsh').Value:=DCurLSH;
DataMD.ADOSPzuofeiData.Parameters.ParamByName('@IsPrepay').Value:='F';
DataMD.ADOSPzuofeiData.Parameters.ParamByName('@OpName').Value:=DCurOpName;
DataMD.ADOSPzuofeiData.ExecProc;
PRefreshDesk(0);
end;
end
else
ShowMessage('未指定需要作废的记录');
end;
procedure LibraryProc(Reason: Integer);
begin{DLL的初始化和卸载函数}
case Reason of
0:begin
DataMd.Free;
end;
1:begin
DataMd:=TDataMd.Create(Application);
end;
end;
end;
exports
DLL_Create,DLL_Destory,DLL_InitDatabase,DLL_ZuoFei;
begin
DLLProc:=@LibraryProc;
DLLProc(1);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -