以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  保存选择  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=106688)

--  作者:刘林
--  发布时间:2017/9/13 21:11:00
--  保存选择
Dim e As RequestEventArgs = args(0)
Dim  wb As New weui
Dim dr As DataRow
Dim nms As String()
dr = DataTables("用户").sqlfind("[_Identify] = \'" & e.Cookies("jssfzh") & "\'")
nms = new 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 true\'必须返回
    End If
Next
If e.postvalues("角色")="班主任"
    nms = new 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 true\'必须返回
        End If
    Next
End If

If e.postvalues("group")<> dr("group")
    With wb.AddMsgPage("","msgpage","特别提示", "是否确定调出该教师")
        .icon = "Warn" \'改变图标
        .AddButton("btn1","是")
        .AddButton("btn2","否").Attribute = ""
        e.WriteString(wb.Build)
        Return true\'必须返回
    End With
End If



dr("group")= e.postvalues("group")
dr("角色")= e.postvalues("角色")
If e.postvalues("角色")="班主任"
    dr("班级")= e.postvalues("学段") & e.postvalues("学级") & e.postvalues("班级")
Else
    dr("班级")= ""
End If
dr.Save()
\'wb.AddToast("","t1", "已经保存",0).Msec= 1500
With wb.AddMsgPage("","msgpage","保存信息成功", "")
    .icon = "success" \'改变图标
    .AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)


老师,我想做个选择,如果是则执行后面的保存,如果否则返回,现在是提示调用目标错误,请问这该如何写

--  作者:有点甜
--  发布时间:2017/9/13 22:13:00
--  

验证,不是这样做的,请参考这种做法

 

http://www.foxtable.com/mobilehelp/scr/0104.htm

 

http://www.foxtable.com/mobilehelp/scr/0080.htm