教师管理操作流程.docx
《教师管理操作流程.docx》由会员分享,可在线阅读,更多相关《教师管理操作流程.docx(9页珍藏版)》请在冰豆网上搜索。
![教师管理操作流程.docx](https://file1.bdocx.com/fileroot1/2023-2/1/a0c97f7f-21e2-4a85-a6e1-41b47133b6fb/a0c97f7f-21e2-4a85-a6e1-41b47133b6fb1.gif)
教师管理操作流程
Documentnumber:
BGCG-0857-BTDO-0089-2022
教师管理操作流程
教师管理操作流程
1、使用Teacher账号登陆——教师管理系统
代码区域:
if(loginType=="教师")
{
stringsql=("selectcount(*)fromteacherwhereLoginId='{0}'ANDLoginPwd='{1}'",loginId,loginPwd);
try
{
SqlCommandcommand=newSqlCommand(sql,;
count=(int)();
if(count==1)
{
isValidUser=true;
}
else
{
index++;
if(index<=3)
{
message="用户名或密码不存在!
";
}
elseif(index>=3)
{
();
}
isValidUser=false;
}
}
catch(Exceptionex)
{
message=;
;
}
查询修改信息
查询教师基本信息(代码区域:
)
TeacherBaseFormteacherBaseForm=newTeacherBaseForm();
();
TeacherBaseForm(教师基本信息窗体)
查询及修改学生信息(代码区域:
)
UpdateStudentFormupdateStudentForm=newUpdateStudentForm();
();
(查询及修改信息窗体)
AddScoreForm(学生成绩录入窗体)
录入按钮代码:
stringsql=("selectStudentId,StudentNo,StudentNamefromStudentwhereStudentId='{0}'",;
try
{
SqlCommandcommand=newSqlCommand(sql,;
SqlDataReaderreader=();
while())
{
id=(int)reader["StudentId"];
no=(string)reader["StudentNo"];
name=(string)reader["StudentName"];
}
();
}
catch(Exceptionex)
{
;
}
finally
{
}
if(TianJia())
{
if==(id)&&==no&&==name)
{
stringstudentName=;
stringsdudentNo=;
stringsubject=;
stringscore=;
intclassId=GetClassId();
stringstudentId=;
stringsql1=("insertintoScore(StudentNo,Subject,SScore,SName,ClassId,StudentId)values('{0}','{1}','{2}','{3}','{4}',{5})",sdudentNo,subject,score,studentName,classId,studentId);
try
{
SqlCommandcommand=newSqlCommand(sql1,;
intresult=();
if(result!
=1)
{
("添加失败","输入提示",,;
}
else
{
("添加成功","输入提示",,;
}
}
catch(Exceptionex)
{
//("操作数据库出错!
","输入提示",,;
//;
;
}
finally
{
}
}
else
{
("您输入的学生在数据库中没有,请重新输入","输入提示",,;
}
}
}
privatevoidAddScoreForm_Load(objectsender,EventArgse)
{
stringsql="selectgradeNamefromGrade";
try
{
SqlCommandcommand=newSqlCommand(sql,;
SqlDataReaderreader=();
while())
{
stringgradeName=(string)reader[0];
}
();
}
catch(Exceptionex)
{
;
}
finally
{
}
stringsql1="selectSubjectNamefromSubject";
try
{
SqlCommandcommand=newSqlCommand(sql1,;
SqlDataReaderreader=();
while())
{
stringsubName=(string)reader[0];
}
();
}
catch(Exceptionex)
{
;
}
finally
{
}
}
privatevoidcboGrade_SelectedIndexChanged(objectsender,EventArgse)
{
if!
="")
{
intgradeId=-1;
stringsql=("selectGradeIdfromGradewhereGradeName='{0}'",;
SqlCommandcommand=newSqlCommand(sql,;
try
{
SqlDataReaderreader=();
if())
{
gradeId=(int)reader[0];
}
();
}
catch(Exceptionex)
{
("操作数据库出错");
;
}
finally
{
}
sql="SELECTClassNameFROMClassWHEREGradeId="+gradeId;
=sql;
try
{
SqlDataReaderreader=();
stringclassName="";
while())
{
className=(string)reader["ClassName"];
}
();
}
catch(Exceptionex)
{
("操作数据库出错");
;
}
finally
{
}
}
}
privatevoidtxtId_TextChanged(objectsender,EventArgse)
{
}
UpdateScoreForm(更新成绩窗体)
保存按钮代码:
DialogResultresult=("确实要将修改保存到数据库吗","输入提示",,;
if(result==
{
SqlCommandBuilderbuilder=newSqlCommandBuilder(dataAdapter);
(dataSet,"Score");
("保存成功","输入提示",,;
}
else
{
("保存失败","输入提示",,;
}