软件工程课程设计-学生信息管理系统.doc

上传人:xin****828 文档编号:6646444 上传时间:2020-03-01 格式:DOC 页数:29 大小:896.50KB
返回 下载 相关 举报
软件工程课程设计-学生信息管理系统.doc_第1页
第1页 / 共29页
软件工程课程设计-学生信息管理系统.doc_第2页
第2页 / 共29页
软件工程课程设计-学生信息管理系统.doc_第3页
第3页 / 共29页
点击查看更多>>
资源描述
软件工程课程设计任务书课题名称学生信息管理系统设计目的本课程设计的目的是通过实践使学生经历一个软件系统开发的全过程并受到一次综合的训练,以便能较全面地理解、掌握和综合运用所学的知识去分析、解决实际问题。实验环境1、Windows 7及以上2、SQL Server20083、VS.NET任务要求任务:完成学生信息管理系统系统的分析设计工作,并选用适当的开发工具完成系统的开发。要求:1、完成需求分析;2、进行数据库的概念设计;3、进行数据库的逻辑设计;4、进行数据库的物理设计;5、进行应用程序设计;6、编程实现。工作进度计划序号起止日期工 作 内 容12017.06.122017.06.13需求分析22017.06.132017.06.14概念设计32017.06.142017.12.15逻辑设计42017.06.152017.06.17系统设计52017.06.182017.06.19课程设计报告纂写指导教师(签章): 2017 年 6 月 15 日 计算机工程系软件工程课程设计报告选题名称: 学生信息管理系统 系(院): 计算机工程与软件工程学院 专 业: 计算机科学与技术 班 级: 姓 名: 学 号: 指导教师: 学年学期: 2016 2017 学年 第 2 学期 2017 年 6 月 15 日黑体,小四号。摘要:学生信息管理系统是一个小型的管理系统,其开发技术是后台数据库的建立和维护、前端应用程序的开发两个方面。数据库要体现数据精简和数据一致性、联系强的特点,应用程序要体现功能健全和使用方便的特点。设计报告介绍了与学生相关的信息,划分数据库,将系统划分为录入新生信息、程序学生信息、更新学生信息、删除学生信息、添加用户、修改密码、添加班级、添加课程、退出系统等功能,来了解学生的基本身份信息。系统达到的预期的目标是录入新生信息、程序学生信息、更新学生信息、删除学生信息、添加用户、修改密码、添加班级、添加课程、退出系统的增删改查的功能。本系统只是个人的基本信息的增删改查,可随着添加更多的程序去实现更多的功能。关键词:数据库;ER图;目 录1 需求分析12 概念设计13 逻辑设计14 编程实现1总结与体会3致 谢4参考文献5软件工程课程设计报告1 需求分析1.1 系统需求随着学校人数的不断扩大,学生的信息不断增多,面对如此庞大的信息量,传统的统计学生信息的方法不仅占用大量的人力物力,而且容易出错,已经不再使用,这需要我们设计出一个简单方便的计算机系统来解决这个问题,来对学校所有学生的信息进行处理。方便进行增删改查的功能,使一切更加方便。现代科技的进步已经是日新月异,应将这种方便的技术应用于人民的日常生活,方便人民。保障信息的正确性、完整性、实时性。1.2 可行性分析了解了系统的具体的功能,对其实现的可行性进行分析。该系统所需的硬件设备市场价格低,操作系统采用Windows7的操作系统,采用C#编写的,技术上是可行的。每个人都有学号,所以登录号和密码均可以设置为学号,所以管理上也是可行的。1.3 功能需求学生信息管理系统具有以下功能:学籍管理:对学生的信息档案进行管理,主要包括学生档案信息的修改、删除、添加、档案查询及档案输出等,其中档案查询可以根据学号、姓名查询需要的信息;档案输出可以输出学生档案、成绩、课程表等。学生档案记录主要包括:学号、姓名、出生日期、年龄、性别、政治面貌、入学时间、个人简介、照片、家庭住址、邮编、所在系别以及所学专业等字段。成绩管理:对学生的成绩进行管理,主要就是成绩查询,成绩查询可以按学号、姓名进行查询。成绩记录主要包括:学期、学号、姓名、课程号以及成绩字段等。课程管理:学生可以通过该模块进行课程表查看、打印课程表。选修课选择:对学生报选修课进行管理,学生可以对自己喜爱的课程进行选择。系统维护:教师对学生的密码进行管理,主要包括增加新用户和用户修改。其中用户修改可以实现对学生的密码修改和学生用户名的删去。系统辅助工具:通过该模块用户可以打开一些辅助工具,如记事本和记事本。退出系统:离开本学生信息管理系统。学生信息管理系统学生信息管理系统维护退出系统录入新生信息查询学生信息更新学生信息删除学生信息修改密码添加用户添加班级添加课程退出系统图1 模块图1.4 数据流图学生信息管理系统学生信息班级信息课程信息个人信息学生信息班级信息用户信息系统原始数据输入系统输出数据图2 数据流图2 概念设计数据字典名字:档案信息表描述:学生的档案信息定义:学号+姓名+出生日期+年龄+性别+政治面貌+入学时间+个人简介+照片+家庭住址+邮编+所在系别以及所学专业位置:输出到屏幕名字:成绩表描述:学生的成绩表定义:学期+学号+姓名+课程号+成绩字段位置:输出到屏幕名字:课程管理描述:数据流定义:选课 位置:输出到屏幕学生学号姓名性别年龄民族籍贯政治面貌班级职位身份证号所学专业班级MN最大人数年级班级号课程课程号课程名学分图3 ER图3 逻辑设计3.1 E-R模型向关系模式的转换(1)若实体间的联系是1:1的,可以在两个实体类型转换成的两个关系模式中的任意一个关系模式的属性中加入另一个关系模式的键和联系类型的属性。(2)若实体间的联系是1:N的,则在N端实体类型转换成的关系模式中加入1端实体类型转换成的关系模式的键和联系类型的属性。(3)若实体间的联系是M:N的,则将联系类型也转换成关系模式,其属性为两端实体类型的键加上联系类型的属性,而键为两端实体键的组合。课程关系模式(课程号,课程名,学分)学生关系模式(学号,姓名,性别,年龄,民族,籍贯,班级,政治面貌,身份证号,职位,所学专业)班级关系模式(学号,课程号,班级号,年级,最大人数)3.2 表格设计3.2.1 用户信息表表3-1用户信息表列名数据类型允许空UserNameVarchar(10)否PasswordVarchar(10)是3.2.2 班级信息表表3-2班级信息表列名数据类型允许空ClassNumberVarchar(10)是GradeVarchar(10)是MaxNumberVarchar(10)是StudentNumberVarchar(10)否CourseNumberVarchar(10)否3.2.3 课程信息表表3-3课程信息表列名数据类型允许空CourseNumberVarchar(10)否CourseNameVarchar(10)是CreditVarchar(10)是3.2.4 学生信息表表3-4学生信息表列名数据类型允许空NameVarchar(10)是StudentNumberVarchar(10)否SexVarchar(10)是AgeVarchar(10)是【National】Varchar(10)是HomeVarchar(10)是ClassVarchar(10)是PoliticVarchar(10)是IdNumberVarchar(10)是PositionVarchar(10)是SkillVarchar(10)是4 编程实现4.1 用户登录图4-1 用户登录界面代码:private void Login_Click(object sender, EventArgs e) string ConnString = Data Source=ADMIN-PC;DataBase=MSM;User ID=sa;Pwd=123; SqlConnection conn = new SqlConnection(ConnString); string sql=string.Format(select Password from UserInfo where UserName=0,UserName.Text.Trim(); try conn.Open(); SqlCommand cmd = new SqlCommand(sql, conn); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read() if (this.Password.Text.Trim() = (string)readerPassword.ToString().Trim() this.Hide(); Interface inter = new Interface(); inter.Show(); else MessageBox.Show(密码出错!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); this.UserName.Clear(); this.Password.Clear(); this.UserName.Focus(); else MessageBox.Show(此用户不存在!, 存在提示, MessageBoxButtons.OK, MessageBoxIcon.Information); catch(Exception ex) MessageBox.Show(出错信息! + ex.Message); finally conn.Close(); 4.2 登录主界面图4-2 登录主界面代码:private void EntryNewInformation_Click(object sender, EventArgs e) EntryNewInformation eni = new EntryNewInformation(); eni.Show(); private void InquireStuInformation_Click(object sender, EventArgs e) InquireStuInformation isi = new InquireStuInformation(); isi.Show(); private void UpdateNewInformation_Click(object sender, EventArgs e) UpdateNewInformation uni = new UpdateNewInformation(); uni.Show(); private void AddUser_Click(object sender, EventArgs e) AddUser au = new AddUser(); au.Show(); private void ChangePassword_Click(object sender, EventArgs e) ChangePassword cp = new ChangePassword(); cp.Show(); private void AddClass_Click(object sender, EventArgs e) AddClass ac = new AddClass(); ac.Show(); private void AddCourse_Click(object sender, EventArgs e) AddCourse aco=new AddCourse(); aco.Show(); private void ExitSystem_Click(object sender, EventArgs e) if (MessageBox.Show(您确定要退出吗, 操作提示, MessageBoxButtons.YesNo) = DialogResult.Yes) this.Close(); private void DeleteStuRecord_Click(object sender, EventArgs e) DeleteStuRecord dsr = new DeleteStuRecord(); dsr.Show(); 4.3 录入新生信息图4-3 录入新生信息代码:private void Keep_Click(object sender, EventArgs e) string ConnString = Data Source=ADMIN-PC;DataBase=MSM;User ID=sa;Pwd=123; SqlConnection conn = new SqlConnection(ConnString); if (this.StudentNumber.Text=|this.Name.Text = | this.Sex.Text = | this.Age.Text = | this.National.Text = | this.Home.Text = | this.Class.Text = | this.IdNumber.Text = | this.Politic.Text = | this.Position.Text = | this.Skill.Text = ) MessageBox.Show(请输入完整信息!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else string sql = string.Format(insert into StudentInfo(Name,StudentNumber,Sex,Age,National,Home,Class,Politic,IdNumber,Position,Skill) values(0,1,2,3,4,5,6,7,8,9,10), this.Name.Text,this.StudentNumber.Text, this.Sex.Text, this.Age.Text, this.National.Text, this.Home.Text, this.Class.Text, this.Politic.Text, this.IdNumber.Text, this.Position.Text, this.Skill.Text); SqlCommand cmd = new SqlCommand(sql, conn); try conn.Open(); int count = cmd.ExecuteNonQuery(); if (count 1) MessageBox.Show(录入失败, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Error); else MessageBox.Show(录入成功!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); catch(Exception ex) MessageBox.Show(出错信息! + ex.Message); finally conn.Close(); 4.4 查询学生信息图4-4 查询学生信息代码:private void Inquire_Click(object sender, EventArgs e) string ConnString = Data Source=ADMIN-PC;Initial Catalog=MSM;User ID=sa;Pwd=123; SqlConnection conn = new SqlConnection(ConnString); if (this.NameInquire.Text = ) MessageBox.Show(请输入查询项目, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else try string Name; string StudentNumber; string Sex; string Age; string National; string Home; string Class; string Politic; string IdNumber; string Position; string Skill; conn.Open(); string sql = string.Format(select * from StudentInfo where Name=0, this.NameInquire.Text); SqlCommand cmd = new SqlCommand(sql, conn); SqlDataReader reader = cmd.ExecuteReader(); if (!reader.HasRows) MessageBox.Show(对不起,没有您要查找的用户, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else this.listView1.Items.Clear(); while (reader.Read() Name = (string)reader0; StudentNumber = (string)reader1; Sex=(string)reader2; Age=(string)reader3; National=(string)reader4; Home=(string)reader5; Class=(string)reader6; Politic=(string)reader7; IdNumber = (string)reader8; Position = (string)reader9; Skill = (string)reader10; ListViewItem lvitem = new ListViewItem(Name); lvitem.Tag = (string)readerName; this.listView1.Items.Add(lvitem); lvitem.SubItems.AddRange(new string StudentNumber, Sex, Age, National, Home, Class, Politic, IdNumber, Position, Skill ); reader.Close(); catch(Exception ex) MessageBox.Show(出错信息! + ex.Message); finally conn.Close(); 4.5 更新学生信息图4-5 更新学生信息时显示图4-6 更新学生信息后显示代码: 首先在查找主段的基础上,将查找的值一次赋给TextBox所对应的值。 private void KeepChange_Click(object sender, EventArgs e) string ConnString = Data Source=ADMIN-PC;DataBase=MSM;User ID=sa;Pwd=123; SqlConnection conn = new SqlConnection(ConnString); if (this.NName.Text!= null | this.NStudentNumber.Text!=null|this.NSex.Text != null | this.NAge.Text != null | this.NNational.Text != null | this.NHome.Text != null | this.NClass.Text != null | this.NIdNumber.Text != null | this.NPolitic.Text != null | this.NPosition.Text != null | this.NSkill.Text != null) string sql = string.Format(update StudentInfo set Sex=0,Age=1,National=2,Home=3,Class=4,IdNumber=5,Politic=6,Position=7,Skill=8 where Name=9,this.NSex.Text.Trim(), this.NAge.Text.Trim(), this.NNational.Text.Trim(), this.NHome.Text.Trim(), this.NClass.Text.Trim(), this.NPolitic.Text.Trim(), this.NIdNumber.Text.Trim(), this.NPosition.Text.Trim(), this.NSkill.Text.Trim(),this.NameInquire.Text.Trim(); SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); try int count = cmd.ExecuteNonQuery(); if (count 1) MessageBox.Show(更新出错, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Error); else MessageBox.Show(更新成功!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); catch(Exception ex) MessageBox.Show(出错信息! + ex.Message); finally conn.Close(); else MessageBox.Show(请输入更新信息, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); UserView(); /修改后调用,使TextBox里的值放到listView1中 4.6 删除学生信息图4-7 删除学生信息图4-8 删除学生信息后检验代码: 在查找主段的基础上。 private void Delete_Click(object sender, EventArgs e) string ConnString = Data Source=ADMIN-PC;Initial Catalog=MSM;User ID=sa;Pwd=123; SqlConnection conn = new SqlConnection(ConnString); if (this.NameInquire.Text = ) MessageBox.Show(请输入查询信息, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else try conn.Open(); string sql = string.Format(delete from StudentInfo where Name=0, this.NameInquire.Text); SqlCommand cmd = new SqlCommand(sql, conn); int count = cmd.ExecuteNonQuery(); if (count 1) MessageBox.Show(删除失败!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Error); else MessageBox.Show(删除成功!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); catch(Exception ex) MessageBox.Show(出错信息! + ex.Message); finally conn.Close(); 4.7 添加用户图4-9 添加用户 图4-10 操作提示代码:private void Sure_Click(object sender, EventArgs e) string ConnString = Data Source=ADMIN-PC;DataBase=MSM;User ID=sa;Pwd=123; SqlConnection conn = new SqlConnection(ConnString); if (this.UserName.Text = | this.UserPassword.Text = | this.Passwords.Text = ) if (this.UserName.Text = & this.UserPassword.Text = this.Passwords.Text) MessageBox.Show(请输入用户名!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); this.UserPassword.Clear(); this.Passwords.Clear(); MessageBox.Show(请输入完整信息, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else string sql = string.Format(insert into UserInfo(UserName,Password) values(0,1), this.UserName.Text, this.UserPassword.Text); SqlCommand cmd = new SqlCommand(sql, conn); try conn.Open(); int count = cmd.ExecuteNonQuery(); if (count 1) MessageBox.Show(添加出错!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else if (this.Passwords.Text = this.UserPassword.Text) MessageBox.Show(添加成功!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show(确定密码出错,请重新输入, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); this.Passwords.Clear(); this.Passwords.Focus(); catch(Exception ex) MessageBox.Show(出错信息! + ex.Message); finally conn.Close(); 4.8 修改密码图4-11 修改密码代码:private void KeepChange_Click(object sender, EventArgs e) string ConnString = Data Source=ADMIN-PC;DataBase=MSM;User ID=sa;Pwd=123; SqlConnection conn = new SqlConnection(ConnString); if (this.UserName.Text = | this.NewPassword.Text = | this.Passwords.Text = ) MessageBox.Show(请输入完整信息, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Error); else try conn.Open(); string sql = string.Format(update UserInfo set Password=0, this.NewPassword.Text); SqlCommand cmd = new SqlCommand(sql, conn); int count = cmd.ExecuteNonQuery(); if (count 1) MessageBox.Show(修改失败!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Warning); else if (this.NewPassword.Text != this.Passwords.Text) this.Passwords.Clear(); this.Passwords.Focus(); MessageBox.Show(确定密码错误!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Warning); else MessageBox.Show(修改成功!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); catch(Exception ex) MessageBox.Show(出错信息! + ex.Message); finally conn.Close(); 4.9 添加班级图4-12 添加班级代码:private void KeepChange_Click(object sender, EventArgs e) string ConnString = Data Source=ADMIN-PC;DataBase=MSM;User ID=sa;Pwd=123; SqlConnection conn = new SqlConnection(ConnString); if (this.ClassNumber.Text = | this.Grade.Text = | this.MaxNumber.Text = |this.StudentNumber.Text=|this.CourseNumber.Text=) MessageBox.Show(请输入完整信息!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else string sql = string.Format(insert into ClassInfo(ClassNumber,Grade,MaxNumber,StudentNumber,CourseNumber) values(0,1,2,3,4), this.Class
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 中学资料


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!