xt_rz_bjs.~pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:3k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit xt_rz_bjs;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Buttons, ComCtrls, DB, DBClient, XPBarMenu;
- type
- Txt_rz_bj = class(TForm)
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- TabSheet2: TTabSheet;
- Label1: TLabel;
- DateTimePicker1: TDateTimePicker;
- Label2: TLabel;
- Label3: TLabel;
- DateTimePicker2: TDateTimePicker;
- Label4: TLabel;
- UpDown1: TUpDown;
- Edit1: TEdit;
- SpeedButton1: TSpeedButton;
- SpeedButton2: TSpeedButton;
- ClientDataSet1: TClientDataSet;
- DataSource1: TDataSource;
- XPBarMenu1: TXPBarMenu;
- procedure SpeedButton2Click(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure FormCreate(Sender: TObject);
- procedure SpeedButton1Click(Sender: TObject);
- procedure UpDown1Click(Sender: TObject; Button: TUDBtnType);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- xt_rz_bj: Txt_rz_bj;
- implementation
- uses xt_rzs;
- {$R *.dfm}
- procedure Txt_rz_bj.SpeedButton2Click(Sender: TObject);
- begin
- close;
- end;
- procedure Txt_rz_bj.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- action:=cafree;
- xt_rz_bj:=nil;
- end;
- procedure Txt_rz_bj.FormCreate(Sender: TObject);
- begin
- Clientdataset1.Active:=true;
- end;
- procedure Txt_rz_bj.SpeedButton1Click(Sender: TObject);
- var begin_time,end_time:string;
- begin
- Clientdataset1.Close;
- Clientdataset1.CommandText:='select * from xt_rz';
- Clientdataset1.Open;
- begin_time:=datetimetostr(DateTimePicker1.DateTime);
- end_time:=datetimetostr(DateTimePicker2.DateTime);
- case PageControl1.ActivePageIndex of
- 0: begin
- if Clientdataset1.RecordCount=0 then
- begin
- application.MessageBox('当前表中没有数据'+#13#10+'不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if application.MessageBox('您确定要删除日志吗?','警告',mb_okcancel+mb_iconquestion)=Idok then
- begin
- Clientdataset1.Close;
- Clientdataset1.CommandText:='P_rz'+''''+edit1.text+''''+'';
- Clientdataset1.execute;
- Clientdataset1.close;
- Clientdataset1.CommandText:='select * from xt_rz';
- Clientdataset1.Open;
- end;//end if
- end;
- 1: begin
- if Clientdataset1.RecordCount=0 then
- begin
- application.MessageBox('当前表中没有数据'+#13#10+'不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if application.MessageBox('您确定要删除日志吗?','警告',mb_okcancel+mb_iconquestion)=Idok then
- begin
- Clientdataset1.Close;
- clientdataset1.CommandText:='delete xt_rz where rz_czsj>='+''''+begin_time+''''+' and rz_czsj<='+''''+end_time+''''+'';
- Clientdataset1.Execute;
- Clientdataset1.Close;
- Clientdataset1.CommandText:='select * from xt_rz';
- Clientdataset1.Open;
- xt_rz.ToolButton4.click;
- end;//end if
- end;
- end;//end case
- end;
- procedure Txt_rz_bj.UpDown1Click(Sender: TObject; Button: TUDBtnType);
- var i:integer;
- begin
- I:=StrToInt(edit1.Text);
- inc(i);
- edit1.Text:=IntToStr(I);
- end;
- end.