ImageVerifierCode 换一换
格式:DOCX , 页数:26 ,大小:261.85KB ,
资源ID:4704108      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/4704108.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C#期末测试大作业.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C#期末测试大作业.docx

1、C#期末测试大作业期末测试大作业:设计学生信息管理系统。一、功能要求:1 实现学生管理系统的登陆功能,按学生和管理员两种用户登录,要求有必要的输入验证和用户合法性验证;2 设计管理员主窗体,要求 实现新增学生功能, 实现查询学生信息功能, 实现修改学生用户功能 实现按年级筛选学生列表功能 实现批量修改学生信息功能 实现学生信息的筛选和排序 实现删除学生信息 实现学生成绩的添加与查看 以上功能大体分为学生信息管理功能和学生成绩管理功能,要求至少实现学生信息管理功能。大作业测试的主要技能点:会使用基本控件设计窗体,并合理布局,会实现MDI风格的窗体;使用ADO.NET 操作数据,能将数据库中的数据

2、读取出来显示在窗体上,能将窗体中的数据保存到数据库。二、书写设计报告报告封面见附录报告内容要求,写出系统的概要设计和详细设计,详细设计中,给出每一实现模块的功能描述、界面截图、主要代码和技术要点说明。最后给出心得体会。苏州科技学院课程结业期末测试大作业 课 程 名 称: C#程序设计 专 业 班 级: 计算机科学与技术 所 在 院(系): 电子信息与工程学 姓 名: 孙尊路 指 导 教 师: 填写日期:2014年 6 月一 系统概要设计1 系统总体模块结构设计学生管理系统总体结构的设计分为两个部分的设计,分别是前台界面的设计,后台代码模块的设计。其中前台界面的设计,即对用户所属功能模块设计;而

3、后台代码模块的设计,即对功能代码的具体实现。系统总体模块结构图如下图4-3所示。 学生管理系统用户管理后台管理模块学生管理用户注册用户登录用户注销学生添加学生删除学生修改学生查询图1-1 系统总体模块结构图 其中,后台管理模块由用户管理和学生管理等模块组成。在后台管理模块中,各级管理员可以通过此模块对学生,用户,以及权限进行管理。1.1 系统总体处理流程学生管理系统总体流程图的设计,后台管理模块的设计。系统总体的流程图如图所示。学生管理信息系统用户登录身份验证失败后台管理模块用户注册用户登录学生添加学生删除学生修改学生查询系统总体的流程图1.2数据库设计1.2.1概念结构设计通过了解学生管理系

4、统要实现的功能,可以得学生管理数据库包含的实体有“管理员”、和“学生”。管理员的属性有:用户名、密码,权限读者的属性有:学生姓名、学号、性别、专业、入学时间、家庭住址、所在校区、班级在本系统中,涉及到用户、学生等实体。它们之间的关系如图:E-R图所示。学生学号入学时间班级姓名家庭住址专业性别用户姓名密码权限 实体间的E-R图1.2.2逻辑结构设计 数据库逻辑设计决定了数据库及其应用的整体性能,调优位置。在本系统中,主要设计了管理员表和学生信息表。表的具体设计如下:学生信息表用于存储读者的相关信息,如:姓名,学号,入学时间,性别,班级, 专业, 家庭住址,所在校区等。表的结构如下表41所示 学生

5、信息表字 段 名类型与宽度是否主键是否允许空值说 明学号varchar(50)姓名varchar(50)性别char(8)入学时间varchar(50)专业varchar(50)班级varchar(50)家庭住址varchar(50)所在校区varchar(50)管理员表用于存储借出图书的相关信息,如:用户名,权限。表的结构如下表2-2所示管理员表字 段 名类型与宽度是否主键是否允许空值说 明用户名varchar(50)密码varchar(50)权限char(10)二 系统详细设计与实现 2.1登录界面的详细设计与实现在进入系统进行各项具有相关操作功能的操作之前,首先会先进入登录界面,在此需要

6、输入相关的登录名和密码,并选择是登录,登录运行界面如图所示:图5-1 登录运行界面当管理员登录进入系统后,将会进行相关的操作。下面具体的介绍管理员各个功能模块的界面设计与实现。实现此功能的代码如下:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace学生管理系统

7、 public partial class 登录 : Form public static string name; public static string password; public static string entry; public 登录() InitializeComponent(); private void label2_Click(object sender, EventArgs e) private void 登录_Load(object sender, EventArgs e) private void button1_Click(object sender, Ev

8、entArgs e) if (this.textBox1.Text = | this.textBox2.Text = ) MessageBox.Show(请输入用户名和密码); else SqlConnection con = new SqlConnection(); /创建连接 con.ConnectionString = server=(local);database=StudentDBMS;uid=sa;pwd=123456; con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandText =select *from 登

9、录; SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() string power = dr0.ToString(); 主界面 main = new 主界面(); main.Tag = this.FindForm(); this.Visible = false; main.ShowDialog(); this.Close(); else MessageBox.Show(用户名或密码错误!); con.Close(); private void button2_Click(object sender, EventArgs e) this.C

10、lose(); public void textBox1_TextChanged(object sender, EventArgs e) name = this.textBox1.Text; SqlConnection con = new SqlConnection(); /创建连接 con.ConnectionString = server=(local);database=StudentDBMS;uid=sa;pwd=123456; con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandText = select 权限 f

11、rom 登录 where 姓名= + this.textBox1.Text + ; SqlDataReader sqlread = cmd.ExecuteReader(CommandBehavior.CloseConnection); if (sqlread.Read() label4.Text = sqlread权限.ToString(); entry =this.label4.Text.Trim(); con.Close(); public void textBox2_TextChanged(object sender, EventArgs e) password = this.textB

12、ox2.Text; 2.2后台管理模块的详细设计与实现2.2.1学生查询模块设计与实现学生查询模块的功能主要是根据“学号“,“姓名” ,“入学时间” ,“所在班级” ,“家庭住址” “专业”等查询学生信息。此页面主要是操作数据库StudenDBMS的“学生”表,使用模糊查询。学生查询运行界面如图所示:图:学生查询运行界面从界面中,实现此功能的代码如下: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using Sys

13、tem.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 学生管理系统 public partial class 查询学生 : Form public 查询学生() InitializeComponent(); private void label1_Click(object sender, EventArgs e) private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) priva

14、te void button1_Click(object sender, EventArgs e) string tempValue = comboBox1.ItemscomboBox1.SelectedIndex.ToString(); SqlConnection con = new SqlConnection(); con.ConnectionString = server=(local);uid=sa;password=123456;database=StudentDBMS; if (tempValue = 姓名) string co = select * from 学生 where 姓

15、名= + this.textBox1.Text + ; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(co, con); da.Fill(ds); dataGridView1.DataSource = ds.Tables0; if (tempValue = 入学时间) string co = select * from 学生 where 入学时间= + this.textBox1.Text + ; DataSet ds = new DataSet(); SqlDataAdapter da = new Sql

16、DataAdapter(co, con); da.Fill(ds); dataGridView1.DataSource = ds.Tables0; if (tempValue = 学号) string co = select * from 学生 where 学号= + this.textBox1.Text + ; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(co, con); da.Fill(ds); dataGridView1.DataSource = ds.Tables0; if (tempValue

17、 = 班级) string co = select * from 学生 where 班级= + this.textBox1.Text + ; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(co, con); da.Fill(ds); dataGridView1.DataSource = ds.Tables0; if (tempValue = 专业) string co = select * from 学生 where 专业= + this.textBox1.Text + ; DataSet ds = new

18、 DataSet(); SqlDataAdapter da = new SqlDataAdapter(co, con); da.Fill(ds); dataGridView1.DataSource = ds.Tables0; if (tempValue = 家庭住址) string co = select * from 学生 where 家庭住址= + this.textBox1.Text + ; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(co, con); da.Fill(ds); dataGridV

19、iew1.DataSource = ds.Tables0; if (tempValue = 所在校区) string co = select * from 学生 where 所在校区= + this.textBox1.Text + ; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(co, con); da.Fill(ds); dataGridView1.DataSource = ds.Tables0; private void button2_Click(object sender, EventArgs e

20、) this.Close(); 2.2.2学生添加模块的设计与实现学生添加运行界面如图5-3所示:图:学生添加运行界面实现此功能的代码如下:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 学生管理系统 public pa

21、rtial class 添加学生 : Form public 添加学生() InitializeComponent(); private void 添加学生_Load(object sender, EventArgs e) private void groupBox1_Enter(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) if (this.textBox1.Text != ) string a = this.textBox1.Text; string c = this.t

22、extBox2.Text; string b = this.dateTimePicker1.Value.ToShortDateString(); string d = this.textBox4.Text; string er = this.textBox5.Text; string f =this.textBox6.Text; string g = this.textBox7.Text; string h = this.textBox8.Text; SqlConnection con = new SqlConnection(); con.ConnectionString = server=(

23、local);database=StudentDBMS;uid=sa;pwd=123456; SqlCommand cmd = con.CreateCommand(); cmd.CommandText = insert into 学生(姓名,入学时间,学号,班级,性别,专业,家庭住址,所在校区) + values( + a + , + b + , + c + , + d + , + er + , + f + , + g + , + h + ); con.Open(); int dd = cmd.ExecuteNonQuery(); if (dd = 1) MessageBox.Show(添加成

24、功!); else MessageBox.Show(请输入用户名!); private void button2_Click(object sender, EventArgs e) this.Close(); private void textBox6_TextChanged(object sender, EventArgs e) private void label7_Click(object sender, EventArgs e) private void textBox1_TextChanged(object sender, EventArgs e) 2.2.3 删除学生模块的设计与实

25、现删除学生模块的功能主要是根据学生姓名。删除学生运行界面如图5-4所示: 图:删除运行界面实现此功能的代码如下:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace学生管理系统 public partial class 删除学

26、生 : Form public 删除学生() InitializeComponent(); private void button1_Click(object sender, EventArgs e) DialogResult result=new DialogResult (); result = MessageBox.Show(确定要删除该学生?,警告!,MessageBoxButtons .OKCancel ,MessageBoxIcon .Warning ); switch (result ) case DialogResult.OK: SqlConnection con = new

27、SqlConnection(); con.ConnectionString = server=(local);database=StudentDBMS;uid=sa;pwd=123456; SqlCommand cmd = con.CreateCommand(); cmd.CommandText = delete from 学生 where 姓名= + this.textBox1.Text + ; cmd.Connection = con; con.Open(); int d = cmd.ExecuteNonQuery(); if (d = 1) MessageBox.Show(删除成功);

28、break; case DialogResult.Cancel: break; private void button3_Click(object sender, EventArgs e) this.Close(); private void button2_Click(object sender, EventArgs e) textBox1.Clear(); private void button3_Click_1(object sender, EventArgs e) this.Close(); private void textBox1_TextChanged(object sender, EventArgs e) 2.2.4浏览学生模块的设计与实现浏览学生运行界面如图5-5所示:图:浏览学生运行界面浏览按钮的主要代码:using System;using System.Collections.Generic;using System.ComponentModel;using

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1