以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  判断语句问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=151880)

--  作者:刘林
--  发布时间:2020/7/6 16:42:00
--  判断语句问题
\'\'\'
Dim e As RequestEventArgs = args(0)
Dim path As String = "foxtableAppTest"
Dim wb As new weui
wb.AppendHTML("<meta charset=\'utf-8\'>",True)
wb.appendHTML("<meta name=\'viewport\' c />",True)
wb.appendHTML("<script src=\'../mui/js/mui.min.js\'></script>",True)
wb.appendHTML("<script Type=\'text/javascript\' charset=\'utf-8\'>mui.init();</script>",True)
wb.AppendHTML("<script type=\'text/javascript\' src=\'/" & path & "/js/common.js\'></script>", True)
wb.AppendHTML("<link rel=\'stylesheet\' href=\'/" & path & "/css/common.css\' Type=\'text/css\' charset=\'utf-8\'/>", True)
wb.appendHTML("<style>.fox_page_title{color:white}</style>",True)
wb.appendHTML("<style>.fox_page_subtitle{color:white;}</style>",True)
wb.appendHTML("<style>.fox_page_header{background-color:dodgerblue;}</style>",True)
wb.appendHTML("<style>.weui_label{color:dodgerblue;}</style>",True)
wb.appendHTML("<style>h5,p{margin:8px 16px;}</style>",True)
wb.AddPageTitle("","ph1","新生报名","请扫描学校给定的报名码")
wb.AddForm("","form1","bmxx.htm")
With wb.AddInputGroup("form1","ipg1","")
    Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = \'" & e.Cookies("username") & "\'")
    Dim In1 = .AddInput("身份证号","身份证号:","Text")
    In1.readonly = True
    In1.value = dr("身份证号")
    Dim In2= .AddInput("学生姓名","学生姓名:","Text")
    In2.readonly = True
    In2.value = dr("姓名")
    messagebox.show(dr("姓名"))
    Dim dr1 = DataTables("学生信息").sqlfind("身份证件号 = \'" & e.Cookies("username") & "\'")
    messagebox.show(dr("姓名"))
    If dr1 IsNot Nothing And dr1("申读学校")>"" And dr1("申读班级")>""
        Dim sdxx =.AddInput("申读学校","申读学校:","Text")
        sdxx.readonly = True
        sdxx.value= dr1("申读学校")
        Dim sdbj = .AddInput("申读班级","申读班级:","Text")
        sdbj.readonly = True
        sdbj.value= dr1("申读班级")
    Else
        messagebox.show("问题2")
        Dim sdxx =.AddInput("申读学校","申读学校:","Text")
        sdxx.readonly = True
        sdxx.value= e.Cookies("sdxx")
        Dim sdbj = .AddInput("申读班级","申读班级:","Text")
        sdbj.readonly = True
        sdbj.value= e.Cookies("sdbj")
    End If
    
    .AddHiddenValue("类型","a")
    With wb.AddButtonGroup("form1","btg1",False)
        Dim btn1= .Add("btn1", "扫报名码", "button")
        messagebox.show("问题3")
        If dr1 IsNot Nothing AndAlso dr1("录取类型")>""
            messagebox.show("问题4")
            btn1.kind=1
            btn1.enabled=False
            wb.InSertHtml("form1","<div style= \'background:url(../picture/nqbj.jpg);height:150px;background-size:cover\'>" )
            wb.InSertHtml("form1","<p style= \'text-align:center;font-size:20px;color:white;margin-top:20px;\'>录取通知</P>")
            wb.InSertHtml("form1","<p style = \'text-indent:2em;color:white;\'>经学校招生小组审核同意,你已被我校录取,请按相关时间安排入学就读,如有申读学校变更,需经学校教务处同意方可进行变更。</P>")
            wb.InSertHtml("form1","</div>")
        Else            
            btn1.Attribute = " & path & "/plus/barcode_scan.html\',true,true);"""
            btn1.kind=1
            
        End If
        Dim btn2= .Add("btn2", "确认申读", "submit")
        btn2.kind=1
        Dim btn3= .Add("btn3", "返回", "button")
        btn3.kind=1
        btn3.Attribute=""
    End With
End With
wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById(\'申读学校\').value=r.split(\',\')[0]; document.getElementById(\'申读班级\').value=r.split(\',\')[1];document.getElementById(\'类型\').value=r.split(\',\')[2]}</script>")
e.WriteString(wb.Build)
e.Handled=True

老师,请问上面当 dr1 is nothing时 “”问题2“显不出来是什么不对,谢谢

--  作者:有点蓝
--  发布时间:2020/7/6 16:47:00
--  
因为同时还有其他条件

    If dr1 IsNot Nothing 
if  dr1("申读学校")>"" And dr1("申读班级")>""
        Dim sdxx =.AddInput("申读学校","申读学校:","Text")
        sdxx.readonly = True
        sdxx.value= dr1("申读学校")
        Dim sdbj = .AddInput("申读班级","申读班级:","Text")
        sdbj.readonly = True
        sdbj.value= dr1("申读班级")
endif
    Else
        messagebox.show("问题2")
        Dim sdxx =.AddInput("申读学校","申读学校:","Text")
        sdxx.readonly = True
        sdxx.value= e.Cookies("sdxx")
        Dim sdbj = .AddInput("申读班级","申读班级:","Text")
        sdbj.readonly = True
        sdbj.value= e.Cookies("sdbj")
    End If