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

📄 unit4.~pas

📁 sheji
💻 ~PAS
字号:
unit Unit4;

interface

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

type
  TroomForm = class(TForm)
    Button1: TButton;
    Button2: TButton;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Edit1: TEdit;
    Button3: TButton;
    Button4: TButton;
    DBGrid1: TDBGrid;
    Label2: TLabel;
    DataSource1: TDataSource;
    Table1: TTable;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  roomForm: TroomForm;

implementation

uses Unit1;

{$R *.dfm}

procedure TroomForm.Button1Click(Sender: TObject);
begin
mainForm.Show;
end;

procedure TroomForm.Button2Click(Sender: TObject);
begin
mainForm.Close;
end;

procedure TroomForm.Button3Click(Sender: TObject);
var
fno:string;

begin
fno:=trim(Edit1.Text) ;//输入查询条件
   if length(fno)>0 then
       begin
       table1.First;   //指向数据表的第一条记录
       //如果找到需要的记录,就将游标指向该记录,否则弹出对话框
          if not table1.Locate('客房编号',VarArrayOf([fno]),[loPartialKey]) then
             ShowMessage('没有找到对应房间号的客人的具体信息!') ;
            end;
end;

end.

⌨️ 快捷键说明

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