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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

本文(#高校学生宿舍信息管理系统.docx)为本站会员(b****2)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

#高校学生宿舍信息管理系统.docx

1、#高校学生宿舍信息管理系统高校学生宿舍管理系统课程设计姓 名: 毛显淇 学 号: 20080702208 专 业: 08级信息管理与信息系统2班 指导教师: 张旭东 时 间: 2011年12月2日 1 课程设计目的2 课程设计题目描述和要求3 课程设计报告内容一、课程设计目的通过课程设计,使学生能够掌握C#语言的基本内容及程序设计的基本方法与编程技巧,使学生具有应用计算机解决实际问题的基本能力,培养学生掌握使用计算机处理问题的思维方法与途径, 培养良好的程序设计风格,使学生能够独立编制和调试各种结构的面向对象的C#语言程序。初步掌握软件开发过程的问题分析、系统设计、程序编码、测试等基本方法和技

2、能;提高综合运用所学的理论知识和方法独立分析和解决问题的能力。完成所选设计题目,上机调试通过该程序系统所有功能;编写设计说明书,内容包括:课程设计的目的、意义;设计任务;总体设计方案;软件设计(各功能模块的流程图及详细的文字说明);软件系统的使用说明;收获、体会等。二、课程设计题目描述和要求1、开发系统的功能介绍(1)系统管理窗体 系统设置信息(2)资源管理窗体 管理宿舍信息(3)学生管理窗体 管理学生住宿信息。(4)报修管理窗体 管理宿舍维修信息。(5)违规管理窗体 管理违规学生信息三、课程设计报告内容操作流程 用户注册登录操作界面系统管理-系统设置信息 资源管理-管理宿舍信息 学生管理-管

3、理学生住宿信息报修管理管理宿舍维修信息违规管理管理违规学生信息管理违规学生信息(四)系统功能结构根据高校学生宿舍信息管理系统的特点,可将其分为:系统登录、系统注册用户,主界面、系统管理界面、资源管理界面、学生管理界面等。(五)系统预览为了初步了解家庭理财系统,下面分别给出系统中的四个界面。登录页面:注册页面:主窗体页面:学生信息登记界面:学生宿舍基本信息界面(六)构建开发环境:系统开发环境:Microsoft Visual Studio 2010集成开发环境。系统开发语言:C#系统数据库:Microsoft Sqlserver2008开发运行环境:Windows XP、Vista、7系统服务运

4、行环境:M Framework 4.0.最佳效果:1024*768。(七)数据库设计本系统采用Sqlserver2008数据库,名称为VirgoDB_StuInfo表:DB_DormInfo表:(九)公共类设计在开发过程中,经常会用到一些公共的模块,如数据库的连接及操作的类,字串的处理的类等,因此,在开发系统前,首先要设计 这些公共模块,下面将介绍高校学生宿舍信息管理系统中所需要的数据库操作类,数据库操作类用来完成数据库的连接操作,以及数据库的查询,添加,删除修改操作,现将这几种操作编写到一个公共类里,可以减少代码的编写工作,有利于代码的维护。代码如下:using System;using S

5、ystem.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;using System.Windows.Forms;namespace VirgoMis / / 此类维护数据库连接字符串和Connection对象 / class DBHelper private static SqlCommand cmd = null; private static SqlDataReader dr = null; /数据库连接字符串 /private st

6、atic string connectionString = Server = HUAIHUAI-8B2819; Database = Virgo; Integrated Security = SSPI; private static string connectionString = Data Source=.;AttachDbFilename=F:学习C#网上下载新建文件夹源程序代码VirgoMisVirgo.mdf;Integrated Security=True; /数据库连接Connection对象 public static SqlConnection connection = n

7、ew SqlConnection(connectionString); public DBHelper() #region 返回结果集 public static SqlDataReader GetResult(string sql) try cmd = new SqlCommand(); cmd.CommandText = sql; cmd.Connection = connection; cmd.Connection.Open(); dr = cmd.ExecuteReader(); return dr; catch (Exception ex) MessageBox.Show(ex.Me

8、ssage); return null; finally /dr.Close(); /cmd.Connection.Close(); #endregion #region 对Select语句,返回int型结果集 public static int GetSqlResult(string sql) try cmd = new SqlCommand(); cmd.CommandText = sql; cmd.Connection = connection; cmd.Connection.Open(); int a = (int)cmd.ExecuteScalar(); return a; catc

