Sql-server数据库课程设计的报告-图书馆管理系统.docx
数据库课程设计设计选题:图书管理系统系别信息工程系专业计算机网络技术班级2010022201姓名马斌龙学号201002220137姓名王贤宽学号201002220137姓名黄晓辉学号201002220140指导教师2011年12月29日一.系统需求分析图书管理工作繁琐,借阅频繁,包含大量的信息数据,因此就需要一个完善的图书管理系统来实现对这些数据的有效管理。本系统主要任务就是对图书、读者、借阅信息、查询进展统一管理,满足各类用户的需求。本系统在功能上要实现借阅图书、续借图书、归还图书、催还图书、信息查询等功能。二.数据库分析图书管理系统就是要求图书管理人员通过该系统对图书、读者、借阅信息等进展统一管理,从而实现功能上的借阅图书、续借图书、归还图书、催还图书以及信息查询。这就要求管理人员能够对数据库进展熟练操作而简单的表查询、触发器的建设、存储过程的建设以及用户自定义函数的建设等等这些管理数据库的方法都能对图书馆里系统的管理起到事半功倍的效果。三、图书馆管理系统E-R图四、前后与后台连接示意图五、图书馆管理系统功能算法实现5.1 前台算法实现5.1.1 主界面<?DocTYPEhtmlPUBLIC,'-W3CDTDXHTML1.0TransitionalEN”:/w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd><htmlxmlns=H:/w3.org1999xhtml><head><title>欢迎使用图书管理系统<title><head><bodystyle=,text-align:center><spanstyle=,font-size:24pt,><br/><br/><br/><ahref=.book.aspx">图书信息查询<a><br/><br/><ahref=n.reader.aspx”>读者信息查询<aXbr/><br/><ahref=.record,aspx”>借还信息记录<aXSPan><body><html>5.1.2 图书信息<!DOCTYPEhtmlPUBLIC',-W3CDTDXHTML1.0TransitionalEN:/w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd><htmlxmlns=:/w3.org1999xhtml><headrunat=nserver><title>JSM<title><head><body><formid="forml,'runat=,'server,><divstyle="text-align:center,><asp:LabelID=nLabell"runat="server"TeXt="书名,Xasp:Label><asp:TextBoxID="TextBoxl"runat=,serverX/asp:TextBox><br><asp:ButtonID=nButtonlnrunat=server*'OnClick=Button1_C1ick1Text="查询”/Xbr><asp:GridViewID=nGridViewl"runat=server1'OnSelectedIndexChanged="GridViewl_SelectedIndexChanged"><asp:GridView><div><form><body><html>5.1.3 读者信息<!DOCTYPEhtmlPUBLIC',-W3CDTDXHTML1.0TransitionalEN:/w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd><htmlxmlns=:/w3.org1999xhtml><headid=Headlnrunat=server><head><body><formid="forml,'runat=,'server,><divstyle="text-align:center,><asp:LabelID=nLabellnrunat=server"TeXt="姓名,Xasp:Label><asp:TextBoxID=nTextBoxl"runat=,serverX/asp:TextBox><br><asp:ButtonID=nButtonl"runat="server*'OnClick=nButtonl_ClicklnText=,Si"/Xbr><asp:GridViewID=nGridViewl"runat=server"OnSelectedIndexChanged="GridViewl_SelectedIndexChanged"><asp:GridView><div><form><body><html>5.1.4 借还信息表<!DOCTYPEhtmlPUBLIC',-W3CDTDXHTML1.0TransitionalEN:/w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd><htmlxmlns=:/w3.org1999xhtml><headrunat=server>无标题页<title><head><body><formid="forml,'runat=nserver,><div><div><form><body><html>5.1.5 添加图书usingSystem;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;publicpartialclassadd:System.Web.UI.PageprotectedvoidButtonl_Clickl(objectsenderzEventArgse)stringsi,s2,s3;si=TextBoxl.Text;s2=TextBox2.Text;s3=TextBox3.Text;stringstr="server=W工NKS8O;database=图书管理系E;integratedsecurity=true"SqlConnectioncon=newSqlConnection(Str);SqlCommandcom=newSqlCommand();try(com.Connection=con;com.CommandText="insert图书信息表values(,+si+”,+s2+,z,+s3+,);con.Open();com.ExecuteNonQuery();con.Close();ReSPOrlSe.Write("插入成功”);)catch(Exceptional)(ReSPOnSe.Write("插入失败”);)finally(con.Close();)5.1.6 删除图书protectedvoidButton3_CIick(objectsender,EventArgse)(strings4;s4=TextBox4.Text;stringstr="server=WlNKS8("database=图书管理系统;integratedsecurity=true;SqlConnectioncon=newSqlConnection(Str);SqlCommandcom=newSqlCommandO;com.Connection=con;com.CommandText=',delete图书信息表wherebname=,*+s4+con.Open();com.ExecuteNonQuery();con.Close();Response.Write("删除成功'');)catch(Exceptional)Response.Write("删除失败'');)nally(con.Close();)5.1.7 添加读者usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;publicpartialclassmanger:System.Web.UI.PageprotectedvoidButtonl_Click(objectsender,EventArgse(stringsirs2rs3;51 =TextBoxl.Text;52 =TextBox2.Text;53 =TextBox3.Text;stringstr="server=W工NKS8O;database=图书管理系;integratedsecurity=true"SqlConnectioncon=newSqlConnection(Str);SqlCommandcom=newSqlCommand();trycom.Connection=con;com.CommandText="insert读者信息表values(,+si+”Ii+s2+'z,+s3+,');con.Open();com.ExecuteNonQuery();con.Close();ReSPOnSe.Write("添加成功”);)catch(Exceptional)(ReSPOnSe.Write("添加失败”);)finally(con.Close();)5.1.7删除读者、usingSystem;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.ULWebControls;usingSystem.Web.ULWebControls.WebParts;usingSystem.Web.ULHtmlControls;protectedvoidButton2_CIick(objectsender,EventArgse)(strings4;s4=TextBox4.Text;stringstr=,Kerver=WINKS80;(IatabaSe=图书管理系统;integratedsecurity=true;SqlConnectioncon=newSqlConnection(Str);SqlComm