文档介绍:该【教师管理操作流程 】是由【花双韵芝】上传分享,文档一共【6】页,该文档可以免费在线阅读,需要了解更多关于【教师管理操作流程 】的内容,可以使用淘豆网的站内搜索功能,选择自己适合的文档,以下文字是截取该文章内的部分文字,如需要获得完整电子版,请下载此文档到您的设备,方便您编辑和打印。教师管理操作流程
1、使用Teacher账号登岸——教师管理系统
代码地区:
if(loginType=="教师")
{
stringsql=("selectcount(*)fromteacherwhereLoginId='{0}'AND
LoginPwd='{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=(
no=(
name=(
int)reader["StudentId"];
string)reader["StudentNo"];
string)reader["StudentName"];
}
( );
}
catch(Exceptionex)
{
();
}
finally
{
( );
}
if(TianJia( ))
{
if(==(id)&&==no&&
==name)
{
string
string
string
string
studentName=;
sdudentNo=;
subject=;
score=;
intclassId=GetClassId( );
stringstudentId=;
stringsql1=("insertinto
Score(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)
{
string
sql=
"selectgradeNamefromGrade"
;
try
{
SqlCommandcommand=newSqlCommand(sql,);
( );
SqlDataReaderreader=( );
while(( ))
{
stringgradeName=(string)reader[0];
}
( );
}
catch(Exceptionex)
{
();
}
finally
{
( );
}
string
sql1=
"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
{
("保留失败","输入提示",,
);
}