9、h (Exception ex) MessageBox.Show(ex.Message); return -1; finally cmd.Connection.Close(); #endregion #region 对Update,Insert和Delete语句,返回该命令所影响的行数 public static int GetDsqlResult(string sql) try cmd = new SqlCommand(); cmd.CommandText = sql; cmd.Connection = connection; cmd.Connection.Open(); cmd.Execu

10、teNonQuery(); return 1; catch (Exception ex) MessageBox.Show(ex.Message); return -1; finally cmd.Connection.Close(); #endregion (十)各界面代码及功能实现(1)登录界面:功能:登陆登陆界面代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using Sy

11、stem.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace VirgoMis public partial class Login : Form public Login() InitializeComponent(); #region 验证用户的输入,成功返回true,失败返回false private bool IsValidataInput() if (txtLoginNo.Text.Trim() = ) MessageBox.Show(请输入账号!,登陆提示,MessageBoxButtons.O

12、K,MessageBoxIcon.Information); txtLoginNo.Focus(); return false; else if (txtLoginPwd.Text = ) MessageBox.Show(请输入密码!,登陆提示,MessageBoxButtons.OK,MessageBoxIcon.Information); txtLoginPwd.Focus(); return false; else if (cboLoginType.Text = ) MessageBox.Show(请选择登陆类型!,登陆提示,MessageBoxButtons.OK,MessageBox

13、Icon.Information); cboLoginType.Focus(); return false; return true; #endregion #region 验证用户是否合法 /传递用户账号、密码、登陆类型,合法返回true,不合法返回false /message参数用来记录验证失败的原因 private bool IsValidataUser(string loginNo, string loginPwd, string loginType, ref string message) string sql = String.Format(select count(*) from

14、 DB_ManageInfo where loginNo = 0 and loginPwd = 1 and loginType = 2,loginNo,loginPwd,loginType); int a = DBHelper.GetSqlResult(sql); if (a 1) message = 该用户名或密码不存在!; return false; else return true; #endregion /登陆事件 private void btnLogin_Click(object sender, EventArgs e) /标识是否为合法用户 bool isValidUser =

