图书管理信息系统开发文档 下载本文

4.软件测试过程

4.1测试环境

4.1.1硬件环境

CPU 1.8300GHz 硬盘:320G 4.1.2软件环境 Delphi7 4.1.3数据环境 SQL server 2000 4.1.4网络环境 不用

4.2功能测试

4.2.1模拟现场测试

由登录主界面登录,进入主菜单,然后选择功能块还可以用户之间得切换。 4.2.2应用现场测试

可以借阅,归还,读者信息管理等,图书入库等。

5.结论

两个星期的数据库课程设计,首先自己初步弄出了一个图书管理信息系统,刚开始觉得蛮不错的,但是在验收的时候,通过老师的指点,才知道自己对于这个系统还有很多欠缺的地方。不可否认的是自己对数据库的相关知识有了更深刻的认识。对于图书管理信息系统有了更直观的认识。

6参考文献和附录

1刘前进 《Delphi数据库编程技术》

2<<数据库系统概论>> 王珊 萨师煊 编著 高等教育出版社 3肖永顺 《Delphi 程序设计》

部分核心代码:

ADOQuery1.Close; ADOQuery1.SQL.Clear;

ADOQuery1.SQL.Text:='select * from 系统管理员 where 用户名='''+Trim(Edit1.Text)+'''and 密码='''+Trim(Edit2.Text)+''''; ADOQuery1.Open;

issuper:=trim(ADOQuery1.FieldByName('权限').AsString);

if ADOQuery1.Recordset.RecordCount=0 then begin

MessageBox(handle,'用户名或密码错误,请重新输入','提示',mb_IconWarning+mb_OK); Edit1.Clear; Edit2.Clear; Edit1.SetFocus; end begin inherited; adoquery1.Close; adoquery1.SQL.Clear;

adoquery1.SQL.Add('select max(入库编号) 最大编号 from 新增图书'); adoquery1.Open;

maxnum:=adoquery1.FieldByName('最大编号').AsInteger; maxnum:=maxnum+1; newnum:=inttostr(maxnum); if length(newnum)=1 then dbedit1.Text:='000000'+newnum; if length(newnum)=2 then dbedit1.Text:='00000'+newnum; if length(newnum)=3 then

dbedit1.Text:='0000'+newnum; if length(newnum)=4 then dbedit1.Text:='000'+newnum; if length(newnum)=5 then dbedit1.Text:='00'+newnum; if length(newnum)=6 then dbedit1.Text:='0'+newnum; //插入当前时间(订购时间)

dbedit8.Text:=datetostr(date)+' '+timetostr(time); //新加入的图书都是未验收的,所以此项必须是false dbcombobox1.SelText:='False'; end;

procedure TaddbookF.DBEdit6KeyPress(Sender: TObject; var Key: Char); begin inherited;

if(key<=#39)and(key>=#30) then dbedit6.Text:=dbedit6.Text+key; end;

procedure TaddbookF.DBEdit7KeyPress(Sender: TObject; var Key: Char); begin inherited;

if(key<=#39)and(key>=#30) then dbedit7.Text:=dbedit7.Text+key; end;

procedure TaddbookF.BitBtn2Click(Sender: TObject); var

newform:TselectF; begin inherited;

newform:=TselectF.Create(application);

end;

procedure TaddbookF.FormActivate(Sender: TObject); begin inherited;

if panel2.Enabled=true then dbedit2.Text:=listF.Formcap; end;

procedure TaddbookF.DBEdit2Change(Sender: TObject); begin inherited; //设置书名的显示 adoquery1.Close; adoquery1.SQL.Clear;

adoquery1.SQL.Add('select 书名 from 图书信息 where 图书编号='''+dbedit2.Text+''''); adoquery1.Open;

edit4.Text:=adoquery1.FieldByName('书名').AsString; end;

procedure TaddbookF.BitBtn3Click(Sender: TObject); begin inherited; //新书入库

adocommand1.CommandText:='exec sf_新增图书'; adocommand1.Execute; //更新数据库

adotable1.Active:=false; adotable1.Active:=true; end;

adoquery1.Close;