……
Dim hpr = DataTables("报餐").Find("[姓名] = '" & e.PostValues("姓名") & "' and [工号] = '" & e.PostValues("工号") & "'and [报餐日期] = '" & e.PostValues("报餐日期") & "'")
MessageBox.show("[姓名] = '" & e.PostValues("姓名") & "' and [工号] = '" & e.PostValues("工号") & "'and [报餐日期] = '" & e.PostValues("报餐日期") & "'")
If hpr IsNot Nothing Then '在这里,再处理你网页提交过来的值
msgbox(1)
If e.values("早餐") = True Then
If hpr("早餐") = True Then
msgbox(2)
With wb.AddMsgPage("","msgpage2","提交失败", "早餐已经订过!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return "" '必须返回
Else
hpr("早餐") = True
End If
End If
If e.values("中餐") = True Then
msgbox(3)
If hpr("中餐") = True Then
msgbox(4)
With wb.AddMsgPage("","msgpage2","提交失败", "中餐已经订过!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return "" '必须返回
Else
hpr("中餐") = True
End If
End If
If e.values("晚餐") = True Then
msgbox(5)
If hpr("晚餐") = True Then
msgbox(6)
With wb.AddMsgPage("","msgpage2","提交失败", "晚餐已经订过!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return ""'必须返回
Else
hpr("晚餐") = True
End If
End If
Else
msgbox(7)
Dim dr As DataRow = DataTables("报餐").AddNew() '新增一行,录入各列数据
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr(nm) = e.PostValues(nm)
End If
Next
……