'筛选验证
Dim e As RequestEventArgs = args(0) '验证页面(注册第2页)
Select Case e.Path
Case "p_tayaoqingshaixyz.htm"
Dim wb As New weui
Dim drshouj As String = e.Cookies("isj") '从cookie取用户手机
Dim dr As DataRow
If drshouj <> "" Then
dr = DataTables("会员资料").sqlFind("[会员编号] = '" & drshouj & "'")
msgbox(drshouj) '这里执行了,显示了手机号18961309989
msgbox("我的手机号:" & dr("手机")) ’这里没有执行,提示未将对象引用设置到对象的实例。
’“会员资料”表、“会员编号”列都是存在的,18961309989行存在,咋回事?看了很久 ’都没有找到原因,麻烦看看
Else
msgbox("您尚未登录!")
End If
Dim qis As String = e.PostValues("isr1") '验证起始日期 '测试代码:msgbox(e.PostValues("isr"))
Dim qisrq As Date '定义起始日期(转换后可用的内容)
Date.TryParse(qis, qisrq)
Dim qis_y As Integer = qisrq.Year
Dim qis_m As Integer = qisrq.Month
Dim qis_d As Integer = qisrq.Day
Dim jiez As String = e.PostValues("isr2") '验证截至日期
Dim jiezrq As Date '定义起始日期(转换后可用的内容)
Date.TryParse(jiez, jiezrq)
Dim jiez_y As Integer = jiezrq.Year
Dim jiez_m As Integer = jiezrq.Month
Dim jiez_d As Integer = jiezrq.Day
Dim bjy As Integer = jiez_y - qis_y '比较年
Dim bjm As Integer = jiez_m - qis_m '比较月
Dim bjd As Integer = jiez_d - qis_d '比较日
If qis <> "" AndAlso jiez <> "" Then '当2个表格都填写了的时候(比较年份)
If bjy < 0 Then
e.WriteString("截止日期必须大于起始日期!")
Return ""
End If
End If
If qis <> "" AndAlso jiez <> "" Then '当2个表格都填写了的时候(比较月份)
If bjy = 0 AndAlso bjm < 0 Then
e.WriteString("截止日期必须大于起始日期!")
Return ""
End If
End If
If qis <> "" AndAlso jiez <> "" Then '当2个表格都填写了的时候(比较日期-天)
If bjy = 0 AndAlso bjm = 0 AndAlso bjd < 0 Then
e.WriteString("截止日期必须大于起始日期!")
Return ""
End If
End If
msgbox(33)
If dr IsNot Nothing Then
dr("TA邀请_起始日期") = e.PostValues("isr1") '保存起始日期 '测试代码:msgbox(e.PostValues("isr"))
dr("TA邀请_截止日期") = e.PostValues("isr2") '保存截止日期
dr.save()
msgbox(44)
Else
msgbox("保存失败!请登录后,再使用会员中心-TA邀请筛选功能!") ’执行了这里
End If
'With wb.AddMsgPage("","msgpage","注册成功", "本地自助服务,为您婚恋交友之路保驾护航") '生成成功提示页
'.AddButton("btn1","完善资料","/fillout.htm")
'End With
msgbox(55)
wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到会员中心,他邀请页面
e.WriteString(wb.Build) '生成网页
End Select