教务管理员操作流程
更新时间:2024-06-24 03:55:01 阅读量: 综合文库 文档下载
教务管理员操作流程
1、
使用Admin账号登陆——教务管理员系统
代码区域:
int count = 0;
bool isValidUser = false; if (loginType == \教务管理员\) {
string sql = string.Format(\LoginPwd='{1}'\, loginId, loginPwd); try {
SqlCommand command = new SqlCommand(sql, DBHelper.connection); DBHelper.connection.Open();
count = (int)command.ExecuteScalar(); if (count == 1) {
isValidUser = true; } else {
index++;
if (index <=3) {
message = \用户名或密码不存在!\; }
else if (index >= 3) {
Application.Exit(); }
isValidUser = false; } }
catch (Exception ex) {
message = ex.Message;
Console.WriteLine(ex.Message); } finally {
DBHelper.connection.Close(); }
if (cboType.Text == \教务管理员\) {
AdminForm adminForm = new AdminForm(); adminForm.Show(); return true;
}
成功进入后可以进行
AdminForm.cs (教务管理员窗体)
用户管理→新增用户→新增学生信息(代码如下:)
AddStudentForm addstudnetForm = new AddStudentForm(); addstudnetForm.MdiParent = this; addstudnetForm.Show();
→弹出窗口(学生信息添加)→Student表
AdminStudentForm.cs
保存按钮代码如下:
if (TianJia()) { try {
SqlCommand command = new SqlCommand(sql, DBHelper.connection); DBHelper.connection.Open();
int result = command.ExecuteNonQuery(); if (result != 1) {
MessageBox.Show(\添加失败\, \输入提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); } else {
MessageBox.Show(\添加成功\, \输入提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
catch (Exception ex) {
MessageBox.Show(ex.Message);
} finally {
DBHelper.connection.Close(); } } }
private void AddStudentForm_Load(object sender, EventArgs e) {
string sql = \; try {
SqlCommand command=new SqlCommand(sql,DBHelper.connection); DBHelper.connection.Open();
SqlDataReader reader=command.ExecuteReader(); while(reader.Read()){
string gradeName=(string)reader[0]; cboGrade.Items.Add(gradeName); }
reader.Close(); }catch(Exception ex){
MessageBox.Show(ex.Message); }finally{
DBHelper.connection.Close(); } }
private void cboGrade_SelectedIndexChanged(object sender, EventArgs e) {
if (cboGrade.Text.Trim() != \) {
int gradeId = -1;
string sql = string.Format(\GradeName='{0}'\,cboGrade.Text);
SqlCommand command = new SqlCommand(sql, DBHelper.connection); try {
DBHelper.connection.Open();
SqlDataReader reader = command.ExecuteReader(); if (reader.Read()) {
gradeId = (int)reader[0]; }
reader.Close();
}
catch (Exception ex) {
MessageBox.Show(\操作数据库出错\); Console.WriteLine(ex.Message); } finally {
DBHelper.connection.Close(); }
sql = \ +gradeId; command.CommandText = sql; try {
DBHelper.connection.Open();
SqlDataReader reader = command.ExecuteReader();
string className = \; cboClass.Items.Clear(); while (reader.Read()) {
className = (string)reader[\]; cboClass.Items.Add(className); }
reader.Close(); }
catch (Exception ex) {
MessageBox.Show(\操作数据库出错\); Console.WriteLine(ex.Message); } finally {
DBHelper.connection.Close(); } } }
private void txtStudentPassword_TextChanged(object sender, EventArgs e) {
} }
AdminTeacherForm.cs (教师信息添加窗体)
if (TianJia()) { try {
SqlCommand command = new SqlCommand(sql, DBHelper.connection); DBHelper.connection.Open();
int result = command.ExecuteNonQuery(); if (result != 1) {
MessageBox.Show(\添加失败\, \输入提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); } else {
MessageBox.Show(\添加成功\, \输入提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
catch (Exception ex) {
MessageBox.Show(\操作数据库出错\, \输入提示\, MessageBoxButtons.OK, MessageBoxIcon.Information);
Console.WriteLine(ex.Message); } finally {
DBHelper.connection.Close(); } } }
新增教师信息→弹出窗口(教师信息添加)→Teacher表
保存按钮代码如下:
查询修改信息→学生信息→查询及删除信息(可以进行模糊查询)
正在阅读:
教务管理员操作流程06-24
炼心05-29
郑州市人民政府关于印发郑州市旧城改造工作程序的通知05-01
自动化生产线安装与调试实训报告06-04
使用蓝胜EPS装饰线条需要注意的理念05-14
西方婚礼誓词英文02-11
电子商务对税收征管的影响与对策4800字05-05
历年考研数学一真题及答案(1987-2014) - 图文04-27
2018最新西师大版小学二年级下册数学全册教案(2018新教材)02-26
串口,按键,消息,定时器04-24
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 教务
- 流程
- 管理员
- 操作
- 超高支模施工方案
- 七五普法专题活动练习题(556)
- ansysworkbench菜单翻译
- 广告牌施工方案
- 最新人教版小学语文四年级上册语文词语练习
- 佛山联合验收办事指南
- 迈普MyPower S3000系列以太网交换机配置手册
- 性格摘要
- 产房应急演练
- 17建设工程设备采购合同0518
- 2015高考二模 内蒙古包头一中2015届高三第二次模拟考试文科综合
- 简阳市新市学区2012-2013学年七年级上期中考试数学试题
- 15.危险性较大工程清单(附录A)
- 十一五园区发展调研
- 人教版《道德与法治》七年级上册(部编版)最新精品教案6.1 走近老
- 人教版物理八年级下学期期中试题(含解析)
- 2018年湖南省娄底市中考数学试卷(含答案解析版)
- 英语词汇学各章节重点、词汇解释、阅读及试卷
- 护士执业资格考试--练习题-36
- 金属杂质对多晶铸锭的影响