📄 classdel.asp
字号:
<!--#include file="a25175_conn.asp"-->
<%
on error resume next
dim id
id=trim(request("id"))
if id="" then
response.write"<script>alert('不要错误操作!');location='addCLASS.asp'</script>"
else
db.CommandTimeout=0
db.Begintrans
strsql="select * from Class where id="&id
set rs=db.execute(strsql)
CLASSNAME=rs("CLASSNAME")
strsql="Delete from CLASS where id="&id
db.execute(strsql)
'-------------------------------------------------------------------------------------------
'-------------------------------------------------------------------------------------------
strsql="select * from UserInfo where Class1='"&CLASSNAME&"'"
set rs=db.execute(strsql)
do while not rs.eof
username=rs("username")
strsql="delete from USERInfo where username='"&username&"'"
db.execute(strsql)
strsql="delete from TEACHERSCORE where userID='"&username&"'"
db.execute(strsql)
strsql="delete from TEACHERNEW where TEACHERID='"&REALNAME&"' AND DEPART='"&DEPART&"'"
db.execute(strsql)
strsql="delete from TEACHER where TEACHERNAME='"&REALNAME&"' AND DEPART='"&DEPART&"'"
db.execute(strsql)
strsql="delete from TEACHERCOURSE where TEACHERNAME='"&REALNAME&"' AND DEPARTMENT='"&DEPART&"'"
db.execute(strsql)
rs.movenext
loop
'---------------删除班级的所有成员和评价的记录
'-------------------------------------------------------------------------------------------
strsql="Delete from UserInfo where Class1='"&CLASSNAME&"'"
db.execute(strsql)
if db.Errors.count=0 then
db.CommitTrans
response.write"<script>alert('删除班级成功,并删除班级的所有成员!');location='addCLASS.asp'</script>"
else
db.RollbackTrans
response.write"<script>alert('删除班级失败!');location='addCLASS.asp'</script>"
end if
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -