您好,欢迎访问三七文档
第1页共15页编号:自学考试计算机信息处理综合作业源程序清单题目:图书管理信息系统院(系):应科院专业:信息管理学生姓名:颜诗琳准考证号:030100300233指导教师:梁海职称:教师第2页共15页系统部分源代码1.登陆界面代码:stem.Data.SqlClientPublicClassForm1InheritsSystem.Windows.Forms.FormDimconnAsNewSqlConnection(Server=.;Database=LibraryManagementSystem;IntegratedSecurity=SSPI)DimcommAsNewSqlCommandDimdsAsNewDataSetDimdaAsNewSqlDataAdapterPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimuserAsStringDimpasswordAsStringuser=TextBox1.Textpassword=TextBox2.TextDimstrAsStringstr=select*from管理员信息whereuser_id='&user&'andpasswd='&password&'comm.Connection=conncomm.CommandType=CommandType.Textcomm.CommandText=strda.SelectCommand=commTryconn.Open()da.Fill(ds)Ifds.Tables(0).Rows.Count0ThenDimfrm1AsNewfrmMainfrm1.Show()Me.Hide()ElseMessageBox.Show(密码或用户名错误,请重新输入,提示信息)TextBox1.Text=TextBox2.Text=TextBox1.Focus()EndIfCatchexAsExceptionMessageBox.Show(登陆失败,提示信息)EndTryEndSub第3页共15页PrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickApplication.Exit()EndSubEndClass2.注销模块代码:ystem.Data.SqlClientPublicClassfrmRegistrationInheritsSystem.Windows.Forms.FormDimconnAsNewSqlConnection(Server=.;Database=LibraryManagementSystem;IntegratedSecurity=SSPI)DimcommAsNewSqlCommandDimdsAsNewDataSetDimds1AsNewDataSetDimdaAsNewSqlDataAdapterPrivateSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickMe.Close()EndSubPrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickTextBox1.Text=TextBox2.Text=EndSubPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimnumAsStringDimstrAsStringnum=TextBox1.Textstr=deletefrom图书信息表whereBook_id='&num&'Ifconn.State=ConnectionState.ClosedThenconn.Open()EndIfds.Clear()comm.Connection=conncomm.CommandType=CommandType.Textcomm.CommandText=strda.SelectCommand=commda.Fill(ds,图书信息表)conn.Close()MessageBox.Show(该图书已注销,提示信息)第4页共15页EndSubPrivateSubButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton4.ClickIfTextBox1.Text=ThenMessageBox.Show(请输入图书编号,提示信息)ElseDimnumAsStringDimstrAsStringnum=TextBox1.Textstr=select*from图书信息表whereBook_id='&num&'Ifconn.State=ConnectionState.ClosedThenconn.Open()EndIfds.Clear()comm.Connection=conncomm.CommandType=CommandType.Textcomm.CommandText=strda.SelectCommand=commda.Fill(ds,图书信息表)Ifds.Tables(0).Rows.Count0ThenDataGrid1.DataSource=ds.Tables(图书信息表)TextBox2.Text=ds.Tables(图书信息表).Rows(DataGrid1.CurrentRowIndex).Item(2)ElseMessageBox.Show(未找到该图书,提示信息)EndIfEndIfEndSubPrivateSubButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton5.ClickIfTextBox4.Text=ThenMessageBox.Show(请输入读者编号,提示信息)ElseDimnumAsStringDimstrAsStringnum=TextBox4.Textstr=select*from读者信息表whereRoll_No='&num&'Ifconn.State=ConnectionState.ClosedThenconn.Open()EndIfds1.Clear()第5页共15页comm.Connection=conncomm.CommandType=CommandType.Textcomm.CommandText=strda.SelectCommand=commda.Fill(ds1,读者信息表)Ifds1.Tables(0).Rows.Count0ThenDataGrid1.DataSource=ds1.Tables(读者信息表)TextBox3.Text=ds1.Tables(读者信息表).Rows(DataGrid1.CurrentRowIndex).Item(2)ElseMessageBox.Show(未找到该读者,提示信息)EndIfEndIfEndSubPrivateSubButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton6.ClickMe.Close()EndSubPrivateSubButton8_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton8.ClickDimnumAsStringDimstrAsStringnum=TextBox4.Textstr=deletefrom读者信息表whereRoll_No='&num&'Ifconn.State=ConnectionState.ClosedThenconn.Open()EndIfds.Clear()comm.Connection=conncomm.CommandType=CommandType.Textcomm.CommandText=strda.SelectCommand=commda.Fill(ds,读者信息表)conn.Close()MessageBox.Show(该读者已注销,提示信息)EndSubPrivateSubButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton7.ClickTextBox3.Text=TextBox4.Text=EndSub第6页共15页EndClass3.查询模块代码:ystem.Data.SqlClientPublicClassfrmBookDemandInheritsSystem.Windows.Forms.FormDimconnAsNewSqlConnection(Server=.;Database=LibraryManagementSystem;IntegratedSecurity=SSPI)DimcommAsNewSqlCommandDimds1AsNewDataSetDimds5AsNewDataSetDimdaAsNewSqlDataAdapterPrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfTextBox1.Text=ThenMessageBox.Show(请输入图书编号,提示信息)ElseDimnumAsStringDimstrAsStringnum=TextBox1.Textstr=select图书信息表.Book_idas图书编号,ISBNasISBN号,Book_nameas图书名称,&_Authoras作者,PublishingHouse_nameas出版社,Publish_timeas出版时间,&_Categoryas图书类别,图书类别关系表.Category_idas索书号,Moneyas单价,&_Total_numas馆藏数量,Send_numas借出数,Send_countas借出次数from图书信息表,&_图书流通统计表,图书类别关系表,图书类别表,图书出版社关系表,出版社信息表&_where图书信息表.Book_id='&num&'and&_图书信息表.Book_id=图书流通统计表.Book_idand图书信息表.Book_id=&_图书出版社关系表.Book_idand图书出版社关系表.PublishingHouse_id=&_出版社信息表.PublishingHouse_idand图书信息表.Book_id=&_图书类别关系表.Book_idand图书类别关系表.Category_id=图书类别表.Category_idIfconn.State=ConnectionState.ClosedThenconn.Open()EndIfds1.Clear()第7页共15页comm.Connection=conncomm.CommandType=CommandType.Textcomm.CommandText=strda.SelectCommand=commda.Fill(ds1,图书信息表)Ifds1.Tables(0).Rows.Count=0ThenMe
本文标题:程序源代码清单
链接地址:https://www.777doc.com/doc-3566077 .html