C#学生信息管理系统课程设计_第1页
C#学生信息管理系统课程设计_第2页
C#学生信息管理系统课程设计_第3页
C#学生信息管理系统课程设计_第4页
C#学生信息管理系统课程设计_第5页
已阅读5页,还剩25页未读 继续免费阅读

下载本文档

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

文档简介

1、课程设计(论文)学生信息管理管理系统系别:计算机科学与技术系专业(班级):计算机科学与技术2010级1班作者(学号):指导教师:完成日期:摘要本文描述的是基于Windows环境的学生管理系统,主要功能模块包括学生信息的添加、修改、查找、删除。主要工具MicrosoftVisualStudio2010设计窗体,SQLserver2008建立数据库,实现学生信息管理的基本功能。本篇报告介绍一个学生信息管理系统的从分析到设计最后到实现的全过程,给出了学生信息管理系统的设计和技术实现的过程,特别在细节上分析功能和函数的实现思想。涉及到雪上信息管理的基本功能在本报告中都有描述。AbstractDescr

2、ibedinthispaperisbasedontheWindowsenvironmentmanagementsystemforstudents,themainfunctionmodulesincludestudentinformationtoadd,modify,delete,search.ThemaintoolofMicrosoftVisualStudio2010SQLServer2008designform,database,informationmanagementstudentstoachievethebasicfunction.Thisreportdescribesastudent

3、informationmanagementsystemfromanalysistodesigntothefinalrealizationoftheentireprocess,givesthestudentinformationmanagementsystemdesignandrealizationprocess,especiallyinthedetailsofanalysisfunctionandthefunctionoftherealizationofideas.Relatetothesnowonthebasicfunctionsofinformationmanagementinthisre

4、portaredescribed.关键词数据库,添加,修改,查找,删除目录第一章概述41.1 设计目的41.2 开发工具的选择41.3 开发环境41.4 本报告的主要内容4第二章需求分析52.1 系统需求简介52.1.1 52.1.2 功能需求的分析52.1.3 性能需求分析5第三章总体设计63.1 设计概述63.2 系统总体结构及功能模块划分63.2.1 学生成绩查询模块63.2.2 学生信息管理模块73.3 系统数据库概念结构设计73.3.1 系统E-R图73.4.1 用户登录安全性8第四章详细设计94.1 概述94.2 系统程序流程图94.3 系统主要功能模块简介104.3.1 系统登录

5、104.3.2 学生信息添加模块114.3.3 学生信息删除模块124.3.4 学生信息查找模块134.3.5 学生信息修改模块14第五章程序设计总结15第六章结束语16参考文献17附录18程序代码183概述1.1 设计目的本课程设计的目的是使学生能熟练掌握简单的Window窗体应用程序的设计和ADD.net的应用,希望通过本次的锻炼学生实用c#语言解决实际问题的能力。1.2 开发工具的选择本系统后台数据库采用MicrosoftSQLServer数据库,该数据库系统在安全性、准确性和运行速度方面有绝对的优势,并且处理数据量大、效率高;前台采用Microsoft公司的VisualStudio20

6、08作为主要的开发工具,可与SQLServer2008数据库无缝连接。1.3 开发环境系统开发平台:MicrosoftVisualStudio2008系统开发语言:C#数据库管理软件:SQLServer20051.4 本报告的主要内容本报告详细的介绍了学生的信息管理的开发过程,主要设计到的工作如下:系统的需求分析、系统的总设计、系统的概念设计、系统各模块的详细设计、系统运行与测试。4第二章需求分析5#2.1 系统需求简介2.1.1(1)根据查询条件实现学生信息的查询(2)学生信息的添加、删除、修改(3)对基本信息完成的增加、删除、修改时,需要注意表与表之间的关联2.1.2 功能需求的分析本系统

7、的功能需求分析如下:学生信息查询:学生可以根据学号、姓名进行查询学生信息管理:主要是用于学生信息更改、插入、删除学生成绩录入:用于学生成绩管理,录入学生成绩,也可以更新2.1.3 性能需求分析(1)登录、用户界面需求:简洁、易懂、易用、有好的用户界面(2)安全保密需求:只有凭借用户名和密码登录系统,才能进行信息的管理#AVV*第二早总体设计6#3.1设计概述根据需求把整体系统分化成不同的模块,每个模块完成一个特性的子功能。把着些模块结合起来组成一个整体。逐一实现各种功能。3.2系统总体结构及功能模块划分经过对系统的需求分析,学生信息管理系统主要划分为三部分:学生信息查询,学生信息管理,学生成绩

