Foxtable(狐表)用户栏目专家坐堂 → 编译错误


  共有2145人关注过本帖树形打印复制链接

主题:编译错误

帅哥哟,离线,有人找我吗?
yifan3429
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2466 积分:22761 威望:0 精华:0 注册:2011/3/29 17:14:00
编译错误  发帖心情 Post By:2018/4/7 23:26:00 [只看该作者]


Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI '定义一个基于weui框架的网页生成器
Select Case e.Path
    Case "kfsx.htm"
        Dim bm As String
        Dim gw As String
        Dim name As String
        Dim userid = Functions.Execute("验证函数",e,"kfsx.htm")
        If userid > "" Then
            wb.AppendCookie("userid",userid) '将用户名和密码写入cookie
            Dim wxdr As DataRow =  DataTables("users").SQLFind("userid='" & userid & "'")
            If wxdr IsNot Nothing Then
                gw =  wxdr("position")
                name = wxdr("name")
                Dim wxdr1 As DataRow = DataTables("departments").SQLFind("id='" & wxdr("department") & "'")
                If wxdr1 IsNot Nothing Then
                    bm= wxdr1("name")
                End If
                
                'e.WriteString(name & userid & "USERID获取成功" & gw & bm)
                ''------------------------------------------------------------------------------------------------------------------------------
                
                'wb.AddForm("","form1","list.htm")
                With wb.AddInputGroup("form1","ipg1","数据筛选")
                    .AddSelect("product","客户类别","|A类客户|B类客户|C类客户")
                    .AddInput("startdate","开始日期","date")
                    .AddInput("enddate","结束时间","date")
                End With
                With wb.AddButtonGroup("form1","btg1",True)
                    .Add("btn1", "确定", "submit")
                End With
            Case "list.htm"
                '合成条件
                Dim flt As String
                If e.GetValues.ContainsKey("unfilter") Then '如果有unfilter参数,则清除cookie
                    wb.ClearCookie()
                ElseIf e.PostValues.Count > 0 Then '如果是filter.htm访问,则根据用户输入合成条件表达式
                    If e.PostValues.ContainsKey("product") Then
                        flt = "客户等级 = '" & e.PostValues("product") & "'" '合成条件
                        wb.AppendCookie("product", e.PostValues("product")) '将值写入cookie中
                    Else
                        wb.DeleteCookie("product") '删除cookie
                    End If
                    If e.PostValues.ContainsKey("startdate") Then
                        If flt > "" Then
                            flt = flt & " and "
                        End If
                        flt = flt & "日期 >= '" & e.PostValues("startdate") & "'"
                        wb.AppendCookie("startdate", e.PostValues("startdate"))
                    Else
                        wb.DeleteCookie("startdate")
                    End If
                    If e.PostValues.ContainsKey("enddate") Then
                        If flt > "" Then
                            flt = flt & " and "
                        End If
                        flt = flt & "日期 <= '" & e.PostValues("enddate") & "'"
                        wb.AppendCookie("enddate", e.PostValues("enddate"))
                    Else
                        wb.DeleteCookie("enddate")
                    End If
                Else '否则根据Cookie合成条件表达式
                    If e.Cookies.ContainsKey("product") Then
                        flt = "客户等级 = '" & e.Cookies("product") & "'"
                    End If
                    If e.Cookies.ContainsKey("startdate") Then
                        If flt > "" Then
                            flt = flt & " and "
                        End If
                        flt = flt & "日期 >= '" & e.Cookies("startdate") & "'"
                    End If
                    If e.Cookies.ContainsKey("enddate") Then
                        If flt > "" Then
                            flt = flt & " and "
                        End If
                        flt = flt & "日期 <= '" & e.Cookies("enddate") & "'"
                    End If
                End If
               
                        
                    End If
                End If
            End If
        End If
End Select
e.WriteString(wb.Build)
---------------------------
错误
---------------------------
编译错误:“Case”只能出现在“Select Case”语句内。



错误代码:Case "list.htm"
---------------------------
确定   
---------------------------
[此贴子已经被作者于2018/4/7 23:29:10编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/8 8:41:00 [只看该作者]

Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI '定义一个基于weui框架的网页生成器
Select Case e.Path
    Case "kfsx.htm"
        Dim bm As String
        Dim gw As String
        Dim name As String
        Dim userid = Functions.Execute("验证函数",e,"kfsx.htm")
        If userid > "" Then
            wb.AppendCookie("userid",userid) '将用户名和密码写入cookie
            Dim wxdr As DataRow =  DataTables("users").SQLFind("userid='" & userid & "'")
            If wxdr IsNot Nothing Then
                gw =  wxdr("position")
                name = wxdr("name")
                Dim wxdr1 As DataRow = DataTables("departments").SQLFind("id='" & wxdr("department") & "'")
                If wxdr1 IsNot Nothing Then
                    bm= wxdr1("name")
                End If
               
                'e.WriteString(name & userid & "USERID获取成功" & gw & bm)
                ''------------------------------------------------------------------------------------------------------------------------------
               
                'wb.AddForm("","form1","list.htm")
                With wb.AddInputGroup("form1","ipg1","数据筛选")
                    .AddSelect("product","客户类别","|A类客户|B类客户|C类客户")
                    .AddInput("startdate","开始日期","date")
                    .AddInput("enddate","结束时间","date")
                End With
                With wb.AddButtonGroup("form1","btg1",True)
                    .Add("btn1", "确定", "submit")
                End With
            End If
        End If
    Case "list.htm"
        '合成条件
        Dim flt As String
        If e.GetValues.ContainsKey("unfilter") Then '如果有unfilter参数,则清除cookie
            wb.ClearCookie()
        ElseIf e.PostValues.Count > 0 Then '如果是filter.htm访问,则根据用户输入合成条件表达式
            If e.PostValues.ContainsKey("product") Then
                flt = "客户等级 = '" & e.PostValues("product") & "'" '合成条件
                wb.AppendCookie("product", e.PostValues("product")) '将值写入cookie中
            Else
                wb.DeleteCookie("product") '删除cookie
            End If
            If e.PostValues.ContainsKey("startdate") Then
                If flt > "" Then
                    flt = flt & " and "
                End If
                flt = flt & "日期 >= '" & e.PostValues("startdate") & "'"
                wb.AppendCookie("startdate", e.PostValues("startdate"))
            Else
                wb.DeleteCookie("startdate")
            End If
            If e.PostValues.ContainsKey("enddate") Then
                If flt > "" Then
                    flt = flt & " and "
                End If
                flt = flt & "日期 <= '" & e.PostValues("enddate") & "'"
                wb.AppendCookie("enddate", e.PostValues("enddate"))
            Else
                wb.DeleteCookie("enddate")
            End If
        Else '否则根据Cookie合成条件表达式
            If e.Cookies.ContainsKey("product") Then
                flt = "客户等级 = '" & e.Cookies("product") & "'"
            End If
            If e.Cookies.ContainsKey("startdate") Then
                If flt > "" Then
                    flt = flt & " and "
                End If
                flt = flt & "日期 >= '" & e.Cookies("startdate") & "'"
            End If
            If e.Cookies.ContainsKey("enddate") Then
                If flt > "" Then
                    flt = flt & " and "
                End If
                flt = flt & "日期 <= '" & e.Cookies("enddate") & "'"
            End If
        End If
End Select
e.WriteString(wb.Build)

 回到顶部