15、false; string message = ; if (IsValidataInput() /验证用户是否为合法用户 isValidUser = IsValidataUser(txtLoginNo.Text.Trim(),txtLoginPwd.Text,cboLoginType.Text,ref message); if (isValidUser) /记录登陆用户名和用户类型 UserHelper.loginName = txtLoginNo.Text.Trim(); UserHelper.loginType = cboLoginType.Text; /登陆类型是楼管会 if (cboL

16、oginType.Text = 楼管会) /登陆类型是维修部 else if (cboLoginType.Text = 维修部) /登陆类型是总务处 else if (cboLoginType.Text = 总务处) WFMain sfm = new WFMain(); sfm.Show(); this.Hide(); else MessageBox.Show(message,登陆提示,MessageBoxButtons.OK,MessageBoxIcon.Asterisk); private void btnCanel_Click(object sender, EventArgs e) Di

17、alogResult result = MessageBox.Show(您确定要退出吗?, 操作提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (result = DialogResult.OK) Application.Exit(); private void Login_Shown(object sender, EventArgs e) /光标焦点默认在输入账号上 txtLoginNo.Focus(); private void Login_Load(object sender, EventArgs e) priva

18、te void Login_FormClosed(object sender, FormClosedEventArgs e) Application.Exit(); (2)注册界面: 功能:注册。代码如下: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.Sql

19、Client;namespace VirgoMis public partial class MRegister : Form public MRegister() InitializeComponent(); private void WFRegison_Load(object sender, EventArgs e) txtLoginNo.Focus(); #region 判断是否为有效输入 private bool IsValidataInput() if (txtLoginNo.Text.Trim() = ) MessageBox.Show(请输入账号!, 注册提示, MessageB

20、oxButtons.OK, MessageBoxIcon.Information); txtLoginNo.Focus(); return false; else if (txtLoginPwd.Text = ) MessageBox.Show(请输入密码!, 注册提示, MessageBoxButtons.OK, MessageBoxIcon.Information); txtLoginPwd.Focus(); return false; else if (DtxtLoginPwd.Text = ) MessageBox.Show(请再次确认输入密码!, 注册提示, MessageBoxBu

21、ttons.OK, MessageBoxIcon.Information); DtxtLoginPwd.Focus(); return false; else if (!txtLoginPwd.Text.Equals(DtxtLoginPwd.Text) MessageBox.Show(两次输入的密码不一致,请重新输入!, 注册提示, MessageBoxButtons.OK, MessageBoxIcon.Information); DtxtLoginPwd.Clear(); txtLoginPwd.Clear(); txtLoginPwd.Focus(); return false; el

22、se if (cboLoginType.Text = ) MessageBox.Show(请选择登陆类型!, 注册提示, MessageBoxButtons.OK, MessageBoxIcon.Information); cboLoginType.Focus(); return false; return true; #endregion private bool IsValidataUser(string loginNo, string loginPwd, string loginType, ref string message) string sql = String.Format(se

23、lect count(*) from DB_ManageInfo where loginNo = 0 and loginType = 1, loginNo, loginType); int count = DBHelper.GetSqlResult(sql); if (count = 1) message = 该账号已经存在,请重新注册!; return false; else return true; private void btnEnter_Click(object sender, EventArgs e) bool isValidUser = false; string message

24、 = ; if (IsValidataInput() /验证用户是否为合法用户 isValidUser = IsValidataUser(txtLoginNo.Text.Trim(), txtLoginPwd.Text, cboLoginType.Text, ref message); if (isValidUser) string sql = String.Format(insert into DB_ManageInfo(loginNo,loginPwd,loginType) values (0,1,2),txtLoginNo.Text.Trim(),txtLoginPwd.Text,cbo

25、LoginType.Text); int result = DBHelper.GetDsqlResult(sql); if (result = 1) MessageBox.Show(注册成功!, 注册提示, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); else MessageBox.Show(注册失败!, 注册提示, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); else MessageBox.Show(message,注册提示,MessageBoxButtons.OK,MessageBoxI

26、con.Asterisk); txtLoginNo.Clear(); txtLoginPwd.Clear(); DtxtLoginPwd.Clear(); cboLoginType.SelectedIndex = -1; txtLoginNo.Focus(); private void btnExit_Click(object sender, EventArgs e) this.Close(); private void btnCanel_Click(object sender, EventArgs e) this.Close(); (3)主界面:功能:数据的显示,操作,各窗口跳转。代码如下:

27、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;namespace VirgoMis public partial class WFMain : Form public WFMain() InitializeComponent(); private T OpenUniqueMDIChildWin

28、dow(Form mdiParent) where T : Form, new() foreach (Form subForm in mdiParent.MdiChildren) if (!subForm.GetType().Equals(typeof(T) subForm.Close(); else subForm.Activate(); return subForm as T; T newForm = new T(); newForm.MdiParent = mdiParent; /newForm.FormBorderStyle = FormBorderStyle.None; /newForm.WindowState = FormWindowState.Maximized; /newForm.MaximizeBox = false; /newForm.MinimizeBox = false; newForm.StartPosition = FormStartPosition.CenterScreen; newForm.Show(); return newForm; private void WFManage_Load(object sender, E

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2