老师,帮我看一下代码怎么改,我输入“出勤人数”和请假人员, 保存后 后台数据的 出清人数 请假人员没有内容
With wb.AddInputGroup("form1","ipg1","客户资料")
.AddInput("出勤人数","出勤人数","number").Attribute=" style='border-left:1px solid #CCC';"
With .AddInputCell("ic4") '
.AddLabel("lsj","请假人员",0) '
.AddInput("sj","text",1).Attribute=" style='border-left:1px solid #CCC';read;"
.AddVcodeButton("hym","请选择人员",2).Attribute=""" '隐藏page1显示page2
End With
Dim nms() As String = {"出勤人数","sj"} '不能为空的列名数组
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 = New String() {"出勤人数","sj"} '重新定义了nms数组,增加了两列.
Dim dr As DataRow = dt.AddNew
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr(nm) = e.PostValues(nm)
End If
Next
dr.Save
e.WriteString(wb.Build)