录分设置:
Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
wb.AddPageTitle("","pageheader","自测考试录入","请依次选填")
wb.AddForm("","form1","cjbiao.htm")
With wb.AddInputGroup("form1","ipg1","")
.AddSelect("学期","学期",DataTables("自测成绩").SQLGetComboListString("学期","教师身份证= '" & e.Cookies("username") & "'","考试日期 desc"))
.AddSelect("bj","班级",DataTables("自测成绩").SQLGetComboListString("班级","教师身份证= '" & e.Cookies("username") & "'","考试日期 desc"))
.AddSelect("km","科目",DataTables("自测成绩").SQLGetComboListString("科目","教师身份证= '" & e.Cookies("username") & "'","考试日期 desc"))
.Addselect("ksmc","考试名称",DataTables("自测成绩").SQLGetComboListString("考试名称","教师身份证= '" & e.Cookies("username") & "'","考试日期 desc"))
End With
With wb.AddButtonGroup("form1","btg1",False)
.Add("btn1", "确定", "submit")
.Add("btn1", "返回","","jwzrdefault.htm")
End With
e.WriteString(wb.Build)
录分表、统计表
Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
wb.AddPageTitle("","pageheader","学生成绩表册",e.postvalues("学期") & ">" & e.postvalues("bj") & ">" & e.postvalues("km") & ">" & e.PostValues("ksmc"))
wb.AddToast("","t1", "正在上传",1) '定义提示
wb.AddForm("","form1","cjsave.htm").attribute= """
With wb.AddButtonGroup("form1","btg1", False) '水平排列
.Add("btn6", "保存","submit")
.Add("btn7", "返回","button","tfsz.htm")'.Attribute = ""
End With
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
Dim bjf As DataRow =DataTables("自测成绩").sqlfind("学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'")
If bjf IsNot Nothing
If bjf("B卷满分")>0
Dim xss As List(Of DataRow) =DataTables("自测成绩").sqlselect("学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'","","折总 desc,姓名")
For n As Integer = 0 To xss.Count - 1 '遍历所有行
If n > 0 AndAlso xss(n)("折总") = xss(n-1)("折总") Then '如果总分和上一行相同
xss(n)("折序") = xss(n-1)("折序") '则排名等于上一行
Else
xss(n)("折序") = n + 1 '设置排名
End If
Next
wb.InsertHTML("form1", "<Table border=1 cellspacing=0 style='width:100%;text-align:center;'><tr><td style='text-align:center;font-size: 15pt;strong'>姓名</td><td style='text-align:center;font-size: 15pt'>A卷</td><td style='text-align:center;font-size: 15pt'>B卷</td><td style='text-align:center;font-size: 15pt'>折总</td><td style='text-align:center;font-size: 15pt'>折序</td></tr>")
For Each xs As DataRow In xss
wb.insertHtml("form1", "<tr><td style='width:20%;font-size:15pt' >" & xs("姓名") & "</td><td style='width:20%'><input style='width:95%;font-size: 15pt; border:none;text-align:center;' type='number' name='txt1_" & xs("_Identify") & "' max= '" & xs("A卷满分") & "' min ='0' value='" & iif(xs("A卷")>0, xs("A卷"),"") & "' /></td><td style='width:20%'><input style='width:95%;font-size:15pt;border:none;text-align:center;' type= 'number' name='txt2_" & xs("_Identify") & "' max= '" & xs("B卷满分") & "' min ='0' value='" & iif(xs("B卷")>0,xs("B卷"),"") & "' /></td><td style='width:20%;font-size:15pt' >" & iif(xs("折总")>0, xs("折总"),"") & "</td></td><td style='width:20%;font-size:15pt' >" & iif(xs("折序")>0, xs("折序"),"") & "</td></tr>")
Next
Dim pja As Double = DataTables("自测成绩").SQLCompute("avg(A卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "' and 总分>0")
Dim pjb As Double = DataTables("自测成绩").SQLCompute("avg(B卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 总分>0")
Dim pjzf As Double = DataTables("自测成绩").SQLCompute("avg(折总)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 总分>0")
wb.insertHtml("form1", "<tr><td style='width:20%;font-size:15pt' >平均分</td><td style='width:20%;font-size:15pt' >" & Format(pja,"0.00") & "</td><td style='width:20%;font-size:15pt' >" & Format(pjb,"0.00") & "</td><td style='width:20%;font-size:15pt' >" & Format(pjzf,"0.00") & "</td></td><td style='width:20%;font-size:15pt' ></td></tr>")
wb.insertHtml("form1", "</Table>")
Else
Dim xss As List(Of DataRow) =DataTables("自测成绩").sqlselect("学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'","","总分 desc,姓名")
For n As Integer = 0 To xss.Count - 1 '遍历所有行
If n > 0 AndAlso xss(n)("总分") = xss(n-1)("总分") Then '如果总分和上一行相同
xss(n)("总序") = xss(n-1)("总序") '则排名等于上一行
Else
xss(n)("总序") = n + 1 '设置排名
End If
Next
wb.InsertHTML("form1", "<Table border=1 cellspacing=0 style='width:100%;text-align:center;'><tr><td style='text-align:center;font-size: 15pt;strong'>姓名</td><td style='text-align:center;font-size: 15pt'>A卷</td><td style='text-align:center;font-size: 15pt'>总分</td><td style='text-align:center;font-size: 15pt'>总序</td></tr>")
For Each xs As DataRow In xss
wb.insertHtml("form1", "<tr><td style='width:20%;font-size:15pt' >" & xs("姓名") & "</td><td style='width:20%'><input style='width:95%;font-size: 15pt; border:none;text-align:center;' type='number' name='txt1_" & xs("_Identify") & "' max= '" & xs("A卷满分") & "' min ='0' value='" & iif(xs("A卷")>0, xs("A卷"),"") & "' /><td style='width:20%;font-size:15pt' >" & iif(xs("总分")>0, xs("总分"),"") & "</td></td><td style='width:20%;font-size:15pt'>" & iif(xs("总序")>0, xs("总序"),"") & "</td></tr>")
Next
Dim pja As Double = DataTables("自测成绩").SQLCompute("avg(A卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "' and 折总>0")
''Dim pjb As Double = DataTables("自测成绩").SQLCompute("avg(B卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 折总>0")
Dim pjzf As Double = DataTables("自测成绩").SQLCompute("avg(折总)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 折总>0")
wb.insertHtml("form1", "<tr><td style='width:25%;font-size:15pt' >平均分</td><td style='width:25%;font-size:15pt' >" & Format(pja,"0.00") & "</td><td style='width:25%;font-size:15pt' >" & Format(pjzf,"0.00") & "</td></td></td><td style='width:25%;font-size:15pt' ></td></tr>")
wb.insertHtml("form1", "</Table>")
End If
End If
e.WriteString(wb.Build)
录分保存
Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
Dim bjhc As String = trim(e.PostValues("xd") & e.PostValues("xj") & e.PostValues("bj"))
wb.AddPageTitle("","pageheader","学生成绩保存")
wb.AddForm("","form1","")
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
For Each key As String In e.Values.Keys
Dim jlh As String = key.split("_")(1)
Dim fdr As DataRow = DataTables("自测成绩").sqlfind("_Identify = '" & jlh & "'")
fdr("A卷") = val(e.values("txt1_" & jlh))
fdr("B卷") = val(e.values("txt2_" & jlh))
fdr("折总")=val(e.values("txt1_" & jlh))*val(fdr("A卷折率"))+ val(e.values("txt2_" & jlh))*val(fdr("B卷折率"))
fdr("总分")= val(e.values("txt1_" & jlh)) +val(e.values("txt2_" & jlh))
fdr.save()
Next
With wb.AddButtonGroup("form1","btg1", False) '水平排列
.Add("btn6", "保存","submit")
.Add("btn7", "返回","button").Attribute = ""
End With
wb.AppendHTML("<script src='./lib/order.js'></script>")
e.WriteString(wb.Build)
请问老师,上面三个代码如何save这一段并在第二段中实现保存后刷新cjbiao,这样可保存后就刷新统计数据并继续录入,谢谢