unit CommonDB;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DBGrids, DbClient, Grids, dxDBTL, StdCtrls, ExtCtrls, TeeProcs,
TeEngine, Chart, ADODB, dxDBGrid, DB, Jpeg, Series, Registry;
type
TCommonDB = class(TComponent)
private
{ Private declarations }
{FQuerySystem: IQuerySystem;
FUpdateSystem: IUpdateSystem;
FMtsSystem: IMtsSystem;
}
public
{ Public declarations }
constructor Create(szParams: string); //创建对象
destructor Destroy; override; //释放对象
procedure AddComboBoxItemNull(ASqlText: string; AClientDataSet: TClientDataSet;
AFieldName: string; AComboBox: TComboBox; AFieldNameID: string; AList: TStrings);
procedure AddComboBoxItem(ASqlText: string; AClientDataSet: TClientDataSet;
AFieldName: string; AComboBox: TComboBox; AFieldNameID: string; AList: TStrings);//将一个集合的字段写到combobox
procedure PostPhoto(AImage: TImage; AClientDataSet: TClientDataSet;
AFieldName: string);//保存图片
procedure GetPhoto(AImage: TImage; AClientDataSet: TClientDataSet;
AFieldName: string);//读出图片
function IfRepeat(AClientDataSet: TClientDataSet; AField,
ARepeatContent: string): Boolean;//判断cds中记录是否有重复
function LocateCds(AClientDataSet: TClientDataSet;
AFieldName: string; AFindValues: Variant): Boolean;//interbase中定位数据集的一种方式
function RecCurrMatcth(AClientDataSet: TClientDataSet;
AFieldName: string; AFindValues: Variant): Boolean; //用来判断AClientDataSet中的当前记录中的字段值是否跟跟提供的字段值想匹配
procedure OpenPhotoFile(AImage: TImage); //选择图片文件
function GetCurrentTime: TDateTime; //取得服务器的当前时间
function ExecuteData(ASqlText: string): Boolean;// 通过Com+执行sql语句
procedure GetData(ASqlText: string; AClientDataSet: TClientDataSet);
procedure Reset;
function ExecSp(ASpName: string): Boolean;
procedure ExecInsertSp(ASpName: string; AOutputIndex: Integer;
AClientDataSet: TClientDataSet; var ALsh: Integer); //封装当前界面新增存储过程
procedure ExecUpdateSp(ASpName: string; AClientDataSet: TClientDataSet); //封装当前界面修改存储过程
procedure ExecDeleteSp(ASpName: string; ALsh: Integer); //封装当前界面修改存储过程
//陈飞
procedure AddListItem(ASqlText: string; AClientDataSet: TClientDataSet;
AFieldName: string; AList: TStrings; AFieldID: string; AListID: TStrings);//将一个集合的字段写到combobox
function GetCxjg(ASqlText, ACaption01, ACaption02: string; var AValue01, AValue02: string): Boolean;
end;
type
TLogin = class(TComponent)
private
{ Private declarations }
public
{ Public declarations }
end;
var
CommonDB: TCommonDB;
Login: TLogin;
--IEX: TZHKZXT_ComServerEx;
-- Ars: TArgs;
implementat