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

📄 zmod_commonfuncprocu.pas

📁 专业的评标管理系统
💻 PAS
字号:
{
'┌───────────────────────────────────┐
'│**********************************************************************│
'│*** 文件名称:zmod_CommonFuncProcU.pas 《共享数据模块》              *│
'│*** 功能描述:此摸块是定义全局变量,函数和过程                       *│
'│*** 编写人员:朱华                                *│
'│*** 编写日期:2001-06-06                             *│
'│*** 修改人员:                                    *│
'│*** 修改日期:                                                       *│
'│**********************************************************************│
'└───────────────────────────────────┘
}

unit zmod_CommonFuncProcU;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, DBTables, FileCtrl;

type
  Tzmod_CommonFuncProc = class(TDataModule)
    Database1: TDatabase;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

//*********************《声明全局公共函数开始》*********************//
//
procedure Delay(Seconds,MilliSec: Word);
//
//*********************《声明全局公共函数结束》*********************//


var
  zmod_CommonFuncProc: Tzmod_CommonFuncProc;

  //****************《声明全局变量开始》****************//
  //
  // 工程信息
  zh_ci_codeS :string ;  //声明-<工程代码>-变量

  // 用户信息
  zh_ci_id:         integer; 
  zh_ci_loginname:  string;
  zh_ci_password:   string;
  zh_ci_name:       string;
  zh_ci_level:      string;

  // 目录变量
  zh_cur_path :string ;
  zh_cur_filepath :string;
  zh_history_path : string;
  //
//****************《声明全局变量结束》****************//

implementation

uses zfrm_Setup, zmod_commonDataFileU, zmod_commonDateU;

{$R *.DFM}
procedure Delay(Seconds,MilliSec: Word);
var
  TimeOut: TDateTime;
begin
  //
  TimeOut := Now + EncodeTime(0,Seconds div 60, Seconds mod 60,MilliSec);
  while Now < TimeOut do
     application.ProcessMessages ;
  //
end;

procedure Tzmod_CommonFuncProc.DataModuleCreate(Sender: TObject);
var
  ServerName: string;
begin
  // 创建配置目录
  zh_cur_path := GetCurrentDir ;
  zh_cur_filepath := zh_cur_path + '\Setup' ;
  if not DirectoryExists(zh_cur_filepath) then
    if not CreateDir(zh_cur_filepath) then
    raise Exception.Create('Cannot create zh_cur_filepath');

  // 检测配置文件
  try
    ServerName := zh_ReadPathnameF(zh_cur_filepath + '\DbSetup.txt');
  except
    Application.MessageBox(
      '数据库连接错误,请您检查并重新配置',
      '数据库错',
      MB_OK+MB_ICONError) ;
     Application.CreateForm(Tzfrm_Setups, zfrm_Setups);
     zfrm_Setups.ShowModal ;
     Application.Terminate ;
  end;

  // 检测数据库连通
  try  {try <1> S}
    zmod_CommonFuncProc.Database1.Connected := False ;
    // 数据库参数赋值
    zh_DatabaseParamSetP(ServerName) ; //*****//
    zmod_CommonFuncProc.Database1.Connected := True ;
  except
      // 数据库错
      Application.MessageBox(
      '数据库连接错误,请您检查或系统管理员联系',
      '数据库错',
      MB_OK+MB_ICONError) ;
    Application.Terminate ;
  end; {try <1> E}
  //
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -