以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  移动开发中多个选择项 怎么不能实现并存呢?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=132240)

--  作者:李孝春
--  发布时间:2019/3/17 22:44:00
--  移动开发中多个选择项 怎么不能实现并存呢?
发送人员没有显示出来,代码见下面红色部分  麻烦老师们指导下 谢谢!

图片点击可在新窗口打开查看此主题相关图片如下:22.png
图片点击可在新窗口打开查看
代码如下:

Case "AddNew.htm"
        If e.PostValues.Count = 0 Then
            wb.AddForm("","form1","addnew.htm")
            With wb.AddInputGroup("form1","ipg1","信息编辑")
                .AddInput("信息时间","信息时间","Date") \'前一个"姓名"是ID,后一个"姓名"是标题
                \' .AddInput("信息类别","信息类别","text")
                Dim filter1 As String = "表名 = \'信息列表\' and 列名 = \'信息类别\' and 停用 = false"
                Dim fdr1 As DataRow = DataTables("列项设置").Find(filter1)
                If fdr1 IsNot Nothing Then
                    Dim abc1 As String=fdr1("下拉选项").replace(",", "|")
                    .AddSelect("信息类别","信息类别",abc1)
                End If
                Dim filter As String = "表名 = \'干警信息\' and 列名 = \'备注\' and 停用 = false"
                Dim fdr As DataRow = DataTables("列项设置").Find(filter)
                If fdr IsNot Nothing Then
                    Dim abc As String=fdr("下拉选项").replace(",", "|")
                    .AddSelect("发送对象","发送对象",abc)
                End If
                Dim filter2 As String = "表名 = \'干警信息\' and 列名 = \'姓名\' and 停用 = false"
                Dim fdr2 As DataRow = DataTables("列项设置").Find(filter2)
                If fdr2 IsNot Nothing Then
                    Dim abc2 As String=fdr2("下拉选项").replace(",", "|")
                    .AddSelect("发送人员","发送人员",abc2)
                End If
                .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   
[此贴子已经被作者于2019/3/17 22:44:21编辑过]

--  作者:有点甜
--  发布时间:2019/3/18 9:32:00
--  

改一下

 

                Dim filter2 As String = "表名 = \'干警信息\' and 列名 = \'姓名\' and (停用 = false or 停用 is null)"
                Dim fdr2 As DataRow = DataTables("列项设置").Find(filter2)
msgbox(1)
                If fdr2 IsNot Nothing Then
msgbox("进入了")
                    Dim abc2 As String=fdr2("下拉选项").replace(",", "|")
                    .AddSelect("发送人员","发送人员",abc2)
msgbox(abc2)
                End If

--  作者:李孝春
--  发布时间:2019/3/18 22:34:00
--  回复:(有点甜)改一下     &nbs...
msgbox(1)
只弹出了这个1,其它的没有弹出来 ,还得麻烦老师指导一下啦

--  作者:有点蓝
--  发布时间:2019/3/18 22:53:00
--  
Dim filter2 As String = "表名 = \'干警信息\' and 列名 = \'姓名\' and (停用 = false or 停用 is null)"
Dim fdr2 As DataRow = DataTables("列项设置").Find(filter2)

说明没有符合条件的数据

--  作者:李孝春
--  发布时间:2019/3/18 23:05:00
--  回复:(有点蓝)Dim filter2 As String = "表名 = '干...
Dim filter2 As String = "姓名 <>\'\'"
                Dim fdr2 As DataRow = DataTables("干警信息").Find(filter2)
                msgbox(1)
                If fdr2 IsNot Nothing Then
                    msgbox("进入了")
                    Dim abc2 As String=fdr2("姓名")
                    .AddSelect("发送人员","发送人员",abc2)
                    msgbox(abc2)
                End If

上述代码实现了一个姓名的弹出,但是不能对应弹出多个符合条件的姓名值

--  作者:有点蓝
--  发布时间:2019/3/18 23:08:00
--  
多个什么条件?到底对自己的数据了解吗!
--  作者:李孝春
--  发布时间:2019/3/18 23:13:00
--  回复:(有点蓝)多个什么条件?到底对自己的数据了解...
Dim filter2 As String = "姓名 <>\'\'"
                Dim fdr2 As DataRow = DataTables("干警信息").Find(filter2)
                msgbox(1)
                If fdr2 IsNot Nothing Then
                    msgbox("进入了")
                    Dim abc2 As String=fdr2("姓名")
                    .AddSelect("发送人员","发送人员",abc2)
                    msgbox(abc2)
                End If

姓名不等于空值的,数据有97个,这个.AddSelect只显示了第一个

--  作者:有点甜
--  发布时间:2019/3/19 11:26:00
--  

你要用 GetComboListString

 

http://www.foxtable.com/webhelp/scr/1435.htm