在生成stulist.htm页面时,条件合成无效,没有依据“学校”、“班级”、“录入员”以及起始时间生成数据表,生成的是全部的数据,
Select Case e.Path
Case "stufilter.htm"
With wb.AddInputGroup("form1","ipg1","<img src='./images/mm1.png'/> <style='width:50px'><span style='font-size:21px'>数据管理</span>") '新增数据信息
.AddSelect("xx","学校",schoolname)
.AddSelect("lry","录入员",username)
With.AddSelect("bj","班级 ","|" & DataTables("订单表").GetComboListString("班级","[学校] = '" & schoolname & "'"))
End With
.AddInput("startdate","开始日期","date")
.AddInput("enddate","结束时间","date")
' End With
End With
With wb.AddButtonGroup("form1","btg1",False)
.Add("btn1", "查询记录","submit")
.Add("home","返回主页","", "classwork.htm") '----------------返回首页
End With
With wb.AddInputGroup("form1","ipg3",“”注:若查询条件为空,则不限制该条件查询!") '新增数据信息
End With
e.WriteString(wb.Build) '生成网页
Case "stulist.htm"
'Dim e As RequestEventArgs = args(0)
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("xx") Then
flt = "学校 = '" & e.PostValues("xx") & "'" '合成条件
wb.AppendCookie("xx", e.PostValues("xx")) '将值写入cookie中
Else
wb.DeleteCookie("xx") '删除cookie
End If
If e.PostValues.ContainsKey("bj") Then
If flt > "" Then
flt = flt & " and "
End If
flt = flt & "班级 = '" & e.PostValues("bj") & "'"
wb.AppendCookie("bj", e.PostValues("bj")) '将值写入cookie中
End If
If e.PostValues.ContainsKey("lry") Then
If flt > "" Then
flt = flt & " and "
End If
flt = flt & "录入员 = '" & e.PostValues("lry") & "'"
wb.AppendCookie("lry", e.PostValues("lry")) '将值写入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("xx") Then
flt = "学校 = '" & e.Cookies("xx") & "'" '合成条件
End If
If e.Cookies.ContainsKey("bj") Then
If flt > "" Then
flt = flt & " and "
End If
flt = flt & "班级 = '" & e.Cookies("bj") & "'"
End If
If e.Cookies.ContainsKey("lry") Then
If flt > "" Then
flt = flt & " and "
End If
flt = flt & "录入员 = '" & e.Cookies("lry") & "'"
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
[此贴子已经被作者于2021/8/15 21:28:59编辑过]