教务管理系统简介及学生端设计6.1教务管理系统简介6.11系统总体内容摘要:

Lable lblBirthday 生日: Lable lblPassword 密码: Lable lblCfmPassword 确认密码: Lable lblStuName 姓名: Lable lblStuSex 性别: Lable lblEnrolDate 入学时间: Lable lblRace 民族: Lable lblGraduDate 毕业时间: Lable lblMajor 专业: Lable lblParty 政治面貌: Lable lblPhone 电话: Lable lblHome 家族住址: Lable lblDesc 其它说明: TextBox txtStuNum TextBox txtPassword PasswordChar 为 * TextBox txtCfmPassword PasswordChar 为 * TextBox txtStuName TextBox txtMajor TextBox txtPhone TextBox txtHome TextBox txtDesc Multiline 为 True DateTimePicker dtpBirthday DateTimePicker dtpEnrolDate DateTimePicker dtpGraduDate ComboBox dmbSex Items 属性为:男、女DropDownStyle 属性为: DropDownList ComboBox cmbRace ComboBox cmbParty Items 属性为:中共党员、中共预备党员、共 青 团 员、 其 他DropDownStyle 属性为: DropDownList Button btnOK 提交注册 Button btnCancel 重新填写 ( 4) 双击“提交注册”按钮,注册按钮单击事件 btnOK_Click,在 的编码界面中首先引入如下命名空间: using。 using。 ( 5) 编写“提交注册”按钮单击事件代码如下: private void btnOK_Click(object sender, EventArgs e) { if ( == ) { AlertMessage(请输入姓名 )。 ()。 } else if ( == ) { AlertMessage(请输入学号 )。 ()。 } else if (() == ) { AlertMessage(请选择性别 )。 ()。 } else if (() == ) { AlertMessage(请选择政治面貌 )。 ()。 } else if ( == ) { AlertMessage(请输入电话号码 )。 ()。 } else if ( == ) { AlertMessage(请输入家庭住址 )。 ()。 } else if (() == ) { AlertMessage(请输入民族 )。 ()。 } else if ( == ) { AlertMessage(请选择专业 )。 ()。 } else if (() == ) { AlertMessage(请输入密码 )。 ()。 } else if ( != ) { AlertMessage(两次输入的密码不匹配,请查实后重试 )。 ()。 } else { //将信息封装为学生信息实体 EStudent stuInfo = new EStudent()。 = ()。 =。 = ()。 = ()。 =。 =。 =。 =。 = ()。 =。 = ()。 = ()。 =。 try { StudentDB stuDB = new StudentDB()。 if ((stuInfo)) { AlertMessage(您的信息已经添加成功 )。 ()。 } else { AlertMessage(操作失败,请确保您的学号正确 )。 } } catch (SqlException ex) { AlertMessage(数据库操作失败,请稍后重试。 )。 } } } ( 6) 在 RegisterForm 中添加自定义方法 AlertMessage,代码如下: private void AlertMessage(string message) { (message,Information:, ,)。 } ( 7) 在“解决方案管理器”窗口选中 DataAccess 项目中的 Common 文件夹下的 Entity 子文件夹,单击右键,从弹出的快捷菜单中选择 Add| Class 命令,在弹出的对话框中输入文件名为 ,修改代码如下: using System。 using。 using。 namespace { public class EStudent { private string stuNum。 /// summary /// 学生学号 /// /summary public string StuNum { get { return stuNum。 } set { stuNum = value。 } } private string stuName。 /// summary /// 姓名 /// /summary public string StuName { get { return stuName。 } set { stuName = value。 } } private DateTime stuEnrolDate。 /// summary /// 入学时间 /// /summary public DateTime StuEnrolDate { get { return stuEnrolDate。 } set { stuEnrolDate = value。 } } private DateTime stuGraduDate。 /// summary /// 毕业时间 /// /summary public DateTime StuGraduDate { get { return stuGraduDate。 } set { stuGraduDate = value。 } } private string stuParty。 /// summary /// 政治面貌 /// /summary public string StuParty { get { return stuParty。 } set { stuParty = value。 } } private DateTime stuBirthday。 /// summary /// 出生日期 /// /summary public DateTime StuBirthday { get { return stuBirthday。 } set { stuBirthday = value。 } } private string stuSex。 /// summary /// 性别 /// /summary public string StuSex { get { return stuSex。 } set { stuSex = value。 } } private string stuRace。 /// summary /// 民族 /// /summary public string StuRace { get { return stuRace。 } set { stuRace = value。 } } private string stuMajor。 /// summary /// 专业 /// /summary public string StuMajor { get { return stuMajor。 } set { stuMajor = value。 } }。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。