⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unt_moneyfind.pas

📁 酒店资源管理的软件
💻 PAS
字号:
unit unt_MoneyFind;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, Grids, DBGrids, ADODB, Buttons, StdCtrls;

type
  TMoneyFindForm = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    SpeedButton1: TSpeedButton;
    query1: TADOQuery;
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    RadioButton5: TRadioButton;
    RadioButton6: TRadioButton;
    RadioButton7: TRadioButton;
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    BitBtn2: TBitBtn;
    procedure BitBtn2Click(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
    procedure RadioButton3Click(Sender: TObject);
    procedure RadioButton4Click(Sender: TObject);
    procedure RadioButton5Click(Sender: TObject);
    procedure RadioButton6Click(Sender: TObject);
    procedure RadioButton7Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
     
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MoneyFindForm: TMoneyFindForm;

implementation
uses Main, unt_CheckUser, unt_MoneyFindRep;
{$R *.dfm}

procedure TMoneyFindForm.BitBtn2Click(Sender: TObject);
begin
  MoneyFindForm.Close;
end;

procedure TMoneyFindForm.RadioButton1Click(Sender: TObject);
begin
  if RadioButton1.Checked then
  begin
    Label1.Visible := True;
    Label1.Caption := '订房编号';
    Label2.Visible := False;
    Edit1.Visible := True;
    Edit2.Visible := False;
  end;
end;

procedure TMoneyFindForm.RadioButton2Click(Sender: TObject);
begin
  if RadioButton2.Checked then
  begin
    Label1.Visible := True;
    Label1.Caption := '客房编号';
    Label2.Visible := False;
    Edit1.Visible := True;
    Edit2.Visible := False;
  end;
end;

procedure TMoneyFindForm.RadioButton3Click(Sender: TObject);
begin
  if RadioButton3.Checked then
  begin
    Label1.Visible := True;
    Label1.Caption := '客人姓名';
    Label2.Visible := False;
    Edit1.Visible := True;
    Edit2.Visible := False;
  end;
end;

procedure TMoneyFindForm.RadioButton4Click(Sender: TObject);
begin
  if RadioButton4.Checked then
  begin
    Label1.Visible := True;
    Label1.Caption := '证件编号';
    Label2.Visible := False;
    Edit1.Visible := True;
    Edit2.Visible := False;
  end;
end;

procedure TMoneyFindForm.RadioButton5Click(Sender: TObject);
begin
  if RadioButton5.Checked then
  begin
    Label1.Visible := True;
    Label1.Caption := '操作员';
    Label2.Visible := False;
    Edit1.Visible := True;
    Edit2.Visible := False;
  end;
end;

procedure TMoneyFindForm.RadioButton6Click(Sender: TObject);
begin
  if RadioButton6.Checked then
  begin
    Label1.Visible := True;
    Label1.Caption := '起始日期';
    Label2.Visible := True;
    Label2.Caption := '终止日期';
    Edit1.Visible := True;
    Edit2.Visible := True;
  end;
end;

procedure TMoneyFindForm.RadioButton7Click(Sender: TObject);
begin
  if RadioButton7.Checked then
  begin
    Label1.Visible := False;
    Label2.Visible := False;
    Edit1.Visible := False;
    Edit2.Visible := False;
  end;
end;

procedure TMoneyFindForm.SpeedButton1Click(Sender: TObject);
var
  sSql: String;
begin
  if radiobutton1.Checked then
  begin
    sSql := 'select * from szhistorytable where bookno=''' + Edit1.Text + '''';
  end
  else if radiobutton2.Checked then
  begin
    sSql := 'select * from szhistorytable where roomno=''' + Edit1.Text + '''';
  end
  else if radiobutton3.Checked then
  begin
    sSql := 'select * from szhistorytable where name=''' + Edit1.Text + '''';
  end
  else if radiobutton4.Checked then
  begin
    sSql := 'select * from szhistorytable where certi_no=''' + Edit1.Text + '''';
  end
  else if radiobutton5.Checked then
  begin
    sSql := 'select * from szhistorytable where operator=''' + Edit1.Text + '''';
  end
  else if radiobutton6.Checked then
  begin
    sSql := 'select * from szhistorytable where oper_date>#' + Edit1.Text
          + '# and oper_date<#' + Edit2.Text + '#';
  end
  else
    sSql := 'select * from szhistorytable';
  mainForm.exeSql(query1,sSql,'1');
  query1.Active := True;

end;

procedure TMoneyFindForm.FormShow(Sender: TObject);
begin
  Label1.Visible := False;
  Label2.Visible := False;
  Edit1.Visible := False;
  Edit2.Visible := False;

end;

 

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -