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

📄 unit8.~pas

📁 图书管理系统
💻 ~PAS
字号:
unit Unit8;

interface

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

type
  TForm8 = class(TForm)
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    Table1: TTable;
    RadioGroup1: TRadioGroup;
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form8: TForm8;

implementation

{$R *.dfm}

procedure TForm8.Button1Click(Sender: TObject);
var
xh1,xh2,xm1,xm2:string;
B1,B2:Boolean;
begin

xh1:=edit1.Text;
xm1:=edit2.Text;
table1.First;
while not table1.Eof  do
begin
xh2:=table1.fieldbyname('学号').AsString;
xm2:=table1.fieldbyname('姓名').AsString;
if xh1='' then
B1:=true
else if radiogroup1.ItemIndex=0 then
B1:=comparetext(xh1,xh2)=0
else
B1:=pos(xh1,xh2)>0;

if xm1='' then
B2:=true
else if radiogroup1.ItemIndex=0 then
B2:=comparetext(xm1,xm2)=0
else
B2:=pos(xm1,xm2)>0;




if B1 and B2  then
begin if  radiogroup1.ItemIndex=0 then
Break
else
if application.MessageBox('是这个学生吗?','确认框',mb_okcancel)=idok then
break;
end;
table1.Next;
end;
if  table1.Eof then
showmessage('没有你要找的同学。');

end;


procedure TForm8.Button2Click(Sender: TObject);
begin
close;
end;

procedure TForm8.FormCreate(Sender: TObject);
begin
edit1.Text:='';
edit2.Text:='';

end;

end.

⌨️ 快捷键说明

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