8、录入三个功能模块。如图3.2.1图3.2.1系统的总体结构#3.2.1学生成绩查询模块学生信息查询:学生可以根据学号、姓名、专业进行查询。如图3.2.2学生信息查询模块结构#图3.2.2学生信息管理模块结构#322学生信息管理模块学生信息管理:主要是用于学生信息更新、插入、删除,如图3.2.3学生管理模块结构图3.2.3学生信息管理模块结构3.3系统数据库概念结构设计根据对数据项与数据结构的分析,设计出能够满足系统需求的各种实体,及他们之间的关系,为后面的逻辑结构设计打下基础。3.3.1系统E-R图系统E-R图可以将各个实体之间的关系显示出来,将各个实体间的属性依赖表示明白。如图3.3.1系统

9、E-R图结构图3.3.1系统E-R图结构341用户登录安全性系统设计了登陆界面,每个合法用户有用户名及密码,只有当用户输入正确的用户名及密码组合后才能够对学生信息进行操作。9第四章详细设计4.1概述详细设计阶段的根本目标是确定应该怎么样具有的实现所要求的系统,也就是说,经过这个阶段的设计工作,应该得出目标系统的精确描述,从而在编码阶段可以把这个描述直接翻译成用某个程序设计语言写的程序。4.2系统程序流程图程序流程图又称为程序框架图,它是历史悠久使用最广泛的描述软件的方法。它可将整个程序的总体流程清楚明白的显示出来。如图4.2.1系统总流程图结构。图421系统总体流程图4.3系统主要功能模块简介

10、4.3.1系统登录用户凭借用户名及密码登录,成功登录后可以对学生信息进行操作。用户界面如图4.3.1用户登录界面所示。用户窑:I密码:燮录峥图4.3.1用户登陆界面432学生信息添加模块学生信息添加:在程序主界面(图432程序主界面)通过信息录入项进入信息添加模块。通过此模块,学生可以向数据库中添加学号、姓名、生日及选择性别。(如图433所示)。学空信思百理主界面-*“图432程序主界面12图4.3.3信息添加界面433学生信息删除模块学生信息删除:信息删除模块如图4.3.4,可以通过删除模块进行学号或姓名进行信息的删除。13图434信息删除界面434学生信息查找模块学生信息查找:信息查找模块

11、如图4.3.5,可以通过查找模块进行学号或姓名的查找14J按学号查询:2011122603按姓名査询:图435信息查找界面15#435学生信息修改模块学生信息修改:信息修改如图436,可以通过修改模块进行信息的修改#图436信息修改界面#第五章程序设计总结在编程期间,不遇到点困哪似乎是不可能的,正是这些困难,我们才能会收到成功的喜悦,我们才能乐此不疲的进行下去。这是我对此次编程的最大感悟。下面来看看编写的艰辛历程:在刚开始的阶段,我经常因为单词的拼错出现这样或那样的错误在数次的错误后我吸取教训在后来的编程中几乎不出现了这种错误。剩下的错误就是引用或语法上的错误。感到最深刻的是,窗体name后就

12、不能随意更改了,更改后在编写的程序的程序中要相应的更新里面的内容。当出现语法错误时我因经验的不足不足很难自己将其更改出来,但通过在网上查询几乎都能找到我想要的结果。成功后留下的就是经验和成就感了,在经验和成就感的陪伴下我充满着信心、激情和执着。期间还有很多老师和同学的帮助。从中感受到了互动的优势和群众的力量。16第六章结束语为期九周的课程设计结束了,在王老师辛勤代理及同学们的帮助下我逐渐的掌握了一些编程的基本知识!毕竟我完成了教育部给我们规定的任务,期间,总有很多感触。内心充满了感激之情,特别是我们的班主任王老师,在微机房里为我们一遍又一遍的从零点讲起细心教导,在我们编程过程中又一个一个的询问

13、我们的掌握情况。不论遇到什么问题,想想我们的老师,我们总会充满信心。在老师的关怀下我成功了!此时,言语已无法表达我对老师的感激了!此时无声胜有声!17参考文献1 王山,萨师煊高等教育出版社数据库系统概论2 王磊实验教程3 袁庆龙,候文义.Ni-P合金镀层组织形貌及显微硬度研究J.太原理工大学学报,2001,32(1):51-534 刘国钧,王连成.图书馆史研究M.北京:高等教育出版社,1979:15-18,31.5 孙品一高校学报编辑工作现代化特征C中国高等学校自然科学学报研究会科技编辑学论文集(2).北京:北京师范大学出版社,1998:10-22.张和生.地质力学系统理论D.太原:太原理工大

