Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
If e.PostValues.Count = 0 Then '分组统计设置
wb.AddForm("","form1","sjzd.htm")
With wb.AddInputGroup("form1","ipg1","选择学期")
.AddSelect("学期","学期","|17秋|18春")
End With
With wb.AddButtonGroup("form1","btg1",False)
.Add("btn1", "确定", "submit")
.Add("btn1", "返回").Attribute = ""
End With
Else '显示统计结果
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
Dim pr As DataRow = DataTables("试卷征订").sqlfind("学校名称 ='" & dr("group") & "' and 学期 = '" & e.PostValues("学期") & "'")
If pr Is Nothing
pr = DataTables("试卷征订").AddNew()
pr("学校名称") = dr("group")
pr("学期")= e.PostValues("学期")
pr.save()
End If
wb.AppendCookie("sjzdid",pr("_Identify"))
MessageBox.show(e.Cookies("sjzdid"))
With wb.AddInputGroup("","ipg2","输入各年级试卷数")
.AddInput("一年级","一年级","number").Value = pr("一年级")
.AddInput("二年级","二年级","number").Value = pr("二年级")
.AddInput("三年级","三年级","number").Value = pr("三年级")
.AddInput("四年级","四年级","number").Value = pr("四年级")
.AddInput("五年级","五年级","number").Value = pr("五年级")
.AddInput("六年级","六年级","number").Value = pr("六年级")
.AddInput("六年级","六年级","number").Value = pr("六年级")
.AddInput("七年级","七年级","number").Value = pr("七年级")
.AddInput("八年级","八年级","number").Value = pr("八年级")
.AddInput("九年级","九年级","number").Value = pr("九年级")
End With
With wb.AddButtonGroup("","btg1", False) '水平排列
.Add("btn6", "确定保存","submit","sjzdsave.htm")
.Add("btn7", "返回列表","button","xlist.htm")
End With
End If
e.WriteString(wb.Build)
sjzdsave:
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim dr As DataRow
dr = DataTables("试卷征订").sqlfind("[_Identify] = '" & e.Cookies("sjzdid") & "'")
Dim nms() As String = {"一年级","二年级","三年级","四年级","五年级","六年级","七年级","八年级","九年级"} '不能为空的列名数组
messagebox.show(e.PostValues("七年级"))
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr(nm) = e.PostValues(nm)
End If
Next
dr.Save()
'wb.AddToast("","t1", "已经保存",0).Msec= 1500
With wb.AddMsgPage("","msgpage","提交申请成功", "教研室已查收")
.icon = "success" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
老师,请问上面代码保存不起一年级,二年级各年级数据呢