📄 tip.~pas
字号:
unit tip;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls, StdCtrls, Buttons, DB, DBTables, ComCtrls;
type
Ttipfrm = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Edit1: TEdit;
BitBtn1: TBitBtn;
Panel1: TPanel;
Image1: TImage;
b1: TBitBtn;
q1: TQuery;
GroupBox2: TGroupBox;
ListView1: TListView;
procedure b1Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
tipfrm: Ttipfrm;
implementation
uses gl,main1,borrowbook;
{$R *.dfm}
procedure Ttipfrm.b1Click(Sender: TObject);
begin
if edit1.Text='' then messagedlg('请输入图书卡号!',mtinformation,[mbyes],0)
else
begin
userno:=edit1.Text;
main.listbookinfo;
borrowbookfrm.Show;
end;
end;
procedure Ttipfrm.BitBtn1Click(Sender: TObject);
begin
userno:=edit1.Text;
// listview1.Items.Clear;
q1.SQL.Clear;
q1.SQL.Add('select * from student_info where 图书卡号=:n');
q1.ParamByName('n').AsString:=edit1.Text;
q1.Open;
if q1.RecordCount=0 then
begin
messagedlg('没有这个用户!',mtinformation,[mbyes],0);
edit1.Text:='';
end
else
begin
messagedlg('此用户合法!',mtinformation,[mbyes],0);
b1.Enabled:=true;
q1.Close;
q1.SQL.Clear;
q1.SQL.Add('select b.图书编号,b.书名,b.作者,b.出版社,b.类别,a.借出时间 from borrow_info a,book_info b where a.图书卡号='''+userno+'''and a.图书编号=b.图书编号');
q1.Open;
listview1.Items.Clear;
while not q1.Eof do
begin
with listview1.Items.Add do
begin
caption:=q1.fieldbyname('图书编号').AsString;
subitems.Add(q1.fieldbyname('书名').AsString);
subitems.Add(q1.fieldbyname('作者').AsString);
subitems.Add(q1.fieldbyname('出版社').AsString);
subitems.Add(q1.fieldbyname('类别').AsString);
subitems.Add(q1.fieldbyname('借出时间').AsString);
end;
q1.Next;
end;
q1.SQL.Clear;
q1.Close;
end;
end;
procedure Ttipfrm.FormShow(Sender: TObject);
begin
b1.Enabled:=false;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -