【delphi开源代码栏目提醒】:以下是网学会员为您推荐的delphi开源代码-unt_CurDayBookFind.pas,希望本篇文章对您学习有所帮助。
unit unt_CurDayBookFind;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids, DB, ADODB, Buttons;
type
TCurDayBookFindForm = class(TForm)
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
SpeedButton1: TSpeedButton;
query1: TADOQuery;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn2Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure RadioButton5Click(Sender: TObject);
procedure RadioButton6Click(Sender: TObject);
procedure RadioButton4Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
CurDayBookFindForm: TCurDayBookFindForm;
implementation
uses Main, unt_CheckUser, unt_BookHisRep;
{$R *.dfm}
procedure TCurDayBookFindForm.BitBtn2Click(Sender: TObject);
begin
CurDayBookFindForm.Close;
end;
procedure TCurDayBookFindForm.RadioButton1Click(Sender: TObject);
begin
if RadioButton1.Checked then
begin
Edit1.Visible := False;
Edit2.Visible := False;
Label1.Visible := False;
Label2.Visible := False;
end;
end;
procedure TCurDayBookFindForm.RadioButton2Click(Sender: TObject);
begin
if RadioButton2.Checked then
begin
Label1.Visible := True;
Label1.Caption := '客人';
Edit1.Visible := True;
Edit2.Visible := False;
end;
end;
procedure TCurDayBookFindForm.RadioButton3Click(Sender: TObject);
begin
if RadioButton3.Checked then
begin
Label1.Visible := True;
Label1.Caption := '客房编号';
Edit1.Visible := True;
Edit2.Visible := False;
end;
end;
procedure TCurDayBookFindForm.RadioButton5Click(Sender: TObject);
begin
if RadioButton5.Checked then
begin
Label1.Visible := True;
Label1.Caption := '订房编号';
Edit1.Visible := True;
Edit2.Visible := False;
Label2.Visible := False;
end;
end;
procedure TCurDayBookFindForm.RadioButton6Click(Sender: TObject);
begin
if RadioButton6.Checked then
begin
Edit1.Visible := False;
Edit2.Visible := False;
Label1.Visible := False;
Label2.Visible := False;
end;
end;
procedure TCurDayBookFindForm.RadioButton4Click(Sender: TObject);
begin
if RadioButton4.Checked then
begin
Edit1.Visible := True;
Edit2.Visible := True;
Label1.Visible := True;
Label2.Visible := True;
Label1.Caption := '起始日期';
Label2.Caption := '终止日期';
end;
end;
procedure TCurDayBookFindForm.SpeedButton1Click(Sender: TObject);
var
sSql: String;
begin
if radiobutton1.Checked then
sSql := 'select * from bookroomhistory'
else if radiobutton2.checked then
begin
sSql := 'select * from bookroomhistory where name=''' + Edit1.Text + '''';
end
else if radiobutton3.Checked then
begin
sSql := 'select * from bookroomhistory where roomno=''' + Edit1.Text + '''';
end
else if radiobutton4.checked then
begin
sSql := 'select * from bookroomhistory where registerday>#' + Edit1.Text
+ '# and registerday<#' + Edit2.Text + '#';
end
else if radiobutton5.Checked then
begin
sSql := 'select * from bookroomhistory where bookno=''' + Edit1.Text + '''';
end
else if RadioButton6.Checked then
begin
sSql := 'select * from bookroomhistory where hour_id=true';
end;
mainForm.exeSql(query1,sSql,'1');
query1.Active := True;
BitBtn1.Enabled := True;
end;
procedure TCurDayBookFindForm.FormShow(Sender: TObject);
begin
Label1.Visible := False;
Label2.Visible := False;
Edit1.Visible := False;
Edit2.Visible := False;
BitBtn1.Enabled := False;
end;
procedure TCurDayBookFindForm.BitBtn1Click(Sender: TObject);
begin
BookHisRep.QuickRep1.DataSet := query1;
BookHisRep.QRDBText1.DataSet := query1;
BookHisRep.QRDBText2.DataSet := query1;
BookHisRep.QRDBText3.DataSet := query1;
BookHisRep.QRDBText4.DataSet := query1;
BookHisRep.QRDBText5.DataSet := query1;
BookHisRep.QRDBText6.DataSet := query1;
BookHisRep.QRDBText7.DataSet := query1;
BookHisRep.QRDBText8.DataSet := query1;
BookHisRep.QRDBText1.DataField := 'bookno';
BookHisRep.QRDBText2.DataField := 'roomno';
BookHisRep.QRDBText3.DataField := 'name';
BookHisRep.QRDBText4.DataField := 'registerday';
BookHisRep.QRDBText5.DataField := 'precount';
BookHisRep.QRDBText6.DataField := 'Deposit';
BookHisRep.QRDBText7.DataField := 'Operator';
BookHisRep.QRDBText8.DataField := 'Oper_date';
BookHisRep.QuickRep1.Preview;
end;
end.
上一篇:
PreParent.cpp
下一篇:
学校党建工作论文