📄
字号:
end if
if len(trim(classno.value))=0 and len(trim(startno.value))=0 then
msgbox "对不起!请先输入班号或则学号!"
exit sub
end if
if len(rtrim(startno.value)) > 0 then
if len(rtrim(endno.value)) > 0 then
if rtrim(endno.value) < rtrim(startno.value) then
msgbox "终止学号必须不小于起始学号!"
exit sub
end if
else
endno.value = startno.value
end if
end if
if len(trim(startno.value)) > 0 then
call input_score("XH")
else
call input_Score("CLASS")
end if
end sub
'==============根据班号,学号进行成绩输入=====================
sub input_score(input_type)
'============================================================
'根据课程名,取得课程代码
for i = 0 to CourseCount -1
if rtrim(courseArray(0,i)) = rtrim(courseno.value) then
courseCode = courseNoArray(0,i)
exit for
end if
next
rds2.SQL = "Execute Insert_score " +"'"+yearno.value+"'," +"'"+termno.value+"',"+"'"+classno.value+"'," +"'"+courseno.value+"'," +"'"+scoreno.value+"'," +"'"+startno.value+"'," +"'"+endno.value+"'"
rds2.ExecuteOptions = 1
rds2.Refresh
rds1.SQL = " select 学号,姓名,'班号'='"+classno.value+"',学年,学期,成绩类型,'"+courseArray(0,i)+"'="+courseCode+" from score "
if input_type = "XH" then
rds1.sql = rds1.sql + " where rtrim(学号) >= '"+trim(startno.value)+"' and rtrim(学号) <= '"+trim(endno.value)+"' and rtrim(学年)='"+yearno.value+"' and rtrim(学期)='"+termno.value+"' and rtrim(成绩类型)='"+scoreno.value+"' order by convert(int,学号) asc"
end if
if input_type = "CLASS" then
rds1.sql = rds1.sql + " where 学号 in (select 学号 from student where rtrim(班号)='"+classno.value+"') and rtrim(学年)='"+yearno.value+"' and rtrim(学期)='"+termno.value+"' and rtrim(成绩类型)='"+scoreno.value+"' order by convert(int,学号) asc"
end if
rds1.ExecuteOptions = 1
rds1.refresh
end sub
'==============================================================
sub saveInput()
moveflag = true
if grid1.row > 0 then
grid1.row = grid1.row -1
else
grid1.row =grid1.row +1
moveflag = false
end if
grid1.Editactive = False
On Error resume next
RDS1.SubmitChanges
If Err.Number <> 0 Then
'RDS1.CancelUpdate
MsgBox "无法更新数据!"
else
rds2.SQL = "select * from class_course where 班号='"+classno.value+"' and 学年='"+yearno.value+"' and 学期 ='"+termno.value+"'and 课程号='"+courseCode+"'"
rds2.ExecuteOptions =1
rds2.Refresh
if rds2.recordset.recordcount > 0 then
'msgbox "已经有课程,不能增加!"
else
rds2.SQL = "Insert class_course values('"+classno.value+"','"+yearno.value+"','"+termno.value+"','"+courseCode+"','"+courseno.value+"')"
rds2.ExecuteOptions =1
rds2.Refresh
end if
End If
if moveflag then
grid1.row = grid1.row +1
else
grid1.row = grid1.row -1
end if
end sub
'==============================================================
sub cancelInput()
On Error Resume Next
RDS1.CancelUpdate
If Err.Number <> 0 Then
MsgBox "无法恢复原来数据!"
End If
Grid1.Rebind
end sub
'==============================================================
sub grid1_BeforeColEdit(colindex,keyascii,cancel)
if colindex<>6 then
msgbox "只能输入和修改成绩!"
cancel = true
end if
end sub
'=============================================================
sub backing()
if l_yn = true then
if l_update=false then
l_OK=msgbox ("数据已被修改,请先保存数据!",1,"提示窗口")
IF L_ok=1 then
'l_yn=false
exit sub
else
l_yn=false
history.go(-1)
end if
else
history.go(-1)
end if
else
history.go(-1)
end if
end sub
sub printing()
RDS1.recordset.movefirst
call free_printer(rds1.Recordset.recordcount,"学生课程成绩输入信息表")
end sub
</script>
<SCRIPT language=javascript>
function click() {
if (event.button==2) {
alert('对不起,禁止使用此功能^_^.')
}
}
document.onmousedown=click
</SCRIPT></body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -