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

📄 unit15.~pas

📁 图书管理系统设计程序
💻 ~PAS
字号:
unit Unit15;

interface

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

type
  Tbook_state = class(TForm)
    DataSource1: TDataSource;
    ADODataSet1: TADODataSet;
    DBGrid1: TDBGrid;
    Button1: TButton;
    Button2: TButton;
    GroupBox1: TGroupBox;
    Edit1: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  book_state: Tbook_state;

implementation
uses unit3;
{$R *.dfm}

procedure Tbook_state.Button1Click(Sender: TObject);
begin  
ADODataset1.Active:=false;
adodataset1.CommandText:='select * from per_book where series='+''''+edit1.Text+'''';
adodataset1.Active:=true;
if adodataset1.RecordCount=0 then
showmessage('没有这本书!')
else
begin
adodataset1.Active:=false;
adodataset1.CommandText:='select * from borrow where series='+''''+edit1.Text+'''';
adodataset1.Active:=true;
if adodataset1.RecordCount=0 then
begin
adodataset1.Active:=false;
adodataset1.CommandText:='select * from borrow where series='+''''+edit1.Text+'''';
adodataset1.Active:=true;
dbgrid1.Visible:=true;
showmessage('此书在馆,没有被借!');
end
else begin
adodataset1.Active:=false;
adodataset1.CommandText:='select reader.reader_no,reader.name,department,type,datelimit,borrow_date,borrow_date+datelimit as 还书日期 from reader,(select * from borrow where series='+''''+edit1.Text+''''+') as borrower where reader.reader_no=borrower.reader_no';
adodataset1.Active:=true;
dbgrid1.Visible:=true;
end;
end;

end;

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

end.

⌨️ 快捷键说明

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