1、c#运行平台:Windows 8数据库:sql 2012二、功能模块分析2.1、读者数据流图(1)图书借阅系统完成用户的借书过程其数据流图如图3-2所示。图3-1 借阅系统的数据流图(2)还书系统完成图书的归还过程其数据流图如图3-3所示。图3-2 归还系统的数据流图2.2读者用例图2.3读者E-R图读者功能E-R图三、读者的功能及实现3.1读者登录功能protected void Button1_Click(object sender, EventArgs e) /*取得帐号密码信息*/ string userName = this.txtName.Text; string password
2、 = this.txtPwd.Text; string identify = this.Identify.SelectedValue; 、 ReaderModel readerModel = new ReaderModel(); readerModel.ReaderId = userName; readerModel.ReaderPassword = password; ReaderLogic readerLogic = new ReaderLogic(); /*如果读者帐号信息正确*/ if (readerLogic.IsExistReaderInfo(readerModel) Sessio
3、nreaderFlag = true;readerId = userName; Response.Redirect(Reader/index.aspx); /*如果读者帐号信息不正确*/ else Response.Write(alert( + readerLogic.ErrMessage + /script3.2查询信息protected void BindData() string keyword = this.Keyword.Text; int diskTypeId = Int32.Parse(this.DiskType.SelectedValue); string isRecommen
4、d = this.IsRecommend.SelectedValue; /*调用业务层进行查询*/ this.GridView1.DataSourceID = ; this.GridView1.DataSource = (new DiskLogic().QueryDiskInfo(keyword, diskTypeId, isRecommend); this.GridView1.DataBind(); protected void Btn_Query_Click(object sender, EventArgs e) /*取得查询的各个参数*/ protected void GridView1
5、_RowDataBound(object sender, GridViewRowEventArgs e) if (e.Row.RowType = DataControlRowType.DataRow) /当鼠标选择某行时变颜色 e.Row.Attributes.Add(onmouseover, c=this.style.backgroundColor;this.style.backgroundColor=#00ffeeonmouseoutthis.style.backgroundColor=c; /*如果出版社的文字长度够长就剪切些 string publishing = e.Row.Cell
6、s4.Text; if (publishing.Length 6) e.Row.Cells4.Text = publishing.Substring(0, 6) + . */ protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) /*调用业务层得到查询的结果数据集*/ DataSet ds = new DataSet(); ds = (new DiskLogic().QueryDiskInfo(keyword, diskTypeId, isRecommend); /*将查询结果集绑定
7、到gridview控件上*/ this.GridView1.DataSourceID = null; this.GridView1.DataSource = ds; this.GridView1.PageIndex = e.NewPageIndex; ;3.3读者借阅信息protected void Page_Load(object sender, EventArgs e) /*验证是否登陆了系统*/ if (Session = null)top.location.href=./login.aspx return; /*得到该读者的所有借阅图书信息*/ DataSet ds = LoanLog
8、ic.GetDiskLoanInfo(Session.ToString(); if (ds.Tables0.Rows.Count = 0) this.Result.Text += trtd colspan=4 align=centerfont color=red你还没有图书借阅信息!/font/td/tr /*遍历输出该读者的所有借阅信息*/ for (int i = 0; i + diskModel.DiskIndex + + diskModel.DiskName + + Convert.ToDateTime(drborrowTime).ToShortDateString() + /*如果该
9、图书还没有续借*/ if (Convert.ToInt32(drisContinue) = 0) /*如果没有续借但已经超过归还时间了*/ if (LoanLogic.IsOverdue(Convert.ToInt32(drloanId)没续借但超期,请速还! /*如果没有续借并且还没有超过归还时间*/没续借,可以 a href=diskContinueBorrow.aspx?loanId= + dr + 续借 /*如果该图书已经续借了*/ /*如果已经办理了续借但是超期了*/已续借但超期,请速还! /*如果已经办理了续借并且还没有超期*/已续借并且还没到期!四、程序运行截图4.1登录界面4.2主界面4.3图书信息查询4.4图书预约信息4.5系统设置五、心得通过这次设计和开发真切地体会到课程设计的目的在于学习新的知识并掌握具体的方法。回
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1