14、学,1998.7 冯西桥核反应堆压力容器的LBB分析R.北京:清华大学核能技术设计研究院,1997.8 姜锡洲一种温热外敷药制备方案P中国专利:881056078,1983-08-12.9 GB/T161591996,汉语拼音正词法基本规则S.北京:中国标准出版社,1996.10 谢希德创造学习的思路N人民日报,1998-12-25(10).王明亮中国学术期刊标准化数据库系统工程的EB/OL18附录程序代码登陆程序代码usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;u

15、singSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingDataAccessLayer;namespaceStudentMISpublicpartialclassFormLogin:FormpublicFormLogin()InitializeComponent();privatevoidbuttonok_Click(objectsender,EventArgse)inttotal=newSQLHelper().login(textBoxusername.Text.Trim(),te

16、xtBoxpassword.Text.Trim();if(total>0)FormMainmain=newFormMain();main.Show();this.Hide();elseMessageBox.Show("用户名或密码错误","提示");textBoxusername.Text=""textBoxpassword.Text=""textBoxusername.Focus();privatevoidbuttoncancel_Click(objectsender,EventArgse)textBoxu

17、sername.Text=""textBoxpassword.Text=""textBoxusername.Focus();主函数程序代码usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingDataAccessLayer;namespaceStudentMISpub

18、licpartialclassFormMain:FormpublicFormMain()InitializeComponent();privatevoid信息录入ToolStripMenuItem_Click(objectsender,EventArgse)FormAddStudentadd=newFormAddStudent();add.ShowDialog();if(add.DialogResult=DialogResult.OK)bind();BindingSourcebs=newBindingSource();publicvoidbind()/刷新网格bs.DataSource=new

19、SQLHelper().CreateTable();dataGridViewstudent.DataSource=bs;privatevoidFormMain_Load(objectsender,EventArgse)bind();privatevoid信息删除ToolStripMenuItem_Click(objectsender,EventArgse)FormDeleteStudentdelete=newFormDeleteStudent();delete.ShowDialog();if(delete.DialogResult=DialogResult.OK)bind();privatev

20、oid查找信息ToolStripMenuItem_Click(objectsender,EventArgse)FormRearchStudentsearch=newFormRearchStudent();search.ShowDialog();if(search.DialogResult=DialogResult.OK)bind();privatevoid修改信息ToolStripMenuItem_Click(objectsender,EventArgse)FormUpdateStudentupdate=newFormUpdateStudent();update.ShowDialog();if

21、(update.DialogResult=DialogResult.OK)bind();添加信息程序代码usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingDataAccessLayer;usingSystem.Data.SqlClient;namespaceStudentMISpublicpartial

22、classFormAddStudent:FormpublicFormAddStudent()InitializeComponent();privatevoidbuttonok_Click(objectsender,EventArgse)stringsno=textBoxSno.Text.Trim();stringsname=textBoxSname.Text.Trim();stringsex=comboBoxsex.Text.Trim();stringbirthday=textBoxbirthday.Text.Trim();newStudentDAO().insert(sno,sname,se

23、x,birthday);this.DialogResult=DialogResult.OK;MessageBox.Show("输入成功");privatevoidbuttoncancel_Click(objectsender,EventArgse)textBoxSno.Text=""textBoxSname.Text=""comboBoxsex.Text="男"textBoxbirthday.Text=""textBoxSno.Focus();删除信息程序代码usingSystem;usingS

24、ystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingDataAccessLayer;namespaceStudentMISpublicpartialclassFormDeleteStudent:FormpublicFormDeleteStudent()InitializeComponent();privatevoidbuttonok_Cli

25、ck(objectsender,EventArgse)newStudentDAO().deletebysno(textBoxsno.Text.Trim();this.DialogResult=DialogResult.OK;newStudentDAO().deletebyname(textBoxsname.Text.Trim();MessageBox.Show("删除成功");this.DialogResult=DialogResult.OK;privatevoidbuttoncancel_Click(objectsender,EventArgse)textBoxsno.T

26、ext=""textBoxsname.Text=""textBoxsno.Focus();查找信息程序代码usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingDataAccessLayer;namespaceStudentMISpublicpartialclassF

27、ormRearchStudent:FormpublicFormRearchStudent()InitializeComponent();BindingSourcebs=newBindingSource();privatevoidbuttonsearchbysno_Click(objectsender,EventArgse)bs.DataSource=newStudentDAO().searchbysno(textBoxsno.Text.Trim()JdataGridViewstudent.DataSource=bs;privatevoidbuttonsearchbysname_Click(ob

28、jectsender,EventArgse)bs.DataSource=newStudentDAO().searchbysname(textBoxsname.Text.Trim();dataGridViewstudent.DataSource=bs;修改信息程序代码usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms

29、;usingDataAccessLayer;namespaceStudentMISpublicpartialclassFormUpdateStudent:FormpublicFormUpdateStudent()InitializeComponent();BindingSourcebs=newBindingSource();privatevoidbuttonsearch_Click(objectsender,EventArgse)bs.DataSource=newStudentDAO().searchbysno(textBoxSno.Text.Trim()JdataGridView1.Data

30、Source=bs;privatevoidbuttonsname_Click(objectsender,EventArgse)if(textBoxSno.Text="")MessageBox.Show("请输入要修改的学号!");return;elseMessageBox.Show("修改成功");stringsno=textBoxSno.Text;stringsname=textBoxSname.Text;newStudentDAO().update(sno,sname);MessageBox.Show("修改成功&quo

31、t;);this.DialogResult=DialogResult.OK;StudentDAOusingSystem;usingSystem.Collections.Generic;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Linq;usingSystem.Text;namespaceDataAccessLayerpublicclassStudentDAO/:DataAccessLayer.IStudentDAOprivateSQLHelpersqlhelper=null;publicStudentDAO()sqlhelp

32、er=newSQLHelper();/增publicvoidinsert(stringsno,stringsname,stringsex,stringbirthday)stringsql="insertintostudentvalues(sno,sname,sex,birthday)JSqlParameterpara=newSqlParameternewSqlParameter("sno",SqlDbType.NChar),newSqlParameter("sname",SqlDbType.NVarChar),newSqlParameter(&

33、quot;sex",SqlDbType.NChar),newSqlParameter("birthday",SqlDbType.NChar);inti=0;parai+.Value=sno;parai+.Value=sname;parai+.Value=sex;parai+.Value=birthday;sqlhelper.ExecuteNonQuery(sql,para);/删publicvoiddeletebysno(stringsno)stringsql="deletefromstudentwheresno=sno"SqlParamete

34、rpara=newSqlParameternewSqlParameter("sno",SqlDbType.NChar);inti=0;parai+.Value=sno;sqlhelper.ExecuteNonQuery(sql,para);publicvoiddeletebyname(stringsname)stringsql="deletefromstudentwheresname=sname"SqlParameterpara=newSqlParameternewSqlParameter("sname",SqlDbType.NVar

35、Char);inti=0;parai+.Value=sname;sqlhelper.ExecuteNonQuery(sql,para);/查找publicDataTablesearchbysno(stringsno)DataTabletable=newDataTable();stringsql="select*fromstudentwheresno=sno"SqlParameterpara=newSqlParameternewSqlParameter("sno",SqlDbType.NChar);inti=0;parai+.Value=sno;table

36、=sqlhelper.CreateTableBySno(sql,para);returntable;publicDataTablesearchbysname(stringsname)DataTabletable=newDataTable();stringsql="select*fromstudentwheresname=sname"SqlParameterpara=newSqlParameternewSqlParameter("sname",SqlDbType.NChar);inti=0;parai+.Value=sname;table=sqlhelpe

37、r.CreateTableBySname(sql,para);returntable;/修改publicvoidupdate(stringsno,stringsname)DataTabletable=newDataTable();stringsql="updatestudentsetsname='sname'wheresno='sno'"SqlParameterpara=newSqlParameternewSqlParameter("sno",SqlDbType.NVarChar),newSqlParameter(&quo

38、t;sname",SqlDbType.NVarChar);inti=0;parai+.Value=sno;parai+.Value=sname;sqlhelper.ExecuteNonQuery(sql,para);SQLHelperusingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Data.SqlClient;usingSystem.Data;namespaceDataAccessLayerpublicclassSQLHelperpublicvoidEx

39、ecuteNonQuery(stringsql,paramsSqlParameterpara)stringconnstr="server=.;database=student;integratedsecurity=IIsspi"using(SqlConnectionconn=newSqlConnection(connstr)conn.Open();using(SqlCommandcmd=newSqlCommand(sql,conn)cmd.Parameters.AddRange(para);cmd.ExecuteNonQuery();publicDataTableCreat

40、eTable()DataTabletable=newDataTable();stringconnstr="server=.;database=student;integratedsecurity=sspi"using(SqlConnectionconn=newSqlConnection(connstr)conn.Open();stringsql="select*fromstudent"using(SqlDataAdapteradapter=newSqlDataAdapter(sql,conn)adapter.Fill(table);returntable;publicDataTableCreateTableBySno(stringsql,paramsSql

温馨提示

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

评论

0/150

提交评论