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

📄 unt_roomfind.pas

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

interface

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

type
  TRoomFindForm = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    GroupBox4: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    RadioButton5: TRadioButton;
    RadioButton6: TRadioButton;
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    SpeedButton1: TSpeedButton;
    DBGrid1: TDBGrid;
    BitBtn1: TBitBtn;
    DataSource1: TDataSource;
    procedure BitBtn1Click(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
    procedure RadioButton3Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  RoomFindForm: TRoomFindForm;

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

procedure TRoomFindForm.BitBtn1Click(Sender: TObject);
begin
  RoomFindForm.Close;
end;

procedure TRoomFindForm.RadioButton1Click(Sender: TObject);
begin
  if RadioButton1.Checked then
    Label1.Caption := '客房编号';
  Edit1.Enabled := True;
end;

procedure TRoomFindForm.RadioButton2Click(Sender: TObject);
begin
  if RadioButton2.Checked then
    Label1.Caption := '客房等级';
  Edit1.Enabled := True;
end;

procedure TRoomFindForm.RadioButton3Click(Sender: TObject);
begin
  if RadioButton3.Checked then
    Label1.Caption := '钟点房';
  Edit1.Enabled := False;
end;

procedure TRoomFindForm.SpeedButton1Click(Sender: TObject);
var
  sSql,i: String;
begin
  i := '0';
  if RadioButton1.Checked then         //根据客房编号查询
  begin
    if radiobutton4.checked then
    begin
      if edit1.text<>'' then
      begin
        sSql := 'select * from room_manager where roomno=''' + Edit1.Text + '''';
      end
      else
      begin
        sSql := 'select * from room_manager';
      end;
    end
    else
    begin
      if edit1.text<>'' then
      begin
        if RadioButton5.Checked then
          i := '1';
        sSql := 'select * from room_manager where roomno=''' + Edit1.Text
              + ''' and use_id=' + i;
      end
      else
      begin
        sSql := 'select * from room_manager where use_id=' + i;
      end;
    end;
  end
  else if RadioButton2.Checked then         //根据客房等级查询
  begin
    if radiobutton4.checked then
    begin
      if edit1.text<>'' then
      begin
        sSql := 'select * from room_manager where roomclass=''' + Edit1.Text + '''';
      end
      else
      begin
        sSql := 'select * from room_manager';
      end;
    end
    else
    begin
      if edit1.text<>'' then
      begin
        if RadioButton5.Checked then
          i := '1';
        sSql := 'select * from room_manager where roomclass=''' + Edit1.Text
              + ''' and use_id=' + i;
      end
      else
      begin
        sSql := 'select * from room_manager where use_id=' + i;
      end;
    end;
  end
  else                                   //根据钟点房查询
  begin
    if radiobutton4.checked then
    begin
      sSql := 'select * from room_manager where hour_id=1';
    end
    else
    begin
      if RadioButton5.Checked then
        i := '1';
      sSql := 'select * from room_manager where hour_id=1 and use_id=' + i;
    end;
  end;
  mainForm.exeSql(mainForm.query1,sSql,'1');
  Edit2.Text := IntToStr(mainForm.query1.RecordCount);
end;

end.

⌨️ 快捷键说明

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