图书管理系统系统设计(含代码)_第1页
图书管理系统系统设计(含代码)_第2页
图书管理系统系统设计(含代码)_第3页
图书管理系统系统设计(含代码)_第4页
图书管理系统系统设计(含代码)_第5页
已阅读5页,还剩39页未读 继续免费阅读

下载本文档

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

文档简介

1、高级程序设计语言图书管理系统设计报告学院:专业:成员:指导教师:日期:国土资源工程学院测绘工程*黄云铠2014年11月5日1系统设计1.1设计目标本系统是针对图书管理工作过程进行设计的,主要实现如下目标:注册用户可以登录此系统;非注册用户注册后可以使用本系统;读者可以查询、借阅、归还图书等;管理员可以对读者、图书进行管理。1.2数据库设计概述1.2.1概念结构设计将从需求分析中得到的数据信息抽象为概念模型,经分析可得到数据库的E-R模型。如图所示。图1-1图书实体ER图图1-2实体读者ER图用户图1-3用户实体ER图1.2项目规划图书管理系统是一个典型的数据库应用程序,由应用程序和后台数据库两

2、部分构成。(1)应用程序应用程序主要包括登录,注册,用户信息,读者信息,图书信息管理,借阅图书,综合查询,出版社信息等几个部分组成。(2)数据库数据库负责对图书信息,用户信息等数据的管理。2数据库设计说明书1数据库表结构2.1.1图书表book列名允许MullooklcharflOEBookWritenvarchar(30)KIBookNamerwrch占r(20)BookPublishnvrclniar(!50)gBookPublishDatedatetimeISBoolePricerricneyBBookSertnvarcharO1)7HB2.1.2借阅信息表borrow列名允许Nulln

3、“匕_I啓翳瑁char(10HBooUDchar(10SBorrcwDdtedatetimeHReturnDatedatetimeIBOutTimeint7囲TotalFinenchar(10)BLotbitBn2.1.2用户信息表Reader列容允许NullcharflO)RejderNamtnvarchar(20)0Read&rPasswQrdnvrthjrfiO)Envsrthrfj)mRedderAgeintaReaderDeptnvarchar(SO)團ReaderZhuarrVenyarchar(50)aMaxNumb-erintaIsLostnvrchar(15)aReaderE

4、mallvarchar(20)2.1.4用户信息权限表right列名允许NullintMajcTime;ntEFinemoney0Timesint匣2.1.5用户账号表user列名允许Nullchar(10UserPacswordnyarchar(20)gUserSortnvrcharfSO)1=12.1.6管理员账号表usererheper1列名数摒类型允许hullAdmlnlDchart10)BTypenvarchar(20)AdminPassnvarchar(20)ReaderlDchar10)00团ReaderPassnvr匚hNr(20)團n2.2数据关系图2.3图书管理系统暂有数据

5、(模拟运行)2.3.1管理员学工号:2014701020姓名:邢吉昌密码:1112.3.2普通用户学工号:2014701021姓名:猪八戒密码:333学工号:2014701022姓名:孙悟空密码:4442.3.3图书信息编号作者书名出版社出版日期价格书类H319584781MARKC入门经典清华大学出版社2011/4/521.56计算机H319584782哪吒和猴子的那些事天庭文印2010/1/2216.5情感H319584783二郎神我也可以闹天宫天庭文印2009/8/129.32技术3程序功能的实现3.1登陆界面已注册用户登录时,用户类别选择普通用户或管理员,不选择会出现提示主要代码如下:

6、usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;namespaceWindowsFormsApplication1publicpartialclassLoginForm:Formpublicstringpassword;privateintErrorTime

