📄 zmod_commondateu.pas
字号:
{
'┌───────────────────────────────────┐
'│**********************************************************************│
'│*** 文件名称:zfrm_commonDateU.pas 《共享数据模块》 *│
'│*** 功能描述:此摸块是定义全局变量,函数和过程 *│
'│*** 编写人员:朱华 *│
'│*** 编写日期:2001-04-26 *│
'│*** 修改人员: *│
'│*** 修改日期: *│
'│**********************************************************************│
'└───────────────────────────────────┘
}
unit zmod_commonDateU;
interface
uses
{ Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, FileCtrl;}
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, Db, DBTables, StdCtrls, FileCtrl;
type
Tzmod_commonDate = class(TDataModule)
Query1: TQuery;
StoredProc1: TStoredProc;
Query4: TQuery;
procedure DataModuleCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
//*********************《声明全局公共函数开始》*********************//
//
// 得到,新的序列值
function zh_GetNewIdF(var z_Field_idS :String):Integer;
function zh_ErrorP():boolean;
function GetAppPath():String;
function zh_PublicQuery4F(Select_SQL:string):Double;
// 执行增、删、改
procedure zh_PublicInsDelUpdQueryP(var zh_SQL:string);
// 数据库参数赋值
procedure zh_DatabaseParamSetP(var zh_ServerName_Param:string);
//
type
PMyRec = ^TMyRec;
TMyRec = record
z_pi_code :string; // 声明-(工程代码)-变量
z_ai_id :integer; // 声明-(项目代码)-变量
end;
//*********************《声明全局公共函数结束》*********************//
var
zmod_commonDate: Tzmod_commonDate;
//****************《声明全局变量开始》****************//
zh_GetNewIdS :string;
z_TreeViewDate_STU: PMyRec;
z_nodesA :array[0..10000] of TtreeNode; // 声明-(工程节点)-数组
//
zh_ReCountI :integer; //声明-<返回记录 >-变量
//
zh_Select_SQL :string; //声明-<查询SQL语句 >-变量
zh_Insert_SQL :string; //声明-<增加SQL语句 >-变量
zh_Update_SQL :string; //声明-<修改SQL语句 >-变量
zh_Delete_SQL :string; //声明-<删除SQL语句 >-变量
//
zh_ShowResult_SQL :string; //声明-<显示结果SQL语句 >-变量
zh_SelectR_SQL :string; //声明-<显示结果主SQL语句 >-变量
zh_WhereR_SQL :string; //声明-<显示结果条件SQL语句>-变量
//
zh_DbTabProFix_SQL :string; //声明-<数据库表名前缀 >-变量
//
zh_returnV :integer ; //声明-<判断返回值 >-变量
//
zh_flashFlag :boolean ; //声明-<新建用户刷新>-标志
zh_flashform :boolean ; //声明-<添加用户刷新>-标志
zh_updateFlag :boolean ; //声明-<更新用户 >-标志
zh_creatfromFlag :boolean = True ; //声明-<创建窗体>-标志
zh_creatIssueFlag :boolean = True ;
zh_creatInfoManagerFlag :boolean = True ;
// 用户信息
zh_cu_loginnameS :string ; //声明-<用户ID >-变量
zh_cu_nameS :string ; //声明-<用户姓名 >-变量
zh_cu_levelS :string ; //声明-<用户权限 >-变量
zh_cu_syslevelS :string ; //声明-<系统级别 >-变量
// 目录变量
{ zh_cur_path :string ;
zh_cur_filepath :string;
zh_history_path : string;
}
zh_keyS :string;
z_FirstFlag:array[1..10000] of boolean;
z_countI: integer = 0 ;
zh_QueryFlag: boolean;
//
//****************《声明全局变量结束》****************//
implementation
uses zmod_CommonFuncProcU;
{$R *.DFM}
procedure zh_PublicInsDelUpdQueryP(var zh_SQL:string);
begin
//
try
with zmod_commonDate do
begin
Query1.Close ;
Query1.SQL.Clear ;
Query1.SQL.Add(zh_SQL) ;
Query1.Prepare ;
Query1.ExecSQL ;
end;
except
end;
//
end;
function zh_GetNewIdF(var z_Field_idS :String):Integer;
begin
//
zh_Select_SQL := 'select gen_id(' + z_Field_idS + ',1) from dual' ;
with zmod_commonDate do
begin
Query1.Close ;
Query1.SQL.Clear ;
Query1.SQL.Add(zh_Select_SQL) ;
Query1.Prepare ;
Query1.Open ;
Query1.First ;
zh_GetNewIdF := Query1.Fields[0].AsInteger ;
end;
//
end;
function zh_PublicQuery4F(Select_SQL:string):Double;
begin
//
with zmod_commonDate do
begin
//try {try <1> S}
Query4.Close ;
Query4.SQL.Clear ;
Query4.SQL.Add(Select_SQL) ;
Query4.Prepare ;
Query4.Open ;
Query4.First ;
{except
// 数据库错
Application.MessageBox(
'数据库连接错误,请您检查或系统管理员联系',
'数据库错',
MB_OK+MB_ICONError) ;
zh_PublicQuery4F := 0 ;
Exit ;
end; {try <1> E}
zh_PublicQuery4F := Query4.Fields[0].AsFloat ;
end;
//
end;
function zh_ErrorP():boolean;
begin
//
if (zh_cu_loginnameS = '') or (zh_cu_nameS= '') or (zh_cu_levelS = '') or (zh_cu_syslevelS = '') then
begin
showmessage('数据不全,平台有严重错误!');
zh_ErrorP := True ;
end
else
zh_ErrorP := False ;
//
end;
function GetAppPath():String;
var
AppPath:String;
LastBackSlashPos, i:Integer;
begin
LastBackSlashPos:=0;
AppPath:=Application.GetNamePath();
AppPath:=Application.ExeName;
for i:= 1 to length(AppPath) do
if AppPath[i] = '\' then
LastBackSlashPos:= i;
Result:= copy(AppPath, 1, LastBackSlashPos);
end;
procedure Tzmod_commonDate.DataModuleCreate(Sender: TObject);
begin
//
{ zh_cur_path := GetCurrentDir ;
zh_cur_filepath := zh_cur_path + '\temp' ;
if not DirectoryExists(zh_cur_filepath) then
if not CreateDir(zh_cur_filepath) then
raise Exception.Create('Cannot create zh_cur_filepath');
zh_history_path := zh_cur_path + '\history' ;
if not DirectoryExists(zh_history_path) then
if not CreateDir(zh_history_path) then
raise Exception.Create('Cannot create zh_history_path');}
//
end;
procedure zh_DatabaseParamSetP(var zh_ServerName_Param:string);
begin
With zmod_CommonFuncProc.Database1.Params do
begin
Clear ;
Append('SERVER NAME=' + zh_ServerName_Param) ;
Append('USER NAME=EFIDIC') ;
Append('PASSWORD=efidic') ;
Append('OPEN MODE=READ/WRITE') ;
Append('SCHEMA CACHE SIZE=8') ;
Append('LANGDRIVER=') ;
Append('SQLQRYMODE=SERVER') ;
Append('SQLPASSTHRU MODE=SHARED AUTOCOMMIT') ;
Append('SCHEMA CACHE TIME=-1') ;
Append('MAX ROWS=-1') ;
Append('BATCH COUNT=200') ;
Append('ENABLE SCHEMA CACHE=FALSE') ;
Append('SCHEMA CACHE DIR=') ;
Append('ENABLE BCD=FALSE') ;
Append('BLOBS TO CACHE=64') ;
Append('BLOB SIZE=32') ;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -