Dim wb As New weui
Select Case e.Path
Case "AddNew.htm"
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","addnew.htm")
With wb.AddInputGroup("form1","ipg1","信息编辑")
.AddInput("信息时间","信息时间","date") '前一个"姓名"是ID,后一个"姓名"是标题
.AddInput("信息类别","信息类别","text")
.AddInput("发送对象","发送对象",text)
.AddInput("发送人员","发送人员","text")
.AddSelect("发送平台","发送平台","移动短信|阿里云短信")
.AddInput("拟发送时间","拟发送时间","date")
End With
With wb.AddInputGroup("form1","ipg2","信息内容")
.AddTextArea("信息内容",10).Placeholder = "请输入500字以内的备注"
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "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 '必须返回
End If
Next
nms = New String() {"信息时间","信息类别","发送对象","发送人员","发送平台","拟发送时间","信息内容"} '重新定义了nms数组,增加了两列.
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
Functions.Execute("yidongduanzengjiagaozhi")
With wb.AddMsgPage("","msgpage","增加成功", "好好学习,天天向上") '生成成功提示页
.AddButton("btn1","继续增加","addnew.htm")
End With
e.WriteString(wb.Build)
End If
End Select
内部函数yidongduanzengjiagaozhi代码
Dim br As Row=Tables("信息列表").Current
If br("信息内容") <>"" Then
Dim Vals As List(of String)
If br("发送人员") IsNot Nothing Then
Dim filter As String = "1=2"
For Each s As String In br("发送人员").split(",")
filter = filter & " or [姓名] like '%" & s & "%' "
Next
Vals = DataTables("干警信息").GetValues("姓名",filter )
'MessageBox.Show("woshishui")
Else If br("发送对象") IsNot Nothing Then
Dim filter As String = "1=2"
For Each s As String In br("发送对象").split(",")
filter = filter & " or [备注] like '%" & s & "%' "
Next
Vals = DataTables("干警信息").GetValues("姓名",filter )
End If
For i As Integer = 0 To Vals.Count - 1
Dim dr As DataRow = DataTables("告知内容").AddNew()
dr("信息时间") = Date.Now
dr("姓名") = Vals(i)
dr("信息内容")=br("信息内容")
dr("是否告知")= "否"
dr("发送对象")= br("发送对象")
dr("发送人员")= br("发送人员")
dr("发送平台")= br("发送平台")
dr("信息类别")= br("信息类别")
dr("拟发送时间")= br("拟发送时间")
Next
End If
已通过取消内部函数,然后直接在信息列表中去写事件代码
Select Case e.DataCol.Name
Case "信息内容"
If e.DataRow("信息内容") <>"" Then
Dim Vals As List(of String)
If e.DataRow("发送人员") <>"" Then
Dim filter As String = "1=2"
For Each s As String In e.DataRow("发送人员").split(",")
filter = filter & " or [姓名] like '%" & s & "%' "
Next
Vals = DataTables("干警信息").GetValues("姓名",filter )
'MessageBox.Show("发送人员 & Vals")
Else If e.DataRow("发送对象") <>"" Then
Dim filter As String = "1=2"
For Each s As String In e.DataRow("发送对象").split(",")
filter = filter & " or [备注] like '%" & s & "%' "
Next
Vals = DataTables("干警信息").GetValues("姓名",filter )
'MessageBox.Show("发送对象 & Vals")
End If
For i As Integer = 0 To Vals.Count - 1
Dim dr As DataRow = DataTables("告知内容").AddNew()
dr("信息时间") = Date.Now
dr("姓名") = Vals(i)
dr("信息内容")=e.DataRow("信息内容")
dr("是否告知")= "否"
dr("发送对象")= e.DataRow("发送对象")
dr("发送人员")= e.DataRow("发送人员")
dr("发送平台")= e.DataRow("发送平台")
dr("信息类别")= e.DataRow("信息类别")
dr("拟发送时间")= e.DataRow("拟发送时间")
Next
End If
End Select
如下解决了问题!
有没有办法实现移动端开发时候实现
此主题相关图片如下:5.png
如下多选框效果呢?