Dim d1122 As DataRow = DataTables("学生信息登记").sqlfind("身份证号='" & e.PostValues("身份证号") & "'")
If d1122 IsNot Nothing Then
Dim nms() As String = {"学校","班级","亲属姓名","学生姓名","是否有症状","是否外出"} '不能为空的列名数组
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then '生成错误提示页
With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.Writestring(wb.Build)
Return "" ' '必须返回
End If
Next
nms = {"学校","班级","亲属姓名","学生姓名","与学生关系","身份证号","联系电话","现居住地","居住类型","班主任姓名","是否有症状","是否外出"} '不能为空的列名数组
Dim dr As DataRow = DataTables("学生二次信息登记").sqlAddNew()
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr(nm) = e.PostValues(nm)
End If
Next
dr("提交日期")=Format(Date.now, "d")
dr("提交时间")=Format(Date.now, "T")
dr.save()
With wb.AddMsgPage("","msgpage","增加成功", "战疫情,保健康!") '生成成功提示页
.AddButton("btn1","谢谢合作,返回继续添加!","xueshengdengji.htm")
End With
Else
Dim nms() As String = {"学校","学生姓名","亲属姓名","班级","与学生关系","性别","年龄","身份证号","联系电话","现居住地","户籍地址","社区管控人员","管控人员电话","是否外出","是否出省","外出地点","外出时间","返回时间","外出交通工具","是否有症状","班主任姓名","返回交通工具","提交日期","居住类型","提交时间"} '重新定义了nms数组,增加了两列.
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then '生成错误提示页
With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")