Dim wb5 As New WeUI
Dim renshuguanwai As Integer
Dim renshuwaidian As Integer
Dim renshuzijia As Integer
Dim renshushanmen As Integer
Dim renshuweizhi As Integer
Dim renshuzong As Integer
Dim zclriqi As Date
wb5.AddForm("", "form1", "list.htm")
With wb5.AddButtonGroup("form1", "btg2", False) '水平排列
.Add("btn3", "昨天", "submit").FormAction = "list.htm?btn=3"
.Add("btn1", "今日", "submit").FormAction = "list.htm?btn=1"
.Add("btn2", "明日", "submit").FormAction = "list.htm?btn=2"
.Add("btn4", ">", "submit").FormAction = "list.htm?btn=4"
.Add("btn5", "确定", "submit").FormAction = "list.htm?btn=5"
End With
Se*t Case e.Path
Case "list.htm"
Dim flt As String
' e.WriteString(e.PostValues("startdate"))
If e.GetValues("btn") = 1 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = date.Today 'e.PostValues("startdate")
End With
Else
End If
If e.GetValues("btn") = 2 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = Date.Today.AddDays(1) 'e.PostValues("startdate")
End With
Else
End If
If e.GetValues("btn") = 3 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = Date.Today.AddDays( - 1) 'e.PostValues("startdate")
End With
Else
End If
If e.GetValues("btn") = 4 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = zclriqi.AddDays(1)
End With
Else
End If
If e.GetValues("btn") = 5 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
zclriqi = e.PostValues("startdate")
.AddInput("startdate", "日期", "date").Value = zclriqi
End With
End If
flt = "日期=' " & e.PostValues("startdate") & " '"
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = " Se*t 人数, 姓名, 手机, 酒店, 状态 From ({table_dingdan} Inner Join {table_kehu} On {table_kehu}.[idkehu] = {table_dingdan}.[idkehu]) "
If flt > "" Then
cmd.CommandText = cmd.CommandText & " where " & flt & " and ( 状态<>'取消' or 状态 is null ) Order By 酒店 "
End If
Dim dt As DataTable = cmd.ExecuteReader
With wb5.AddTable("", "Table1")
renshuguanwai = dt.compute("sum(人数)", "酒店='关外'")
renshuwaidian = dt.compute("sum(人数)", "酒店<>'关外' and 酒店<>'自驾' and 酒店<>'' and 酒店<>'蓝景' and 酒店<>'希尔顿' and 酒店<>'皇冠' and 酒店<>'黄松浦' and 酒店<>'山门' and 酒店<>'奶头山' ")
renshuzijia = dt.compute("sum(人数)", "酒店='自驾' ")
renshushanmen = dt.compute("sum(人数)", "酒店='蓝景' or 酒店='希尔顿' or 酒店='皇冠' or 酒店='黄松浦' or 酒店='山门' or 酒店='奶头山' ")
renshuweizhi = dt.compute("sum(人数)", " 酒店 is null ")
renshuzong = dt.compute("sum(人数)")
.CreateFromDataTable(cmd.ExecuteReader)
With .Body.AddRow()
.Attribute = "style='background-color:#FFFFE0'"
.AddCell("关外: " & renshuguanwai & "人,镇上外店人数:" & renshuwaidian & "人,自驾" & renshuzijia & "人,山门附近:" & renshushanmen & "人,其他人数:" & renshuweizhi & "人,总人数:" & renshuzong , "colspan='4'")
End With
End With
End Select
e.WriteString(wb5.Build)