Dim y As WinForm.ComboBox = e.Form.Controls("Com年")
Dim m As WinForm.ComboBox = e.Form.Controls("Com月")
Dim tb As Table = Tables(e.Form.Name & "_Table1")
Dim bm As WinForm.ComboBox = e.Form.Controls("Com部门")
bm.ComboList = DataTables("users").GetComboListString("小部门")
Dim dt As DataTable = DataTables("出勤汇总")
y.ComboList = dt.GetComboListString("年份")
m.ComboList = dt.GetComboListString("月份")
Dim ds As Integer = Date.DaysInMonth(y.Value,m.Value)
Dim dtb As New DataTableBuilder("CQ")
dtb.AddDef("部门", Gettype(String), 50)
dtb.AddDef("姓名", Gettype(String), 50)
dtb.AddDef("班次", Gettype(String), 50)
For i As Integer = 1 To ds ' c As Col In Tables("BOM").Cols
' dtb.AddDef(y.Value & "年_" & m.Value & "月_" & i , Gettype(String), 20 ) '& "|星期" & de.DayOfWeek)
dtb.AddDef( i & "日" , Gettype(String), 20 , "" , i) '& "|星期" & de.DayOfWeek)
Next
dtb.Build()
tb.DataSource = DataTables("CQ")
DataTables("CQ").GlobalHandler.DrawCell = True
For Each c As Col In tb.Cols
If c.Name <> "部门" AndAlso c.Name <> "姓名" AndAlso c.Name <> "班次" Then
c.ComboList = DataTables("出勤要求").GetComboListString("出勤情况")
End If
Next
Dim dr As DataRow = DataTables("Users").Find("Name = '" & _username & "'")
bm.Text = dr("小部门")
e.Form.Controls("But生成数据").performclick