Dim cmd As new SQLCommand
cmd.ConnectionName = "user"
Dim js As String = e.Cookies("userjs")
If js.Contains("区业务主管")
cmd.CommandText = "SE/ECT DISTINCT 学校名称 FROM {师表}"
End If
If js.Contains("教务")
cmd.CommandText = "SE/ECT DISTINCT 学校名称 FROM {师表} where 学校名称= '" & e.Cookies("userdw") &"'"
End If
Dim dt As DataTable = cmd.ExecuteReader()
'Dim xxs As List(of String)=dt.GetValues("学校名称")
With wb.AddInputGroup("form1","ipg1")
With .AddSelect("学校名称","学校:","|" & dt.GetComboListString("学校名称"))
.Attribute = "onchange=""setAjaxOptions('学期','getProducts.htm','学校名称',false)"""
End With
With .AddSelect("学期","学期:","")
.Attribute = "onchange=""setAjaxOptions('班级','getProducts.htm','学校名称','学期',false)"""
End With
.AddSelect("班级","班级:","")
With wb.AddButtonGroup("form1","btg1",False)
Dim bt1 =.Add("btn1", "查看", "submit")
bt1.kind=1
bt1.attribute="style='border:1px solid black;border-radius:20px;padding:0px;width:100%'"
End With
End With
e.WriteString(wb.Build())
e.Handled = True
Case "getProducts.htm"
Dim cmd6 As new SQLCommand
cmd6.ConnectionName = "user"
Dim js As String = e.Cookies("userjs")
cmd6.CommandText = "SELECT 学期,班级 FROM {师表} where 1=2"
Dim dt6 As DataTable = cmd6.ExecuteReader()
Dim vals As String
If e.PostValues.Count = 1 Then
vals = "|" & dt6.SQLGetComboListString("学期","学校名称='" & e.PostValues("学校名称") & "'")
ElseIf e.PostValues.Count = 2 Then
Dim Filter As String = "学期='" & e.PostValues("学期") & "' And 学校名称='" & e.PostValues("学校名称") & "'"
messagebox.show(filter)
vals = "|" & dt6.SQLGetComboListString("班级", Filter)
End If
e.WriteString(vals)'