unit3.pas

来自「图书馆管理系统设计用delphi开发的系统」· PAS 代码 · 共 94 行

PAS
94
字号
unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls;

type
  TForm3 = class(TForm)
    title: TLabel;
    GroupBox3: TGroupBox;
    Image2: TImage;
    Label3: TLabel;
    Label4: TLabel;
    namebox: TEdit;
    pwdbox: TEdit;
    GroupBox2: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

uses module, Unit4, main, Unit6, user_borrow, Unit7;

{$R *.dfm}

procedure TForm3.BitBtn1Click(Sender: TObject);
begin
if radiobutton1.Checked then
begin
with datamodule1.studentADOQuery1 do
begin
 close;
   sql.Clear;
sql.add('select 姓名,学生证号 from student where 姓名='''+namebox.text+'''');
open;
end;
if datamodule1.studentADOQuery1.Locate('姓名',trim(namebox.text),[]) and
datamodule1.studentADOQuery1.Locate('学生证号',trim(pwdbox.text),[]) then
begin
Form4.show;
Form3.Hide;
Form4.Edit1.Text:=namebox.text;
borrow.edit2.text:=pwdbox.text;
borrow.edit2.ReadOnly:=true;   lookform7.edit1.text:=pwdbox.text ;  lookform7.edit1.ReadOnly:=true;
showmessage('请仔细阅读借书提示,以免造成没必要的损失!');
end
else showmessage('您输入了错误的用户号或密码!');
pwdbox.Clear;
end;
if radiobutton2.Checked then
begin
with datamodule1.adminADOQuery1 do
begin
close;
sql.clear;
sql.add('select 姓名,密码 from customer where 姓名='''+namebox.text+'''');
open;
end;
if datamodule1.adminADOQuery1.Locate('姓名',trim(namebox.text),[]) and
datamodule1.adminADOQuery1.Locate('密码',trim(pwdbox.text),[])  then
begin
Form1.show;
Form3.Hide;
//showmessage('请仔细阅读借书提示,以免造成没必要的损失!');
end
else showmessage('您输入了错误的用户号或密码!');
pwdbox.Clear;
end;
end;
procedure TForm3.BitBtn2Click(Sender: TObject);
begin
form3.Close;
end;

end.




⌨️ 快捷键说明

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