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

📄 countfeedm.~pas

📁 求是科技出版的《Delphi串口通信工程开发实例导航》所有的源代码。是一本很好的书。拿出来与大家共享。
💻 ~PAS
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -