




已阅读5页,还剩27页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
摘要作为计算机专业的信院来说,机房实验是必不可少的教学内容,但是在建设和管理上面临着挑战。机房规模的扩大、软硬件的不断更新、机房角色的多元化以及学生层次的良莠不齐,给管理带来了极大的难度,开发一个计算机系统进行自动化的管理势在必行。本文以信院的机房管理为背景,实现了机房管理系统的教师管理模块,能用来为老师提供本院学生的信息,进行试验的安排,为计算机管理员提供有关机器的信息,能给计算机管理员带来极大的方便。该系统是在VS2010开发平台上开发的,是基于.NET Framework语言库的C#语言编写的。使用Microsoft SQL Server数据库作为存储数据。关键词 机房管理,教师管理,SQL Server数据库1绪论时代的进步以及网络的发展与普及,给机房管理系统的应用提供了便利的硬件环境。机房管理系统与SQL Server数据库相互的配合,显示出了新时代教学方式的独特优势。再次介绍计算机管理系统的背景及意义,以及开发本系统所使用的工具和平台。1.1开发背景及意义二十一世纪是信息的时代,而且目前大学的网络建设趋于完善。大学的教育方式也在技术上得到了根本的改变,多媒体教学已经进入到每一个课堂,教师与老师的远程通信,也逐渐出现在我们的身边。为此随着计算机进入到机房,尤其是有关计算机方面的学院,我们迫切的需要计算机机房管理系统,来对机房,教师,学生,实验进行统一的管理。通过此系统,教师可以高效的对学生信息,学生上机实验进行跟踪管理,省去大量的时间和精力。而且,计算机管理员使用此系统可以轻松的查询机房中机器的使用情况,统计计算机的使用寿命以及计算机运行是否良好。而我们也会通过努力,不断的探索,来完善内部的架构,使得系统层次分明,模块功能完整,从而加强整个系统的兼容性,安全性,可维护性和健壮性。1.2开发工具介绍本系统采用C#开发语言,C#是microsoft强力退出的新一代语言,它集合了java,VC的优势,成为了现在开发web和GUI信息管理系统的首选语言,C#采用了java的完全面向对象机制,方便开发者对现实世界进行抽象建模,。而C#和visio的结合更是珠联璧合,很多系统代码可以自动生成,省去了大量的人力,时间。也提供了统一的验证模式,开发者只要调用验证的类,就可以轻松的进行各种数据的验证,其中包括邮箱格式,电话和时期的验证。而且VS2010提供了SQL Server2008数据库服务独特于其它的开发平台,在VS中可以直接运行数据库文件。使用SQL Server 2008数据库管理系统。本系统默认两个管理员Administrator和sa,对系统数据库和用户数据库惊醒管理。提供分析查询功能,可以在里边写SQl语法,创建存储过程,视图,表等。2系统需求分析本系统为中小型管理系统,主要功能是对计算机上机实验进行管理,包括老师对学生的上机管理,教师的基本信息资料与学生的基本信息资料等,满足教师、计算机管理员的工作需要。学生只能通过登录客户端来访问服务器,获得服务器文件,等待机房管理通知等,系统与SQL Server相结合,实现教师,学生,机房电脑的大量数据存储。2.1系统任务概述机房管理系统可以运行在windows系统上,它的实现主要是帮助教师、机房管理员对实验进行合理的安排,并且本系统帮助教师与学生之间完成远程通信。本节主要论述了机房管理系统的运行时环境和需求分析2.1.1运行环境本系统属于中小型管理系统,硬件环境只需要128M内存空间。本系统主要运行在windows操作系统上,采用microsoft SQL Server数据库系统,运行在.NET Framework2.0-.NET Framework 4.0版语言包基础上。2.1.2系统功能系统工分为五大部分,本节之论述用户登录与注册,学生管理与实验安排,两部分。工列为4项来阐述。(1) 在服务器端,教师和机房管理员可以通过输入账号和密码,选择登录类型,进入到操作界面中。如果账号和密码输入有误,系统则提示报错信息。(2) 机房管理员可以对学生的资料包括学号姓名联系电话家庭住址进行修改,查询,删除等操作。(3) 机房管理员可以对学生实验进行查询等(4) 教师可以查询自己学生的信息,可以把一些学生的信息添加到自己的班级中,把一些学生删除自己的班级。2.2数据采集本系统主要收集关于机房、教师、学生的数据。而且要对数据进行验证,通过规定用户的权限,使各个用户浏览相应的信息。2.2.1需要收集的数据机房的数据,包括机房电脑的存储容量,现在存储数量。学生的资料,包括学生的姓名,学号,地址,联系电话,专业,年级等。教师的资料,包括教师的姓名,联系电话,住址,所带的课程。2.2.2数据约束的条件 学生只能查新自己的基本资料,查询自己所选的实验课和自己教师的信息。机房管理员可以对本院所有实验课的教师进行查询,而且还可以查询所有学生的信息以及他们的实验安排。教师可以申请机房的使用权,可以查询自己所带实验课的学生的信息,可以给自己的班级安排实验。数据库设计本章对机房管理系统中的数据设计进行说明。主要内容包括教师表,学生表,机房表,教师管理机房,学生机房安排表。在存储过程,数据字段的定义方面进行了详细的说明。(1)计算机机房管理系统中一个重要的实体是计算机。计算机的属性包括ID(用机房号加上此电脑存入机房的顺序来表示的)、存入的时间、存放的位置(行号和列好表示)、运行情况、外键机房号。(2)机房机房的主要属性是机房号,机房中计算机的存储容量,已经存入的计算机的数量,一个外键是机房管理员的ID号,记录机房由哪一个管路员来管理。机房号的格式为楼层号+机房在楼层中的顺序(如三楼第三个房间为303)。(3)教师表(4)学生表(5) 学生与机房关系表包括学生的学号,上机的星期,和上机的时间段,上机的课程(6) 教师与机房的关系包括老师的编号,上机的星期,上机的时间段,上机的课程(7) 登录的用户表 机房管理系统登录注册主界面查询选择天的课程查询学生信息并可以修改和删除查询老师信息并可以修改查询机房信息新增学生新增教师前台设计(1)登录页面登录页面:当姓名或者密码为空时检验,提示不能为空,当输入的用户名和密码与数据库中的内容不一致时提示用户名或者密码输入错误。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 ComputerRoomMangement public partial class Login : Form public Login() InitializeComponent(); private void button2_Click(object sender, EventArgs e) RegisteForm rForm = new RegisteForm(); rForm.login = this; rForm.ShowDialog(); public void GetUserName(string name) txtName.Text = name; private void button1_Click(object sender, EventArgs e) bool result = check(); if (result = true) SqlConnection conn = new SqlConnection(Data Source=.;Initial Catalog=DB_ComputerManagement;User ID =sa;pwd=1); string sql = string.Format(select count(*) from TB_User where Username=0 and Password=1,txtName.Text.Trim(),txtPassword.Text.Trim(); SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); int count =cmd.ExecuteNonQuery(); if (count 0) else lbcheck.Visible = true; private bool check() bool result = true; if (txtName.Text.Trim() = string.Empty) lbNameError.Visible = true; result = false; else lbNameError.Visible = false; if (txtPassword.Text.Trim() = string.Empty) lbPasswordError.Visible = true; result = false; else lbPasswordError.Visible = false; return result; private void Login_Load(object sender, EventArgs e) 注册页面首先检验用户名和密码和确认密码是否为空,为空的话提示不能为空,再检验输入的密码和确认密码是否一致,不一致的话提示出错。并当注册成功时把用户名自动填写到登录页面的用户上。点击取消时推出注册页面。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 ComputerRoomMangement public partial class RegisteForm : Form public Login login; public RegisteForm() InitializeComponent(); private void RegisteForm_Load(object sender, EventArgs e) private void btnRegister_Click(object sender, EventArgs e) bool result = checkError(); if (result = true) SqlConnection conn = new SqlConnection(Data Source.;Initial Catalog=DB_ComputerManagement;User ID=sa;pwd=1); string sql = string.Format(insert into FamilyUser values(0,1), txtName.Text.Trim(), txtPassword.Text.Trim(); SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); int count = cmd.ExecuteNonQuery(); conn.Close(); if (count = 1) MessageBox.Show(成功|注册了?一?个?用?户); login.GetUserName(txtName.Text.Trim(); this.Close(); private bool checkError() bool result = true; if (txtName.Text.Trim() = string.Empty) lblNameError.Visible = true; result = false; else lblNameError.Visible = false; if (txtPassword.Text.Trim() = string.Empty) lblPasError.Visible = true; result = false; else lblPasError.Visible = false; if (txtConfirmPassword.Text.Trim() = string.Empty) lblConError.Visible = true; result = false; else lblConError.Visible = false; if (txtPassword.Text.Trim() != txtConfirmPassword.Text.Trim() lblConError.Text = 两次密码不一致?; lblConError.Visible = true; result = false; else lblConError.Visible = false; return result; private void btnCancel_Click(object sender, EventArgs e) this.Close(); 当注册成功时提示,并且登录页面自动添加注册的用户名主界面在主界面上添加日历。在资源管理器里右键引用主界面代码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 ComputerRoomMangement public partial class MainForm : Form public SelectCourseOfOneDay sele = new SelectCourseOfOneDay(); public MainForm() InitializeComponent(); private void MainForm_Load(object sender, EventArgs e) / TODO: 这a行D代码?将?数y据Y加载?到?表“dB_ComputerManagementDataSet.TB_Computer”中D。您可以?根据Y需要a移?动或删?除y它。 this.tB_ComputerTableAdapter.Fill(this.dB_ComputerManagementDataSet.TB_Computer); / TODO: 这a行D代码?将?数y据Y加载?到?表“dB_ComputerManagementDataSet.TB_Computer”中D。您可以?根据Y需要a移?动或删?除y它。 DataSet ds = this.dB_ComputerManagementDataSet.TB_Computer.DataSet; this.tB_ComputerTableAdapter.Fill(this.dB_ComputerManagementDataSet.TB_Computer); public static string weekstr; private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e) richTextBox1.Text = monthCalendar1.SelectionRange.Start.ToShortDateString(); weekstr = monthCalendar1.SelectionRange.Start.DayOfWeek.ToString(); switch (weekstr) case Monday: weekstr = 星?期一?; break; case Tuesday: weekstr = 星?期二t; break; case Wednesday: weekstr = 星?期三y; break; case Thursday: weekstr = 星?期四?; break; case Friday: weekstr = 星?期五?; break; case Saturday: weekstr = 星?期六; break; case Sunday: weekstr = 星?期日?; break; private void timer1_Tick(object sender, EventArgs e) DateTime dt = DateTime.Now; string date = dt.ToLongDateString(); string tine = dt.ToLongTimeString(); lblTime.Text = date + tine; private void button1_Click(object sender, EventArgs e) SelectCourseOfOneDay select = new SelectCourseOfOneDay(); select.Show(); private void button2_Click(object sender, EventArgs e) SelectStuMessage stu = new SelectStuMessage(); stu.Show(); private void button3_Click(object sender, EventArgs e) SelectTeaMessage teacher = new SelectTeaMessage(); teacher.Show(); private void 关?于ToolStripMenuItem_Click(object sender, EventArgs e) MessageBox.Show(韩?艳T超?制?作); private void button6_Click(object sender, EventArgs e) ComputerRoomMessage comRoom = new ComputerRoomMessage(); comRoom.Show(); private void button4_Click(object sender, EventArgs e) AddStudent addstu = new AddStudent(); addstu.Show(); private void button5_Click(object sender, EventArgs e) AddTeacher addTeac = new AddTeacher(); addTeac.Show(); 点击查询选择天数的课程弹出窗口本窗口代码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 ComputerRoomMangement public partial class SelectCourseOfOneDay : Form public SelectCourseOfOneDay() InitializeComponent(); private void SelectCourseOfOneDay_Load(object sender, EventArgs e) SqlConnection conn = new SqlConnection(Data Source=.;Initial Catalog=DB_ComputerManagement;User ID =sa;pwd=1); string sql = string.Format(select TB_StudentRoom.* ,Name from TB_StudentRoom ,TB_Teacher where TB_StudentRoom.sCourse=TB_Teacher.Course and TB_StudentRoom.sDay=0,MainForm.weekstr ); conn.Open(); DataSet ds = new DataSet(); SqlDataAdapter sda = new SqlDataAdapter(sql, conn); sda.Fill(ds, s); dataGridView1.DataSource = ds.Tabless; conn.Close(); 点击查询学生信息弹出窗口选择一条信息底部窗口打开(或者点击打开进行展开)本窗口可以对学生信息进行修改和删除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 ComputerRoomMangement public partial class SelectStuMessage : Form public SelectStuMessage() InitializeComponent(); private void SelectStuMessage_Load(object sender, EventArgs e) setpnlBottomVisible(true); SqlConnection conn = new SqlConnection(Data Source=.;Initial Catalog=DB_ComputerManagement;User ID =sa;pwd=1); string sql = string.Format(select * from TB_Student); conn.Open(); DataSet ds = new DataSet(); SqlDataAdapter sda = new SqlDataAdapter(sql, conn); sda.Fill(ds, s); dataGridView1.DataSource = ds.Tabless; conn.Close(); private void button3_Click(object sender, EventArgs e) private void setpnlBottomVisible(bool hide) if (hide=true) this.Size = new Size(this.Size.Width, 330); pnlBottom.Visible = false; this.btnChange.Location = new Point(this.btnChange.Location.X, this.btnChange.Location.Y - 125); btnChange.Text = 打开a; else this.Size = new Size(this.Size.Width, 447); pnlBottom.Visible = true; pnlBottom.Enabled = true; this.btnChange.Location = new Point(this.btnChange.Location.X, this.btnChange.Location.Y + 125); btnChange.Text = 关?闭?; private void btnChange_Click(object sender, EventArgs e) if (btnChange.Text = 打开a) setpnlBottomVisible(false); else setpnlBottomVisible(true); private void pnlBottom_Paint(object sender, PaintEventArgs e) private void button2_Click(object sender, EventArgs e) SqlConnection conn = new SqlConnection(Data Source=.;Initial Catalog=DB_ComputerManagement;User ID=sa;pwd=1); string sql = string.Format(update TB_student set Name=0,Sex=1,Tel=2,Asress=3,email=4,Grade=5,Class=6,Major=7 where num=8,txtName.Text.Trim(),txtSex.Text.Trim(),txtTel.Text.Trim(),txtAddre.Text.Trim(),txtEmail.Text.Trim(),txtGride.Text.Trim(),txtCalss.Text.Trim(),txtMajor.Text.Trim(),txtId.Text.Trim(); SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); int rowCount = Convert.ToInt32(cmd.ExecuteNonQuery(); if (rowCount 0) MessageBox.Show(更新?成功|); else MessageBox.Show(更新?失败); conn.Close(); private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) setpnlBottomVisible(false); btnModify.Enabled = true; txtId1.Text = dataGridView1.SelectedRows0.Cells0.Value.ToString(); txtName1.Text = dataGridView1.SelectedRows0.Cells1.Value.ToString(); txtSex1.Text = dataGridView1.SelectedRows0.Cells2.Value.ToString(); txtTel1.Text = dataGridView1.SelectedRows0.Cells3.Value.ToString(); txtAddre1.Text = dataGridView1.SelectedRows0.Cells4.Value.ToString(); txtEmail1.Text = dataGridView1.SelectedRows0.Cells5.Value.ToString(); txtGride1.Text = dataGridView1.SelectedRows0.Cells6.Value.ToString(); txtCalss1.Text = dataGridView1.SelectedRows0.Cells7.Value.ToString(); txtMajor1.Text = dataGridView1.SelectedRows0.Cells8.Value.ToString(); private void button2_Click_1(object sender, EventArgs e) SqlConnection conn = new SqlConnection(Data Source=.;Initial Catalog=DB_ComputerManagement;User ID=sa;pwd=1); string sql = string.Format(delete from TB_Student where Num=0, txtId1.Text); SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); int rowCount = Convert.ToInt32(cmd.ExecuteNonQuery(); if (rowCount 0) MessageBox.Show(删除成功); else MessageBox.Show(删除失败); conn.Close(); 点击查询老师信息弹出窗口选择一条信息或者点击打开,打开底部窗口本窗口只可以对信息进
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 社工证考试题库及答案
- 校园小超市安全知识培训课件
- 工会相关考试试题及答案
- 校车碰撞测试题及答案
- 用公务员面试题及答案
- 公共外交面试题及答案
- 减灾中心面试题及答案
- 校园现金测试题及答案
- 2025年国能铜陵发电有限公司招聘考试笔试试题(含答案)
- 2025年广元团市委下属事业单位招募人员考试笔试试题(含答案)
- 2025年云南省投资控股集团有限公司招聘考试笔试试题【附解析】
- 2025年中国充电桩行业政策、市场规模及投资前景研究报告(智研咨询发布)
- 2025年时事政治试题库【必刷】附答案详解
- 内部员工筹资协议书范本
- 2025年起重指挥人员考试题库
- 2025年留疆战士考试题库及答案
- 新初一入学分班考试语文卷(含答案)
- 中介贷款行业知识培训总结课件
- 数字化赋能供应链:2025年制造业协同管理创新趋势分析报告
- 2025年高考英语新课标Ⅱ卷点评及2026备考方向 课件
- 2025年甘肃高考政治试题解读及答案详解讲评课件
评论
0/150
提交评论