资源描述
荆楚理工学院
课程设计成果
学院: 计算机工程学院 班 级: 计算机科学与技术一班
学生姓名: 李校颉 学 号: 2
设计地点(单位) B5-103
设计题目: 基于C#得学生信息管理系统得实现
完成日期: 年 月 日
指导教师评语: ______________ ________________________________________________________________________________________________________________________________________________________________________________________________________________
成绩(五级记分制):_________________
教师签名:_________________________
摘 要
本文描述得就就是基于Windows环境得学生管理系统,主要功能模块包括学生信息得添加、修改、查找、删除。主要工具Microsoft Visual Studio2010设计窗体,SQL server2008建立数据库,实现学生信息管理得基本功能。
本篇报告介绍一个学生信息管理系统得从分析到设计最后到实现得全过程,给出了学生信息管理系统得设计与技术实现得过程,特别在细节上分析功能与函数得实现思想。涉及到雪上信息管理得基本功能在本报告中都有描述。
Abstract
Described in this paper is based on the Windows environment management system for students, the main function modules include student information to add, modify, delete, search、 The main tool of Microsoft Visual Studio2010 SQL Server2008 design form, database, information management students to achieve the basic function、
This report describes a student information management system from analysis to design to the final realization of the entire process, gives the student information management system design and realization process, especially in the details of analysis function and the function of the realization of ideas、 Relate to the snow on the basic functions of information management in this report are described、
关键词 数据库,添加,修改,查找,删除
目 录
第一章ﻩ 概述 4
1、1设计目得ﻩ4
1、2开发工具得选择ﻩ4
1、3开发环境 4
1、4 本报告得主要内容 4
第二章 需求分析 4
2、1 系统需求简介ﻩ4
2、1、1ﻩ4
2、1、2 功能需求得分析 5
2、1、3 性能需求分析ﻩ5
第三章 总体设计ﻩ5
3、1 设计概述ﻩ5
3、2 系统总体结构及功能模块划分 5
3、2、1学生成绩查询模块 5
3、2、2学生信息管理模块ﻩ6
3、3系统数据库概念结构设计 6
3、3、1系统E-R图 6
3、4、1 用户登录安全性ﻩ7
第四章ﻩ 详细设计 7
4、1 概述ﻩ7
4、2 系统程序流程图ﻩ7
4、3 系统主要功能模块简介 8
4、3、1 系统登录 8
4、3、2 学生信息添加模块ﻩ9
4、3、3学生信息删除模块ﻩ10
4、3、4 学生信息查找模块 11
4、3、5 学生信息修改模块ﻩ12
第五章 程序设计总结 12
第六章 结束语 13
参考文献 13
附录 14
程序代码 14
第一章 概述
1、1设计目得
本课程设计得目得就就是使学生能熟练掌握简单得Window窗体应用程序得设计与ADD、net得应用,希望通过本次得锻炼学生实用c#语言解决实际问题得能力。
1、2开发工具得选择
本系统后台数据库采用Microsoft SQL Server 数据库,该数据库系统在安全性、准确性与运行速度方面有绝对得优势,并且处理数据量大、效率高;前台采用Microsoft 公司得Visual Studio 2008 作为主要得开发工具,可与SQL Server 2008 数据库无缝连接。
1、3开发环境
系统开发平台:Microsoft Visual Studio2008
系统开发语言:C#
数据库管理软件:SQL Server 2005
1、4 本报告得主要内容
本报告详细得介绍了学生得信息管理得开发过程,主要设计到得工作如下:系统得需求分析、系统得总设计、系统得概念设计、系统各模块得详细设计、系统运行与测试。
第二章 需求分析
2、1 系统需求简介
2、1、1
(1) 根据查询条件实现学生信息得查询
(2) 学生信息得添加、删除、修改
(3) 对基本信息完成得增加、删除、修改时,需要注意表与表之间得关联
2、1、2 功能需求得分析
本系统得功能需求分析如下:
学生信息查询: 学生可以根据学号、姓名进行查询
学生信息管理: 主要就就是用于学生信息更改、插入、删除
学生成绩录入: 用于学生成绩管理,录入学生成绩,也可以更新
2、1、3 性能需求分析
(1) 登录、用户界面需求: 简洁、易懂、易用、有好得用户界面
(2) 安全保密需求: 只有凭借用户名与密码登录系统,才能进行信息得管理。
第三章 总体设计
3、1 设计概述
根据需求把整体系统分化成不同得模块,每个模块完成一个特性得子功能。把着些模块结合起来组成一个整体。逐一实现各种功能。
3、2 系统总体结构及功能模块划分
经过对系统得需求分析,学生信息管理系统主要划分为三部分:学生信息查询,学生信息管理,学生成绩录入三个功能模块。如图3、2、1
学生信息管理系统
学生信息查询
学生信息管理
学生成绩录入
图3、2、1 系统得总体结构
3、2、1学生成绩查询模块
学生信息查询: 学生可以根据学号、姓名、专业进行查询。如图3、2、2学生信息查询模块结构
学生信息查询
学号查询
姓名查询
图3、2、2学生信息管理模块结构
3、2、2学生信息管理模块
学生信息管理: 主要就就是用于学生信息更新、插入、删除,如图3、2、3学生管理模块结构
学生信息管理
学生信息更新
学生信息录入
学生信息删除
基本信息更新
基本信息录入
图3、2、3 学生信息管理模块结构
3、3系统数据库概念结构设计
根据对数据项与数据结构得分析,设计出能够满足系统需求得各种实体,及她们之间得关系,为后面得逻辑结构设计打下基础。
3、3、1系统E-R图
系统E-R图可以将各个实体之间得关系显示出来,将各个实体间得属性依赖表示明白。如图3、3、1系统E-R图结构
学生表
选课
课程表
学号
姓名
性别
出生年月
课程号
课程名
先行课
学分
图3、3、1 系统E-R图结构
3、4、1 用户登录安全性
系统设计了登陆界面,每个合法用户有用户名及密码,只有当用户输入正确得用户名及密码组合后才能够对学生信息进行操作。
第四章 ﻩ详细设计
4、1 概述
详细设计阶段得根本目标就就是确定应该怎么样具有得实现所要求得系统,也就就就是说,经过这个阶段得设计工作,应该得出目标系统得精确描述,从而在编码阶段可以把这个描述直接翻译成用某个程序设计语言写得程序。
4、2 系统程序流程图
程序流程图又称为程序框架图,它就就是历史悠久使用最广泛得描述软件得方法。它可将整个程序得总体流程清楚明白得显示出来。如图4、2、1 系统总流程图结构。
开始
登陆界面
验证用户及密码就就是否正确
系统主界面
信息插入
信息查找
信息删除
退出
信息修改
结束
图4、2、1 系统总体流程图
4、3 系统主要功能模块简介
4、3、1 系统登录
用户凭借用户名及密码登录,成功登录后可以对学生信息进行操作。用户界面如图4、3、1 用户登录界面所示。
图4、3、1 用户登陆界面
4、3、2 学生信息添加模块
学生信息添加:在程序主界面(图4、3、2 程序主界面)通过信息录入项进入信息添加模块。通过此模块,学生可以向数据库中添加学号、姓名、生日及选择性别。(如图4、3、3 所示)。
图4、3、2 程序主界面
图4、3、3 信息添加界面
4、3、3学生信息删除模块
学生信息删除:信息删除模块如图4、3、4,可以通过删除模块进行学号或姓名进行信息得删除。
图4、3、4 信息删除界面
4、3、4 学生信息查找模块
学生信息查找:信息查找模块如图4、3、5,可以通过查找模块进行学号或姓名得查找。
图4、3、5 信息查找界面
4、3、5 学生信息修改模块
学生信息修改:信息修改如图4、3、6,可以通过修改模块进行信息得修改。
图4、3、6信息修改界面
第五章 ﻩ程序设计总结
在编程期间,不遇到点困哪似乎就就是不可能得,正就就是这些困难,我们才能会收到成功得喜悦,我们才能乐此不疲得进行下去。这就就是我对此次编程得最大感悟。
下面来瞧瞧编写得艰辛历程:在刚开始得阶段,我经常因为单词得拼错出现这样或那样得错误在数次得错误后我吸取教训在后来得编程中几乎不出现了这种错误。剩下得错误就就就是引用或语法上得错误。感到最深刻得就就是,窗体name后就不能随意更改了,更改后在编写得程序得程序中要相应得更新里面得内容。当出现语法错误时我因经验得不足不足很难自己将其更改出来,但通过在网上查询几乎都能找到我想要得结果。成功后留下得就就就是经验与成就感了,在经验与成就感得陪伴下我充满着信心、激情与执着。期间还有很多老师与同学得帮助。从中感受到了互动得优势与群众得力量。
第六章 结束语
为期九周得课程设计结束了,在王老师辛勤代理及同学们得帮助下我逐渐得掌握了一些编程得基本知识!毕竟我完成了教育部给我们规定得任务,期间,总有很多感触。内心充满了感激之情,特别就就是我们得班主任王老师,在微机房里为我们一遍又一遍得从零点讲起细心教导,在我们编程过程中又一个一个得询问我们得掌握情况。不论遇到什么问题,想想我们得老师,我们总会充满信心。在老师得关怀下我成功了!此时,言语已无法表达我对老师得感激了!此时无声胜有声!
参考文献
[1] 王山,萨师煊、高等教育出版社、数据库系统概论、
[2] 王磊、实验教程、
[3] 袁庆龙,候文义、Ni-P合金镀层组织形貌及显微硬度研究[J]、太原理工大学学报,2001,32(1):51-53 、
[4] 刘国钧,王连成、图书馆史研究[M]、北京:高等教育出版社,1979:15-18,31、
[5] 孙品一、高校学报编辑工作现代化特征[C]、中国高等学校自然科学学报研究会、科技编辑学论文集(2)、北京:北京师范大学出版社,1998:10-22、
[6] 张与生、地质力学系统理论[D、太原:太原理工大学,1998、
[7] 冯西桥、核反应堆压力容器得LBB分析[R]、北京:清华大学核能技术设计研究院,1997、
[8] 姜锡洲、一种温热外敷药制备方案[P]、中国专利:881056078,1983-08-12、
[9] GB/T 16159—1996,汉语拼音正词法基本规则[S]、北京:中国标准出版社,1996、
[10] 谢希德、创造学习得思路[N]、人民日报,1998-12-25(10)、
[11] 王明亮、中国学术期刊标准化数据库系统工程得[EB/OL]、
附录
程序代码
登陆程序代码
using System;
using System、Collections、Generic;
using System、ponentModel;
using System、Data;
using System、Drawing;
using System、Linq;
using System、Text;
using System、Windows、Forms;
using DataAccessLayer;
namespace StudentMIS
{
public partial class FormLogin : Form
{
public FormLogin()
{
Initializeponent();
}
private void buttonok_Click(object sender, EventArgs e)
{
int total = new SQLHelper()、login(textBoxusername、Text、Trim(), textBoxpassword、Text、Trim());
if (total > 0)
{
FormMain main = new FormMain();
main、Show();
this、Hide();
}
else
{
MessageBox、Show("用户名或密码错误", "提示");
textBoxusername、Text = "";
textBoxpassword、Text = "";
textBoxusername、Focus();
}
}
private void buttoncancel_Click(object sender, EventArgs e)
{
textBoxusername、Text = "";
textBoxpassword、Text = "";
textBoxusername、Focus();
}
}
}
主函数程序代码
using System;
using System、Collections、Generic;
using System、ponentModel;
using System、Data;
using System、Drawing;
using System、Linq;
using System、Text;
using System、Windows、Forms;
using DataAccessLayer;
namespace StudentMIS
{
public partial class FormMain : Form
{
public FormMain()
{
Initializeponent();
}
private void 信息录入ToolStripMenuItem_Click(object sender, EventArgs e)
{
FormAddStudent add = new FormAddStudent();
add、ShowDialog();
if (add、DialogResult == DialogResult、OK)
{
bind();
}
}
BindingSource bs = new BindingSource();
public void bind()//刷新网格
{
bs、DataSource = new SQLHelper()、CreateTable();
dataGridViewstudent、DataSource = bs;
}
private void FormMain_Load(object sender, EventArgs e)
{
bind();
}
private void 信息删除ToolStripMenuItem_Click(object sender, EventArgs e)
{
FormDeleteStudent delete = new FormDeleteStudent();
delete、ShowDialog();
if (delete、DialogResult == DialogResult、OK)
{
bind();
}
}
private void 查找信息ToolStripMenuItem_Click(object sender, EventArgs e)
{
FormRearchStudent search = new FormRearchStudent();
search、ShowDialog();
if (search、DialogResult == DialogResult、OK)
{
bind();
}
}
private void 修改信息ToolStripMenuItem_Click(object sender, EventArgs e)
{
FormUpdateStudent update = new FormUpdateStudent();
update、ShowDialog();
if (update、DialogResult == DialogResult、OK)
{
bind();
}
}
}
}
添加信息程序代码
using System;
using System、Collections、Generic;
using System、ponentModel;
using System、Data;
using System、Drawing;
using System、Linq;
using System、Text;
using System、Windows、Forms;
using DataAccessLayer;
using System、Data、SqlClient;
namespace StudentMIS
{
public partial class FormAddStudent : Form
{
public FormAddStudent()
{
Initializeponent();
}
private void buttonok_Click(object sender, EventArgs e)
{
string sno = textBoxSno、Text、Trim();
string sname = textBoxSname、Text、Trim();
string sex = boBoxsex、Text、Trim();
string birthday = textBoxbirthday、Text、Trim();
new StudentDAO()、insert(sno,sname,sex,birthday);
this、DialogResult = DialogResult、OK;
MessageBox、Show("输入成功");
}
private void buttoncancel_Click(object sender, EventArgs e)
{
textBoxSno、Text = "";
textBoxSname、Text = "";
boBoxsex、Text = "男";
textBoxbirthday、Text = "";
textBoxSno、Focus();
}
}
}
删除信息程序代码
using System;
using System、Collections、Generic;
using System、ponentModel;
using System、Data;
using System、Drawing;
using System、Linq;
using System、Text;
using System、Windows、Forms;
using DataAccessLayer;
namespace StudentMIS
{
public partial class FormDeleteStudent : Form
{
public FormDeleteStudent()
{
Initializeponent();
}
private void buttonok_Click(object sender, EventArgs e)
{
new StudentDAO()、deletebysno(textBoxsno、Text、Trim());
this、DialogResult = DialogResult、OK;
new StudentDAO()、deletebyname(textBoxsname、Text、Trim());
MessageBox、Show("删除成功");
this、DialogResult = DialogResult、OK;
}
private void buttoncancel_Click(object sender, EventArgs e)
{
textBoxsno、Text = "";
textBoxsname、Text = "";
textBoxsno、Focus();
}
}
}
查找信息程序代码
using System;
using System、Collections、Generic;
using System、ponentModel;
using System、Data;
using System、Drawing;
using System、Linq;
using System、Text;
using System、Windows、Forms;
using DataAccessLayer;
namespace StudentMIS
{
public partial class FormRearchStudent : Form
{
public FormRearchStudent()
{
Initializeponent();
}
BindingSource bs = new BindingSource();
private void buttonsearchbysno_Click(object sender, EventArgs e)
{
bs、DataSource = new StudentDAO()、searchbysno(textBoxsno、Text、Trim());
dataGridViewstudent、DataSource = bs;
}
private void buttonsearchbysname_Click(object sender, EventArgs e)
{
bs、DataSource = new StudentDAO()、searchbysname(textBoxsname、Text、Trim());
dataGridViewstudent、DataSource = bs;
}
}
}
修改信息程序代码
using System;
using System、Collections、Generic;
using System、ponentModel;
using System、Data;
using System、Drawing;
using System、Linq;
using System、Text;
using System、Windows、Forms;
using DataAccessLayer;
namespace StudentMIS
{
public partial class FormUpdateStudent : Form
{
public FormUpdateStudent()
{
Initializeponent();
}
BindingSource bs = new BindingSource();
private void buttonsearch_Click(object sender, EventArgs e)
{
bs、DataSource = new StudentDAO()、searchbysno(textBoxSno、Text、Trim());
dataGridView1、DataSource = bs;
}
private void buttonsname_Click(object sender, EventArgs e)
{
if (textBoxSno、Text == "")
{
MessageBox、Show("请输入要修改得学号!");
return;
}
else
{
MessageBox、Show("修改成功");
string sno = textBoxSno、Text;
string sname = textBoxSname、Text;
new StudentDAO()、update(sno,sname);
MessageBox、Show("修改成功");
this、DialogResult = DialogResult、OK;
}
}
}
}
StudentDAO
using System;
using System、Collections、Generic;
using System、Data;
using System、Data、SqlClient;
using System、Linq;
using System、Text;
namespace DataAccessLayer
{
public class StudentDAO// : DataAccessLayer、IStudentDAO
{
private SQLHelper sqlhelper = null;
public StudentDAO()
{
sqlhelper = new SQLHelper();
}
//增
public void insert(string sno, string sname, string sex, string birthday)
{
string sql = "insert into student values(sno,sname,sex,birthday)";
SqlParameter[] para = new SqlParameter[] {
new SqlParameter("sno",SqlDbType、NChar),
new SqlParameter("sname",SqlDbType、NVarChar),
new SqlParameter("sex",SqlDbType、NChar),
new SqlParameter("birthday",SqlDbType、NChar)
};
int i = 0;
para[i++]、Value = sno;
para[i++]、Value = sname;
para[i++]、Value = sex;
para[i++]、Value = birthday;
sqlhelper、ExecuteNonQuery(sql, para);
}
//删
public void deletebysno(string sno)
{
string sql = "delete from student where sno=sno";
SqlParameter[] para = new SqlParameter[]
{
new SqlParameter("sno",SqlDbType、NChar)
};
int i = 0;
para[i++]、Value = sno;
sqlhelper、ExecuteNonQuery(sql, para);
}
public void deletebyname(string sname)
{
string sql = "delete from student where sname=sname";
SqlParameter[] para = new SqlParameter[]
{
new SqlParameter("sname",SqlDbType、NVarChar)
};
int i = 0;
para[i++]、Value = sname;
sqlhelper、ExecuteNonQuery(sql,para);
}
//查找
public DataTable searchbysno(string sno)
{
DataTable table = new DataTable();
string sql = "select * from student where sno=sno";
SqlParameter[] para = new SqlParameter[]
{
new SqlParameter("sno",SqlDbType、NChar)
展开阅读全文