Dim mon As Integer = Date.Today.Month
Dim days As Integer = Date.DaysInMonth(Date.Today.Year,Date.Today.Month)
Dim s As String
For j As Integer = Date.Today.day To days
s + = "\' \' As " & mon & "月" & j & "日,"
Next
\'Dim cmd As New SQLCommand
\'cmd.C
\'cmd.CommandText = "Select 房间号," & s.trim(",") & " from {客房信息表}"
s = "Select 房型, \' \' As 房间号 , " & s.trim(",") & " from {客房信息表} order by 排序 "
\'s=cmd.CommandText
\'cmd.CommandText = "Select 房间号 ," & s.trim(",") & " from {客房信息表}"
Dim dt As DataTable = DataTables("房态表_Table1")
\'dt = cmd.ExecuteReader()
\'s=cmd.CommandText
dt.Fill( s , True)
Tables("房态表_table1").Grid.Cols.Defaultsize = 60
If dt.DataRows.Count < DataTables("客房信息表").DataRows.Count Then
dt.AddNew(DataTables("客房信息表").DataRows.Count - dt.DataRows.Count)
End If
For i As Integer = 0 To DataTables("客房信息表").DataRows.Count - 1
For j As Integer = 0 To dt.DataRows.Count - 1
If i = j Then
dt.DataRows(j)("房间号") = DataTables("客房信息表").DataRows(i)("房间号")
End If
Next
Next
For Each ftdr As DataRow In dt.DataRows
For Each ftdc As DataCol In dt.DataCols
For Each xcdr As DataRow In DataTables("zclxingcheng").DataRows
If xcdr("日期").Year = Date.Today.Year AndAlso xcdr("日期").Month & "月" & xcdr("日期").Day & "日" = ftdc.Name AndAlso xcdr("房间号").Contains(ftdr("房间号")) Then
Dim dr As DataRow = DataTables("userb").Find("ID = \'" & xcdr("客户ID") & "\'")
If dr IsNot Nothing
ftdr(ftdc.Name) + = dr("name") & ","
End If
End If
Next
ftdr(ftdc.Name) = ftdr(ftdc.Name).Trim(",")
Next
Next
e.Form.Text = Date.Today.Year & "年" & Date.Today.Month & "月房态表"