7、s;stringUser,Pwd;boolflagshow=false;privateboolyanzhengshuru()password=textBox3.Text;if(Typename.Text.Trim()=“)MessageBoxShow(“请选择登录类型“,登录提示,MessageBoxButtons.OK,MessageBoxIcon.Information);Typename.Focus();returnfalse;elseif(loginid.Text.Trim()=“)MessageBoxShow(“请输入用户名“,登录提示“,MessageBoxButtons.OK,M

8、essageBoxIcon.Information);loginid.Focus();returnfalse;elseif(password=“)MessageBoxShow(“请输入密码“,登录提示“,MessageBoxButtons.OK,MessageBoxIcon.Information);textBox3.Focus();returnfalse;elsereturntrue;publicLoginForm()lnitializeComponent();privatevoidcancelbtn_Click(objectsender,EventArgse)Application.Exi

9、t();privatevoidLoginForm_Load(objectsender,EventArgse)privatevoidLoginForm_Closing(objectsender,FormClosingEventArgse)Application.Exit();privatevoidloginbtn_Click(objectsender,EventArgse)if(yanzhengshuru()if(Typename.Text.Trim()=管理员“)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress

10、;lnitialCatalog=学生管理数据库IntegratedSecurity=True);conConnection.Open();stringcmd=selectAdminlD,AdminPassfromuserhelper;SqlCommancbom=newSqlComman(tmd,conConnection);SqlDataReaderreader=com.ExecuteReader();while(reader.Read()User=readerAdminlD.ToString();Pwd=readerAdminPass.ToString();if(User.Trim()=lo

11、ginid.Text&Pwd.Trim()=textBox3.Text)flagshow=true;reader.Close();conConnection.Close();if(flagshow=true)this.Hide();adminfl=newadmin();f1.ShowDialog();elseif(Typename.Text.Trim()=普通用户“)SqlConnectionconConnectionl=newSqlConnection(DataSource=.sqlexpress;lnitialCatalog=学生管理数据库IntegratedSecurity=True);

12、conConnection1.Open();stringcnd=selectReaderID,ReaderPasswordfromreader;SqlCommanctnm=newSqlComman(tnd,conConnectionl);SqlDataReaderreaderl=cnm.ExecuteReader();while(reader1.Read()User=reader1Pwd=reader1ReaderlD.ToString();ReaderPassword.ToString();if(User.Trim()=loginid.Text&Pwd.Trim()=textBox3.Tex

13、t)flagshow=true;reader1.Close();conConnection1.Close();if(flagshow=true)this.Hide();读者查阅f1=new读者查阅();f1.ShowDialog();elseMessageBoxShow(用户名不存在或密码错误!,提示);ErrorTimes+;if(ErrorTimes=3)MessageBoxShow(”登录次数过多,程序将关闭);/Application.Exit();return;privatevoidlabel1_Click(objectsender,EventArgse)privatevoidlab

14、el2_Click(objectsender,EventArgse)privatevoidlabel3_Click(objectsender,EventArgse)privatevoidbutton1_Click(objectsender,EventArgse)this.Hide();注册fl=new注册();f1.ShowDialog();privatevoidusercomboBox_SelectedIndexChanged(objectsender,EventArgse)privatevoiduseracctxt_TextChanged(objectsender,EventArgse)p

15、rivatevoidtextBox3_TextChanged(objectsender,EventArgse)3.2登陆界面如果学号已经存在,则会出现“*用户名已经存在,请重新输入”的提示,当重新输入密码时,如果两次密码不相同,则会出现“*请注意,两次密码不一样”的提示主要代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Wind

16、ows.Forms;usingSystem.Data.SqlClient;namespaceWindowsFormsApplication1publicpartialclass注册:Formpublic注册()lnitializeComponent();publicboolUserFlag;privatevoidtextBox3_TextChanged(objectsender,EventArgse)if(textBox2.Text.Trim()!=textBox3.Text.Trim()label6.Visible=true;elselabel8.Visible=true;label6.Vi

17、sible=false;privatevoid注册_Load(objectsender,EventArgse)privatevoidtextBox1_TextChanged(objectsender,EventArgse)学生管理SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;lnitialCatalog=数据库;IntegratedSecurity=True);conConnection.Open();stringcmd=selectReaderIDfromreader;SqlCommanobom=newS

18、qlComman(tmd,conConnection);SqlDataReaderreaderUser=com.ExecuteReader();while(readerUser.Read()if(textBox1.Text=readerUserReaderID.ToString().Trim()label7.Visible=true;UserFlag=true;return;elseif(textBox1.Text!=readerUserReaderID.ToString().Trim()label7.Visible=false;label9.Visible=true;UserFlag=fal

19、se;privatevoidbutton1_Click(objectsender,EventArgse)intindex=textBox4.TextndexOf(if(index1));labellO.Visible=labellO.Text=elselabellO.Visible=labellO.Text=true;邮箱格式不正确,请重新输入true;邮箱格式正确;if(UserFlag=true)MessageBoxShow(“用户已经存在,请重新输入!“);return;if(UserFlag=false)SqlConnectionconConnection=newSqlConnecti

20、on(DataSource=.sqlexpress;lnitialCatalog=学生管理数据库IntegratedSecurity=True);conConnection.Open();stringcmd=insertintoreader(ReaderlD,ReaderPassword,ReaderEmall)values(+textBox1.Text+,+”+textBox2.Text+,+textBox4.Text+);SqlCommanobom=newSqlComman(tmd,conConnection);com.ExecuteNonQuery();conConnection.Clo

21、se();MessageBoxShow(“注册成功!点击确定,返回登录界面。,提示);this.Close();LoginFormf2=newLoginForm();3.3管理员操作界面usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsFormsApplication1public

22、partialclassadmin:Formpublicadmin()InitializeComponent();privatevoid查看用户信息ToolStripMenultem_Click(objectsender,EventArgse)权限设置f8=new权限设置();f8.ShowDialog();privatevoid查看用户信息ToolStripMenultem1_Click(objectsender,EventArgse)用户信息fi=new用户信息();fi.ShowDialog();privatevoid新增用户ToolStripMenultem1_Click(object

23、sender,EventArgse)新增用户f2=new新增用户();f2.ShowDialog();privatevoid删除用户ToolStripMenultem1_Click(objectsender,EventArgse)用户信息f3=new用户信息();f3.button2.Visible=true;f3.ShowDialog();privatevoid录入书籍ToolStripMenultem_Click(objectsender,书籍信息f5=new书籍信息();f5.ShowDialog();privatevoid删除书籍ToolStripMenultem_Click(obje

24、ctsender,删除书籍f6=new删除书籍();f6.ShowDialog();privatevoid还书处理ToolStripMenultem_Click(objectsender,还书处理f9=new还书处理();f9.ShowDialog();privatevoidadmin_Load(objectsender,EventArgse)privatevoid借阅处理ToolStripMenultem_Click(objectsender,借阅处理f10=new借阅处理();EventArgse)EventArgse)EventArgse)EventArgse)f10.ShowDialo

25、g();3.3.1管理用户管理用户下共有三个子菜单詭可户|圏韦套毘新竜用户删除用户新增用户界面主要代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;namespaceWindowsFormsApplication1publicpartialclass

26、新增用户:Formpublic新增用户()lnitializeComponent();privatevoidbutton1_Click(objectsender,EventArgse)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;InitialCatalog=学生管理数据库;IntegratedSecurity=True);conConnection.Open();stringcmd=insertintoreader(ReaderlD,ReaderName,ReaderPassword,ReaderSex,

27、ReaderAge,ReaderDept,ReaderZhuanYe,MaxNumber,ReaderEmall)values(+textBox1.Text+,+textBox2.Text+,+textBox3.Text+,+textBox4.Text+,+m+textBox5.Text+,+吶+textBox6.Text+,+呐+textBox7.Text+,+呐+textBox8.Text+,+”+textBox9.Text+);SqlCommandtom=newSqlComman(Cmd,conConnection);com.ExecuteNonQuery();conConnection

28、.Close();MessageBoxShow(“添加成功!点击确定,返回登录界面。,“提示“);this.Close();331.2删除用户界面输入学号即可查询用户信息,如图,点击删除即删除该用户主要代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient

29、;namespaceWindowsFormsApplication1publicpartialclass用户信息:FormboolUserFlag;public用户信息()InitializeComponent();privatevoidbutton1_Click(objectsender,EventArgse)if(UserFlag=false)MessageBoxShow(不存在该用户,请核对后再输入,警告);return;if(UserFlag=true)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;

30、InitialCatalog=学生管理数据库IntegratedSecurity=True);conConnection.Open();stringcmd=select*fromreader;SqlCommanobom=newSqlCommanc(cmd,conConnection);com.CommandText=select*fromreader;SqlDataReaderdr=com.ExecuteReader();while(dr.Read()labelll.Visible=true;textBox2.Text=drReaderName.ToString().Trim();textBo

31、x3.Text=drReaderPassword.ToString().Trim();textBox4.Text=drReaderSex.ToString().Trim();textBox5.Text=drReaderAge.ToString().Trim();textBox6.Text=drReaderDept.ToString().Trim();textBox7.Text=drReaderZhuanYe.ToString().Trim();textBox8.Text=drMaxNumber.ToString().Trim();textBox9.Text=drReaderEmall.ToSt

32、ring().Trim();conConnection.Close();privatevoidtextBox1_TextChanged(objectsender,EventArgse)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;lnitialCatalog=数据库IntegratedSecurity=True);conConnection.Open();stringcmd=selectReaderlDfromreader;SqlCommanobom=newSqlComman(tmd,conConnecti

33、on);SqlDataReaderreaderUser=com.ExecuteReader();while(readerUser.Read()if(textBoxl.Text=readerUserReaderlD.ToString().Trim()UserFlag=true;return;elseif(textBoxl.Text!=readerUserReaderlD.ToString().Trim()UserFlag=false;privatevoidbutton2_Click(objectsender,EventArgse)SqlConnectionconConnection=newSql

34、Connection(DataSource=.sqlexpress;lnitialCatalog=数据库;lntegratedSecurity=True);conConnection.Open();stringcmd=deletefromreaderwhereReaderlD=+textBox1.Text.Replace(,)+SqlCommanotom=newSqlComman(fcmd,conConnection);com.ExecuteNonQuery();conConnection.Close();MessageBoxShow(是否确认删除,提示);学生管理学生管理查看用户信息界面该界

35、面与删除用户界面代码基本相似,主要是将查询按钮隐藏,故代码不再列出332图书管理图书查询下共有2个子菜单录入书籍页面主要代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;namespaceWindowsFormsApplicationlpublicp

36、artialclass书籍信息:Formpublic书籍信息()lnitializeComponent();privatevoidbutton1_Click(objectsender,EventArgse)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;InitialCatalog=学生管理数据库IntegratedSecurity=True);conConnection.Open();stringcmd=insertintobookTOC o 1-5 h z(BooklD,BookWrite,BookNam

37、e,BookPublish,BookPublishDate,BookPrice,BookSort)values(+textBoxl.Text+,+textBox2.Text+,+呐+textBox3.Text+,+呐+textBox4.Text+,+“+textBox5.Text+,+呐+textBox6.Text+,+呐+textBox7.Text+);SqlCommanobom=newSqlComman(tmd,conConnection);com.ExecuteNonQuery();conConnection.Close();MessageBoxShow(“录入成功“,提示“);TOC

38、o 1-5 h ztextBoxl.Text=;textBox2.Text=;textBox3.Text=;textBox4.Text=;textBox5.Text=;textBox6.Text=;textBox7.Text=;3.322删除书籍删除书籍之前如需确认是否是所需删除的书籍,以防删除错误,可以先将所需删除的书籍的书名输入,点击检索后会出现该书的详细信息,若确认无误后点击删除即可删除该书主要代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;using

39、System.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;namespaceWindowsFormsApplication1publicpartialclass删除书籍:FormboolUserFlag;public删除书籍()lnitializeComponent();privatevoidbutton1_Click(objectsender,EventArgse)if(UserFlag=false)MessageBoxShow(“不存在此书,请核

40、对后再输入,“警告);return;if(UserFlag=true)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;lnitialCatalog=管理数据库IntegratedSecurity=True);学生conConnection.Open();stringcmd=select*frombook;SqlCommanotom=newSqlComman(tmd,conConnection);com.CommandText=select*frombook;SqlDataReaderdr=com.Execut

41、eReader();while(dr.Read()textBoxl.Text=drtextBox2.Text=drtextBox4.Text=drtextBox5.Text=drtextBox6.Text=drtextBox7.Text=drconConnection.Close();BookID.ToString().Trim();BookWrite.ToString().Trim();BookPublish.ToString().Trim();BookPublishDate.ToString().Trim();BookPrice.ToString().Trim();BookSort.ToS

42、tring().Trim();privatevoidtextBox3_TextChanged(objectsender,EventArgse)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;lnitialCatalog=学生管理数据库IntegratedSecurity=True);conConnection.Open();stringcmd=selectBookNamefrombook;SqlCommanotom=newSqlComman(fcmd,conConnection);SqlDataReaderr

43、eaderUser=com.ExecuteReader();while(readerUser.Read()if(textBoxl.Text=readerUserBookName.ToString().Trim()UserFlag=true;return;elseif(textBox1.Text!=readerUserBookName.ToString().Trim()UserFlag=false;privatevoidbutton2_Click(objectsender,EventArgse)学生管理SqlConnectionconConnection=newSqlConnection(Dat

44、aSource=.sqlexpress;lnitialCatalog=数据库;IntegratedSecurity=True);conConnection.Open();stringcmd=deletefrombookwhereBookName=+textBox3.Text.Replace(,”)+SqlCommanotom=newSqlComman(tmd,conConnection);com.ExecuteNonQuery();conConnection.Close();MessageBoxShow(“是否确认删除,“提示);3.3.3权限设置/天)、该界面可以设置普通用户的最大借书数量、

45、最长借阅时间、超期罚款(元遗失赔率等,主要代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;namespaceWindowsFormsApplication1publicpartialclass权限设置:Formpublic权限设置()lnitial

46、izeComponent();privatevoidbutton1_Click(objectsender,EventArgse)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;InitialCatalog=学生管理数据库IntegratedSecurity=True);conConnection.Open();stringcmd=insertintoRight(MaxNum,MaxTime,Fine,Times)values(+textBoxl.Text+,+textBox2.Text+,+呐+textBox

47、3.Text+,+“+textBox4.Text+);SqlCommanobom=newSqlComman(tmd,conConnection);com.ExecuteNonQuery();conConnection.Close();MessageBoxShow(“修改成功“,提示“);this.Close();3.3.4还书处理操作输入书籍号后即可查询借阅人超期信息及图书信息,无误后点击归还确认后界面如下:主要代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data

48、;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.OleDb;usingSystem.Data.SqlClient;namespaceWindowsFormsApplication1publicpartialclass还书处理:FormboolUserFlag;public还书处理()lnitializeComponent();privatevoidbutton2_Click(objectsender,EventArgse)if(UserFlag=f

49、alse)MessageBoxShow(“不存在此书,请核对后再输入,“警告);return;if(UserFlag=true)学生SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;InitialCatalog=管理数据库IntegratedSecurity=True);conConnection.Open();conConnection.Open();stringcmd=select*frombook;SqlCommanotom=newSqlComman(bmd,conConnection);com.Comm

50、andText=select*frombookSqlDataReaderdr=com.ExecuteReader();while(dr.Read()textBoxll.Text=drtextBox12.Text=drtextBox13.Text=drtextBox14.Text=drtextBox15.Text=drtextBox16.Text=drconConnection.Close();BookWrite.ToString().Trim();BookName.ToString().Trim();BookPublish.ToString().Trim();BookPublishDate.T

51、oString().Trim();BookPrice.ToString().Trim();BookSort.ToString().Trim();SqlConnectionconConnectionl=newSqlConnection(DataSource=.sqlexpress;lnitialCatalog=学生管理数据库IntegratedSecurity=True);conConnection1.Open();stringcmdl=selects.*,g*fromborrows,readergwheres.ReaderID=g.ReaderIDSqlCommanoboml=newSqlCo

52、mman(tmd1,conConnectionl);coml.CommandText=selects.*,g*fromborrows,readergwheres.ReaderID=g.ReaderIDSqlDataReaderdr1=com1.ExecuteReader();while(dr1.Read()textBox2.Text=dr1textBox3.Text=dr1textBox4.Text=dr1textBox5.Text=dr1textBox6.Text=dr1textBox7.Text=dr1textBox8.Text=dr1DateTimet1=DateTimet2=(Borr

53、owDate.ToString().Trim();ReturnDate.ToString().Trim();ReaderID.ToString().Trim();ReaderName.ToString().Trim();ReaderSex.ToString().Trim();ReaderDept.ToString().Trim();ReaderZhuanYe.ToString().Trim()ReturnDate;DateTime.Now;DateTime)dr1TimeSpants=t1-t2;intd=ts.Days;Convert.ToString(0);textBox9.Text=if

54、(d=0)textBoxIO.Text=elseConvert.ToString(d);textBoxIO.Text=Convert.ToString(d*0.1);conConnection1.Close();conConnection1.Close();privatevoidtextBox1_TextChanged(objectsender,EventArgse)学生管理数SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;lnitialCatalog=据库IntegratedSecurity=True);c

55、onConnection.Open();stringcmd=selectBookIDfrombook;SqlCommanobom=newSqlComman(tmd,conConnection);SqlDataReaderreaderUser=com.ExecuteReader();while(readerUser.Read()if(textBoxl.Text=readerUserBookID.ToString().Trim()UserFlag=true;return;elseif(textBoxl.Text!=readerUserBookID.ToString().Trim()UserFlag

56、=false;privatevoidbutton1_Click(objectsender,EventArgse)学生管理SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;InitialCatalog=数据库IntegratedSecurity=True);conConnection.Open();stringcmd=deletefromborrowwhereBookID=(+textBox1.Text+);SqlCommanobom=newSqlComman(tmd,conConnection);com.Exe

57、cuteNonQuery();conConnection.Close();MessageBoxShow(“添加成功!点击确定,返回登录界面。,“提示“);this.Close();335借阅处理输入用户名及书籍编号,点击借阅即借书成功,操作后界面如下:主要代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms

58、;usingSystem.Data.SqlClient;namespaceWindowsFormsApplication1publicpartialclass借阅处理:Formpublic借阅处理()lnitializeComponent();privatevoidbutton1_Click(objectsender,EventArgse)if(textBox1.Text.Trim()=“)MessageBoxShow(“请输入用户名“,提示“);return;if(textBox2.Text.Trim()=)MessageBoxShow(“请输入书籍编号“,提示);return;string

59、time=DateTime.Now.ToString();DateTimedt=DateTime.Now.Date.AddDays(30);stringreturntime=dt.ToString();textBox4.Text=time;textBox5.Text=returntime;SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;lnitialCatalog=学生管理数据库;IntegratedSecurity=True);conConnection.Open();stringconn=DataSour

60、ce=.sqlexpress;InitialCatalog=学生管理数据库;IntegratedSecurity=True;stringtt=selectBookNamefrombookwhereBookID=+textBox2.Text+;SqlDataAdapterda=newSqlDataAdapter(tt,conn);DataSetds=newDataSet();da.Fill(ds);textBox3.Text=ds.Tables0.Rows00.ToString();stringcmd=insertintoborrow(ReaderlD,BooklD,BorrowDate,Ret

温馨提示

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

评论

0/150

提交评论