countfeedm.~pas
来自「求是科技出版的《Delphi串口通信工程开发实例导航》所有的源代码。是一本很好的」· ~PAS 代码 · 共 73 行
~PAS
73 行
unit CountFeeDM;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, ADODB;
type
TDMCountFee = class(TDataModule)
cnnCountFee: TADOConnection;
tblFeeRate: TADOTable;
tblFeeStation: TADOTable;
tblFestival: TADOTable;
procedure DataModuleCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function ActiveDM() : integer;
function GetFeeNormal(Groupid: integer;
StartTime,EndTime:TDateTime;FirstFree,PayFree,
TimeoutFree:integer;StartFee:double;PayedFlag: boolean): double;
function GetFreeParkTime(): double;
function IsFestival(ADateTime : TDateTime): boolean;
end;
var
DMCountFee: TDMCountFee;
implementation
uses
GlobalUnit,ConstUnit;
{$R *.DFM}
{ TDMCountFee }
function TDMCountFee.ActiveDM: integer;
begin
if not cnnCountFee.Connected then
begin
cnnCountFee.ConnectionString := GetLocalStr();
cnnCountFee.Connected := True;
with tblFeeRate do
begin
Connection := cnnCountFee;
TableName := 'fee_rate';
Active := True;
end;
with tblFeeStation do
begin
Connection := cnnCountFee;
TableName := 'fee_station';
Active := True;
end;
with tblFestival do
begin
Connection := cnnCountFee;
TableName := 'adm_festival';
Active := True;
end;
end;
Result := 1;
end;
procedure TDMCountFee.DataModuleCreate(Sender: TObject);
begin
Self.ActiveDM;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?