版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、乡运城#数据库课程设计报告教学管理系统实验题目:教学管理系统教学管理系统目录一、概述3二、总体设计31、软件环境:32、硕件环境:4三、实验主要内容41、主要数据表42、功能模块4四、系统分析报告41、数据流图42、系统功能模块63、业务流图64、系统数据模型设计7五、代码实现101 登录界面102 注册界面113 教师界面 134 课表管理 145 成绩管理 156 学生界面 177 网上评教 18六、系统实现结果18七、实验分工及总结23概述数据库课程设计是集中实践性环节之一,是学习完数据库原理及应用课程后进行的一次全面的综合的实践练习,主要目的在于 加深学生对数据库基础理论和基本知识的理
2、解,熟悉数据库的设计方 法,掌握基于数据库的信息管理系统的开发方法,进一步加强学生综 合运用知识和实践动手的能力。学生根据所学的数据库原理与程序设计的知识,能够针对一个小型 的数据库管理系统,进行系统的需求分析,系统设计,数据库设计, 编码,测试等,完成题目要求的功能,从而达到掌握开发一个小型数据 库的目的。二、总体设计1、软件环境:Visual Studio 2010、SQL Server Management Studio2、硬件环境:PC机三、实验主要内容1、主要数据表课程信息表,学生信息表单,教师信息表,学生成绩表等。2、功能模块(1)课程设置,包括:查询、添加、删除、查询和修改课程信
3、(2)学生成绩查询,网上评教。(3)教师查询课程时间和教室的安排。(4)教师管理学生成绩查询,添加,修改,删除。word教育资料(5)学生和教师信息的注册。四、系统分析报告1、数据流图教学管理系统的基本数据流图如下所示:学生选课信息教师选课审核信息新增课程选课管理图1教学管理系统的基本数据流图学生成绩信息任课老师学生考试信息考试成绩管理员学生信息管理个人考试信息成绩管理成绩确认信息图2教学管理系统的基本数据流图排课信息排课信息管理员课表信息个人考试成绩学生任课教师图3教学管理系统的基本数据流图2、系统功能模块本系统主要包括学生信息管理、课程信息管理、成绩信息管理等模块,另外还包括进行系统管理的
4、一些辅助模块。其示意图如下:3、业务流图4、系统数据模型设计(1)系统ER图各实体E-R图:学生信息:课程信息:课程信息教师信息:学生成绩:(2)关系模式学生信息(姓名,学号,登录密码)课程信息(课稈号,课程名,上课教室,登录密码,教师信息(教师编号,姓名,登录密码)学生成绩(学号,课程号,课程名,成釦(3)数据表课程信息表PGshiy - dboxoursecouraenumcoursmamecourxsedassOMjrsehmecourseaddressk墩提降1401星期一6)13061002java1401星期一 (3.4)13061003android1401星期一(L2>1
5、4081004软件工程1401星期二(3,4)203051005谦入式1401星期五(3,4)1308教师信息表TKMty* dbo.teachertusernumtusemafnetpvd|l2:-5 |M孙走师SU112341-M101马老师ml2341401010斤斤计较p456'个人丿丁戈绩表cotxsenumcoursenamecoursegrade敎18库as1002java891003android労1004软件工程771005请入式60100685*nullNUUAUZ学生成绩表201410010310018920141001031002java872014100103
6、1003andrord8420141001031004软件工程852014100103100$锻入式84学生课表亠. PGthiy dbascaurM PC.shiy - dboxourse PC.shiy db(1 weekdaycnumcname> sm1002java星期六1001数据库星期日1003釦 dr cud;星期三1003android星期四1004软件工程星期五1005嵌入式星期-1001数据库*|A«ZNULLNULL五、代码实现1 登录界面Private Sub Forml_Load(ByVal sender As System. Object, By V
7、ai e As System. Eve nt Args ) Handles MyBase.LoadDim min, max, rndnum, i As Integermin = 10max = 99TextBox4.Text =”For i = 0 To 1rndnum =CStr ( CInt (min + Rnd() * (max - min)TextBox4.Text = TextBox4.Text &”" &mdnumNe xtEnd SubPrivate Sub Button2_Click( ByVai sender As System. Object, B
8、y Vai e As System. Eve nt Args )Handles Button2.ClickDim ConnStr As String = HServer=(local);uid=sa;pwd=1234;database=shiyMDim cn As SqlClient. SqlConnection = NewSqlClientSqlConnection (ConnStr),建? §立C ?e连? 接?对?象 ?,?同8?时o?d说I i明?连? 接 ?字d?符O?串?Dim cmd As NewSqlClient.SqlCommand'生I “ 2 成“丨命
9、“ 1 令?对C?象?, ?用?于? “ 2 执?行DSQL语??句?Dim dr As IDataReader,用?来 CS?临 C “ '时 o?d?放存CS?执?行 D 语??句?后?的 i?结 “ C果?Dim SQLStr As StringTrue ThenIf RadioButton 1.Checked =SQLStr =Hselect *from teacher where tusernum=M+ TextBoxl .Text +cmd.Connection = cncn.Open()cmd.CommandTe xt = SQLS trdr = cmd.ExecuteR
10、eader()If dr.Read() ThenIf dr!tpwd.ToString().Triin = TextBox2.TextThenIf TextBox3.Text = TextBox4.Text ThenMsgBox(”登 i?录?成 I 功”)Dim jiaoshi As New Form3 jiaoshi.ShowDia log()Hide()ElseMsgBox(End If”验丨证?Q码?错?误?")ElseMsgBox(”密 1 码?不?正 y 确 ?B)End IfElseMsgBox(” 该?用?户?i 不?存?在 2“)End Ifdr.Close()cn
11、.Close()ElseSQLStr ="select *from student where snum="+ "n,+ TextBoxl .Text +cmd.Connection = cncn.Open()cmd.CommandTe xt = SQLStrdr = cmd.ExecuteReader()If dr.Read() ThenIf dr!spwd.ToString().Trim = TextBox2.TextThenIf TextBox3.Text = TextBox4.Text ThenMsgBox(”登 i?录?成 I 功I”)Dim xuesh
12、eng As New Form6xuesheng.Show()Me. Hide ()ElseMsgBox('* 验-I 证?。码?错? a 误?M)End IfElseMsgBox(”密"1 码?不?正 y 确 ?O“)End IfElseMsgBox(” 该?用?户?i 不?存?在"2“)End Ifdr.Close()cn.Close()End IfEnd SubPrivate Sub Button l_Click( ByVai sender As System. Object, By Vai e As Sys tem. EventArgs ) Handles
13、Button 1 .ClickDim zhuce As New Form2zhuce.Show()Me. Hide ()End Sub2.注册界面Public Class Form2Dim objDS As New DataSetDim objXSTable As DataTableDim objda As NewSqlClientSqlDataAdapterDim cn As NewSqlClient. SqlConnection (nserver=(local);uid=sa;pwd=l234;database=shiyMPublic Sub refreshdata()objda.Upda
14、te(objDS,"teacher"),第 i '2 二 t 个?参?数 oy 为 a 需要 a。更1 新?数 oy 据 Y 库 a表a" a名?objXSTable.Clear()Me.zhuce_Click( Nothing , Nothing )objDS.AcceptChanges()End SubPrivate Sub zhuce_Click( ByVai sender As System. Object, By Vai e As Syste m. Eve nt Args ) Handleszhuce .ClickDim cmd As NewSq
15、lClient SqlCommandcmd.Connection = cn,数 oy 据 Y 从? " ?当 i ?d 前?建? §立 ?0?连的 <n?接"?cn 中 D 进?入"?If RadioButton 1.Checked =True ThenDim builderAs SqlClientSqlCommandBuilder = NewSqlClient. SqlCommandBuilder(objda)Trycn.Open()cmd.CommandText ="select * from teacher11objda.S ele
16、ctCommand = cmdobjda.Fill(objDS,"teacher")objXS Table = objDS .Table s("teacher")cn.Close()Dim response As MsgBoxResultresponse = MsgBox(” 确"?实 ol i 要 a 注。d ?Q 册"Ce?吗 e?'1,vbOKCancel +vbQuestion,"系I i 统 a3 提?0 示?”o)If response = MsgBoxResult.Ok ThenDim myRow As
17、 DataRowmyRow = objXS Table.NewRowmyRow("tusernum") = TextBoxl .TextmyRow(ntusernameM) = username 1 .TextmyRow(HtpwdM) = mima l.TextobjXS Table .Rows.Add(myRow)teacher11 )objda.Update(objDS, objDS .AcceptChanges() refreshdata()End IfCatch ex As ExceptionEnd TryElseDim builderAs SqlClient S
18、qlCommandBuilder = NewSqlClient. SqlCommandBuilder(objda)cn.Open()cmd.CommandText =nselect *fh)m student11objda.SelectCommand = cmdobjda.Fill(objDS,"student11 )objXS Table = objDS .Tables('student'1 ) cn.Close()Dim response As MsgBoxResultresponse = MsgBox("确 “?。实 ol i 要 a 注。d?Q 册&
19、quot;Oe?吗 e?n, vbOKCancel + vbQuestion,”系I i统a3提? " C示? ”o)If response = MsgBoxResult.Ok ThenDim myRow As DataRowmyRow = objXS Table.NewRowmyRow("snum") = TextBoxl .TextmyRow(nsnamen) = username 1 .TextmyRow(”spwcT ) = mima 1 .TextobjXS Table.Rows .Add(myRow)HstudentM )objda.Update (o
20、bjDS, objDS .AcceptChanges() re freshdata()End IfEnd IfDim denglu As New Forml denglu.Show()Me. Hide ()End SubPrivate Sub chongzhi_Click( ByVai sender As System. Object, By Vai e As Sys tem. EventArgs ) Handles chongzhi.Clickusername 1. Text =,Hmima 1.Text =”qmimal.Text =""End SubEnd Class
21、3. 教师界面Public Class Form3Private Sub Button l_Click( ByVai sender As System. Object, By Vai e As System. EventArgs )Handles Button 1.ClickDim kebiao As New Form4kebiao.Show()Me. Hide ()End SubPrivate Sub Button4_Click( ByVai sender As System. Object, By Vai e As System. Eve nt Args )Handles Button4.
22、ClickDim denglu As New Forml denglu.ShowQMe.Hide()End SubPrivate Sub Button5_Click( ByVai sender As System. Object, By Vai e As System. Eve nt Args )End SubPrivate Sub Button2_Click( ByVai sender As System. Object, By Vai e As System. EventArgs )Handles Button2.ClickDim chengjig As New Form5chengjig
23、.Show()Me. Hide ()End SubPrivate Sub Button3_Click( ByVai sender As System. Object, By Vai e As Sys tern. EventArgs )End Sub4. 课表管理Private Sub Button l_Click(By Vai sender As Syste m. Object, By Vai e As System. EventArgs )Handles Button 1 .ClickDim conn As New SqlConnectionDim comm As New SqlComman
24、dconn.Connections tring =Hserver=(local); uid=sa;pwd=1234;database=shiynconn.Open()comm.CommandText =nselect *from course where coursenum =,M&Me.TextBox 1.Text &and courxseclass="' & Me.TextBox2.Text &comm.Connection = conncomm.CommandText =nselect coursename from course whe
25、re coursenum =Ht&Me.TextBoxl.Text & and courxseclass="' &Me.TextBox2.Text &Me. TextBox3.Te xt = comm.Execute Scalarcomm.Connection = conncomm.CommandText ="select coursetime fi-om course where coursenum =n&Me.TextBoxl.Text & H, and courxseclass=Ht &Me.TextBo
26、x2.Text &Me. TextBox4.Te xt = com m. ExecuteScalarcomm.Connection = conncomm.CommandText =nselect courseaddress fi-om course where coursenum =n,&Me.TextBoxl.Text & and courxseclass=*" &Me.TextBox2.Text &Me. TextBox5.Te xt = comm.Execute Scalarcomm.Connection = connconn.Close
27、()End SubPrivate Sub Button2_Click( ByVai sender As System. Object, ByVai e As System. Eve nt Args )Handles Button2.ClickDim jiaoshyiemian As New Form3jiaosh yie mian.S how()Me. Hide ()End Sub5 成绩管理Imports Syste m.Data.SqlClientPublic Class Form5Private Sub Button5_Click( ByVai sender As System. Obj
28、ect,By Vai e As Sys tern. EventAigs ) Handles Button5.ClickDim jiaoshi As New Form3jiaoshi.Show()Me. Hide ()End SubPrivate Sub Button l_Click( ByVai sender As System. Object, By Vai e As Sys tern. Eve nt Args )Handles Button 1 .ClickDim conn As New SqlConnectionDim comm As New SqlCommandconn.Connect
29、ions tring =nserver=(local); uid=sa;pwd=1234;database=shiyMconn.Open()comm.CommandText ="select * from chengji"comm.Connection = connDim da As New SqlDataAdapter (comm.CommandText, conn)Dim ds As New DataSetda.Fill(ds,"chengji")conn.Close()Me.DataGridViewl .DataSource = ds.Tables
30、(O)End SubPrivate Sub Button2_Click( ByVai sender As System. Object, By Vai e As System. EventArgs )Handles Button2.ClickDim conn As New SqlConnectionDim comm As New SqlCommandconn.Connections tring =nserver=(local); uid=sa;pwd=1234;database=shiynconn.Open()comm.CommandText = "insert into cheng
31、ji values(H,& Me.TextBox2.Text &&Me.TextBox3.Text &&Me.TextBox4.Text && Me.TextBox5.Text &comm.Connection = conncom m. Execute NonQueryOcomm.CommandText = "select * from chengji”comm.Connection = connDim da As New SqlDataAdapter (comm.CommandText, conn)Dim ds As
32、New DataSetda.Fill(ds,"chengji")conn.Close()Me.DataGridViewl .DataSource = ds.Tables(O)End SubPrivate Sub Button3_Click( ByVai sender As System. Object, By Vai e As System. EventArgs ) Handles Button3.ClickDim conn As New SqlConnectionDim comm As New SqlCommandconn.Connections tring =nserv
33、er=(local); uid=sa;pwd=1234;database=shiynconn.Open()comm.CommandText= "update chengji set snum=H, &Me.TextBox2.Text &ncoursenum=H& Me.Te xtBox3.Text & ”,course name& Me .Te xtBox4.Te xt & "coursegrade" &Me.TextBox5.Text & where snum=,n & Me.TextBox
34、2.Text &comm .Connection = conncom m. Execute NonQueryOcomm.CommandText ="select * from chengji11comm.Connection = connDim da As New SqlDataAdapter (comm.CommandText, conn)Dim ds As New DataSetda.Fill(ds,"chengji")conn.Close()Me.DataGridViewl .DataSource = ds.Tables(O)End SubPriva
35、te Sub Button4_Click( ByVai sender As System Object, By Vai e As System EventArgs ) Handles Button4.ClickDim conn As New SqlConnectionDim comm As New SqlCommandconn.Connections tring =Hserver=(local); uid=s a ;pwd= 1234;da taba se =shiynconn.Open()comm.CommandText =ndelete ft-om chengji where snum =
36、n& Me.TextBox2.Textcomm.Connection = conncom m. Execute NonQueryOcomm.CommandText ='select * from chengji”comm.Connection = connDim da As New SqlDataAdapter (comm.CommandText, conn)Dim ds As New DataSetda.Fill(ds,"chengji")conn.Close()Me. Da ta G rid Vie w 1 .DataSource = ds.Tables
37、(O)End Sub6.学生界面Private Sub Button6_Click( ByVai sender As System. Object,By Vai e As System. Eve nt Args ) Handles Button6.ClickDim denglu As New Formldenglu.Show()Me. Hide ()End SubPrivate Sub Button l_Click( ByVai sender As System. Object, By Vai e As System. EventArgs ) Handles Button 1 .ClickDi
38、m conn As New SqlConnectionDim comm As New SqlCommandconn.Connections tring =Hserver=(local); uid=s a ;pwd= 1234;da taba se =shiynconn.Open()comm.CommandText = "select *from scoursencomm.Connection = connDim da As New SqlDataAdapter (comm.CommandText, conn)Dim ds As New DataSetda.Fill(ds,"
39、scourse")conn.Close()Me.DataGridViewl .DataSource = ds.Tables(O)End SubPrivate Sub Button3_Click( ByVai sender As System. Object, By Vai e As System. EventArgs )End SubPrivate Sub Button2_Click( ByVai sender As System. Object,By Vai e As Sys tern. EventAigs )Handles Button2.ClickDim conn As New SqlConnectionDim comm As New SqlCommandconn.Connections tring =nserver=(local); uid=sa;pwd=1234;database=shiynconn.Open()comm.CommandText = 'select * from grchengji,r comm.Connection = connDim da As New SqlDataAdapter (comm.Comman
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024专业医用耗材供应协议
- 青海红十字医院进修学员二零二四年度转院进修合同3篇
- 2024年度草莓产业优惠政策申请合同3篇
- 2024年合同手册:公司日常经营管理规范与规则3篇
- 2024年国际海运出口货代合同3篇
- 2024年品牌家纺产品销售合同
- 校园教学楼新风系统安装合同
- 2024年度智能家居产品研发与销售综合协议2篇
- 2024专业无车承运物流服务协议范例版B版
- 苗木种植商会协议
- 实验4销售与应收管理-实验报告.doc
- 国家开放大学《基础会计》章节测试参考答案
- 部队教案-班队列教案
- 村镇建筑工匠培训班试题(共3页)
- 中等职业学校教学质量评价体系1
- 常见急危重病人抢救流程图上墙
- 股票交易记录模板
- 内科学常见疾病英语词汇
- 2021年国网电网建设(变电专业)考试题库(含答案)
- LED灯珠检验标准
- 肠梗阻病人的护理-PPT
评论
0/150
提交评论