Dim wb As New WeUI \'定义一个基于weui框架的网页生成器
Dim nms() As String
Select Case e.Path
Case "addnew.htm",""
wb.AddForm("","form1","page2.htm")
With wb.AddInputGroup("form1","ipg1","基本情况")
.AddInput("姓名","姓名","text")
With .AddInput("联系电话","联系电话","text")
.Attribute = """
End With
.AddSelect("性别","性别","男|女")
.AddSelect("民族","民族","汉|少数民族")
With .AddSelect("省份","省份","")
.Attribute = """
End With
.AddSelect("城市","城市","")
.AddInput("毕业学校","毕业学校","text")
.AddInput("班级","班级","text")
.AddInput("邮箱","邮箱","text")
.AddInput("推荐人","推荐人","text")
.AddSelect("类别","类别","普通|艺术|体育")
.AddInput("dj","单价","number") .Attribute = "style=\'display:none;\'"
.AddInput("zk","折扣","number").Attribute = ""
.AddInput("dj1","单价1","number") .Attribute = "style=\'font-style:italic;font-weight:900;\'"
.AddInput("zk1","折扣1","number")
End With
With wb.AddCheckGroup("form1","rdg1","你的选科")
.Add("物理","物理") \'默认勾选
.Add("历史","历史")
.Add("化学","化学")
.Add("生物","生物") \'默认勾选
.Add("政治","政治")
.Add("地理","地理")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btnok","确定")
End With
wb.AppendHTML("<script> hide(\'dj\');</script>") \'引入脚本文件
e.WriteString(wb.Build) \'生成网页
Case "getsf.htm"
Dim sfs As String = DataTables("基本情况").GetComboListString("省份")
sfs="|" & sfs
e.WriteString(sfs)
Case "getcity.htm"
Dim pps As String = DataTables("城市分级").GetComboListString("城市","省份=\'" & e.PostValues("省份") & "\'")
e.WriteString(pps)
Case "page2.htm"
nms = New String() {"姓名","联系电话","性别","民族","省份","城市","毕业学校","班级","邮箱","推荐人","类别"} \'重新定义了nms数组,增加了两列.
Dim dr As DataRow = DataTables("考生信息").AddNew()
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr(nm) = e.PostValues(nm)
End If
Next
End Select