xt_rzs.~pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:3k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit xt_rzs;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ComCtrls, ToolWin, DB, Grids, DBGridEh, XPBarMenu, PrnDbgeh,
- ExtCtrls, DBClient;
- type
- Txt_rz = class(TForm)
- CoolBar1: TCoolBar;
- ToolBar1: TToolBar;
- ToolButton1: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- ToolButton2: TToolButton;
- DataSource1: TDataSource;
- ToolButton6: TToolButton;
- XPBarMenu1: TXPBarMenu;
- PrintDBGridEh1: TPrintDBGridEh;
- Panel1: TPanel;
- DBGridEh1: TDBGridEh;
- ClientDataSet1: TClientDataSet;
- procedure FormCreate(Sender: TObject);
- procedure ToolButton3Click(Sender: TObject);
- procedure ToolButton4Click(Sender: TObject);
- procedure ToolButton6Click(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure ToolButton2Click(Sender: TObject);
- procedure ToolButton1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- xt_rz: Txt_rz;
- implementation
- uses Dms, xt_rz_bjs;
- {$R *.dfm}
- procedure Txt_rz.FormCreate(Sender: TObject);
- begin
- Clientdataset1.Active:=true;
- end;
- procedure Txt_rz.ToolButton3Click(Sender: TObject);
- begin
- if xt_rz_bj=nil then
- begin
- xt_rz_bj:=Txt_rz_bj.create(self);
- xt_rz_bj.showmodal;
- end;
- end;
- procedure Txt_rz.ToolButton4Click(Sender: TObject);
- begin
- Clientdataset1.Close;
- Clientdataset1.CommandText:='select * from xt_rz';
- Clientdataset1.Open;
- end;
- procedure Txt_rz.ToolButton6Click(Sender: TObject);
- begin
- close;
- end;
- procedure Txt_rz.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- Clientdataset1.Active:=false;
- action:=cafree;
- xt_rz:=nil;
- end;
- procedure Txt_rz.ToolButton2Click(Sender: TObject);
- begin
- printdbgrideh1.Title.Text:='系统日志表';
- printdbgrideh1.AfterGridText.Text:=datetostr(date);
- printdbgrideh1.Preview;
- end;
- procedure Txt_rz.ToolButton1Click(Sender: TObject);
- begin
- if Clientdataset1.RecordCount=0 then
- begin
- application.MessageBox('当前表中没有数据'+#13#10+'不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if application.MessageBox('您确定要清除所有日志吗?','警告',mb_ok+mb_iconinformation)=Idok then
- begin
- Clientdataset1.Close;
- Clientdataset1.CommandText:='delete xt_rz where rz_xh<>'+''''+''''+'';
- Clientdataset1.Execute;
- Clientdataset1.Close;
- Clientdataset1.CommandText:='select * from xt_rz';
- Clientdataset1.Open;
- end;
- end;
- end.