ASPNET程序设计图书馆管理系统.doc_第1页
ASPNET程序设计图书馆管理系统.doc_第2页
ASPNET程序设计图书馆管理系统.doc_第3页
ASPNET程序设计图书馆管理系统.doc_第4页
ASPNET程序设计图书馆管理系统.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

泉州师范学院ASP.NET程序设计图书馆管理系统学 号: 111303048 姓 名: 刘佳 学 院: 数计学院 专 业: 信息管理与信息系统 班 级: 11级 成 绩: 71 背景与目的 ASP.NET课程设计是本学期的一本很重要的专业课,本次课程设计就是为了检测本学期对这本书的掌握情况。本次课程设计也将作为期末考评。2 开发环境与开发工具 网站开发环境:Microsoft Visual Studio 2008集成开发环境。 网站开发语言:C#。 数据库:Microsoft Visual Studio 2008内置数据库。 开发环境运行平台:Windows xp。3 主要功能 主要实现了简单的登录功能、注册功能和基本的增删查改的功能。4 设计与实现4.1 数据库设计与实现 表1 管理员表表2 读者信息表表3图书信息表表4借还表表54.2 系统设计与实现4.2.1构建网站配置文件、全局文件。 配置文件关键代码:4.2.2读者页面设计代码public partial class _Default : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if(!IsPostBack) this.Get_Connection(); protected void Get_Connection() string s_conn = System.Configuration.ConfigurationManager.AppSettingsconn.ToString(); SqlConnection conn = new SqlConnection(s_conn); string sql = select * from BookInfo,Reader,lendinfo where reader.readerid =lendinfo.rid and bookinfo.id=lendinfo.bid and readerid=+Sessionreaderid.ToString()+; SqlDataAdapter adp = new SqlDataAdapter(sql, conn); DataSet ds = new DataSet(); adp.Fill(ds); DataView dv = ds.Tables0.DefaultView; /dv.Sort = ViewStatesort.ToString() + + ViewStatedire.ToString(); this.GridView1.DataSource = ds; this.GridView1.DataBind(); protected void bindReader() string s_conn = System.Configuration.ConfigurationManager.AppSettingsconn.ToString(); SqlConnection conn = new SqlConnection(s_conn); string BookID = TextBox1.Text.ToString(); string bookSql = select * from bookinfo where ID= + BookID + ; SqlDataAdapter adp = new SqlDataAdapter(bookSql, conn); DataSet ds = new DataSet(); adp.Fill(ds); this.GridView2.DataSource = ds; this.GridView2.DataBind(); protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) this.bindReader(); protected void GridView2_RowUpdated(object sender, GridViewUpdatedEventArgs e) public void bind() string s_conn = System.Configuration.ConfigurationManager.AppSettingsconn.ToString(); SqlConnection conn = new SqlConnection(s_conn); string sqlstr = select * from BookInfo; SqlDataAdapter myda = new SqlDataAdapter(sqlstr, conn); DataSet myds = new DataSet(); conn.Open(); myda.Fill(myds, BookInfo); GridView1.DataSource = myds; GridView1.DataKeyNames = new string id ; GridView1.DataBind(); conn.Close(); 4.2.3借还管理页面设计代码public partial class LendReturn : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) this.BindGriview(); protected void BindGriview() string s_conn = System.Configuration.ConfigurationManager.AppSettingsconn.ToString(); SqlConnection conn = new SqlConnection(s_conn); string sql = select * from lendinfo; SqlDataAdapter adp = new SqlDataAdapter(sql, conn); DataSet ds = new DataSet(); adp.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) string lendinfo = this.GridView1.DataKeyse.RowIndex.Value.ToString(); string delete_sql = delete from lendinfo where bid= + lendinfo + ; /string delete_sql = delete from bookinfo where id= + bookinfo + ; string s_conn = System.Configuration.ConfigurationManager.AppSettingsconn.ToString(); SqlConnection conn = new SqlConnection(s_conn); SqlCommand cmd = new SqlCommand(delete_sql, conn); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); this.bind(); protected void Button1_Click(object sender, EventArgs e) string BID = this.TextBox1.Text.Trim(); string RID = this.TextBox2.Text.Trim(); string lenddate = System.DateTime.Now.ToString(); string returndate = System.DateTime.Now.AddDays(10).ToString(); string s_conn = System.Configuration.ConfigurationManager.AppSettingsconn.ToString(); string sql = insert into Lendinfo(BID,RID,lenddate,returndate) values( + BID + , + RID + , + lenddate + , + returndate + ); SqlConnection conn = new SqlConnection(s_conn); SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); this.bind(); Response.Write(借阅成功); this.bind(); public void bind() string s_conn = System.Configuration.ConfigurationManager.AppSettingsconn.ToString(); SqlConnection conn = new SqlConnection(s_conn); string sqlstr = select * from lendinfo; SqlDataAdapter myda = new SqlDataAdapter(sqlstr, conn); DataSet myds = new DataSet(); conn.Open(); myda.Fill(myds, lendinfo); GridView1.DataSource = myds; GridView1.DataKeyNames = new string BID ; GridView1.DataBind(); conn.Close(); protected void Button2_Click(object sender, EventArgs e) Response.Redirect(manager.a

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论