老师我网页逻辑如下:
先生成列表,生成下面页面:
此主题相关图片如下:11.jpg
点击出场登记,生成下面页面:
此主题相关图片如下:22.jpg
然后修改出场日期,点击保存不了,哪儿问题呢,代码如下:
Dim e As object = args(0)
'Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim dr As DataRow = DataTables("实名制管理").SQLFind("项目名称 = '" & _Userxmmc & "' and 姓名 = '" & e.getvalues("name") & "'")
If dr IsNot Nothing Then
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","ReNamejccx_name.htm")
With wb.AddInputGroup("form1","工人信息","工人信息")
With .AddInput("姓名","姓  名","Text")
.Value = dr("姓名")
.Readonly= True
End With
With .AddInput("身份证号码","身份证号","number")
.Value = dr("身份证号码")
.Readonly= True
End With
With .AddInput("家庭地址","家庭地址","Text")
.Value = dr("家庭地址")
.Readonly= True
End With
With .AddInput("进场日期","进场日期","date")
.Value = dr("进场日期")
.Readonly= True
End With
.AddInput("退场日期","退场日期","date")
.AddInput("退场登记人","退场登记人","Text")
.AddInput("退场登记日期","退场登记日期","date")
End With
With wb.AddButtonGroup("form1","btg2", True)
.Add("btn1", "重新查询", "", "ReNamejccx.htm")
.Add("btn2", "保  存", "submit")
End With
e.WriteString(wb.Build)
Else
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 Nothing '必须返回
End If
Next
nms = New String() {"退场日期","退场登记人","退场登记日期"} '重新定义了nms数组,增加了两列.
Dim ds As DataRow = DataTables("实名制管理").SQLFind("项目名称 = '" & _Userxmmc & "' and 姓名 = '" & e.getvalues("name") & "'")
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
ds(nm) = e.PostValues(nm)
End If
Next
ds.save()
'保存并生成增加成功提示页面
With wb.AddMsgPage("","msgpage","保存成功", "你是否继续修改其他人员退场信息") '生成成功提示页
.AddButton("btn2","返回首页","default.htm")
.AddButton("btn1","继续修改","ReNamejccx.htm")
End With
e.WriteString(wb.Build)
End If
End If