DataTables("值班补助表").DataRows.Clear
systemReady = False
Dim Vals As List(of String)
Vals = DataTables("值班排班表").SQLGetValues("处级带班_姓名 + ',' + 年度 + ',' + 节假日名称 + ',' + 补助项目"
,"时段区分 <> '03晚上' and 处级带班_姓名 Is not
null")
For Each name
As String In DataTables("值班排班表").SQLGetValues("科级带班_姓名 + ',' + 年度 + ',' + 节假日名称 + ',' + 补助项目","科级带班_姓名 is not null")
If
Vals.Contains(name) = False Then vals.Add(name)
Next
For Each name As String In DataTables("值班排班表").SQLGetValues("值班人员_姓名 + ',' + 年度 + ',' + 节假日名称 + ',' + 补助项目","值班人员_姓名 is not null")
If Vals.Contains(name) = False Then vals.Add(name)
Next
Dim dr As DataRow
For Each name As String In vals
Dim arr() As String = name.Split(",")
dr = DataTables("值班补助表").find(" 姓名 ='"
& arr(0) & "'and 年度 ='" & arr(1) & "'and 节假日名称 ='" & arr(2) & "' and 补助项目 ='" & arr(3) & "'")
If dr Is Nothing Then
dr = DataTables("值班补助表").AddNew
dr("姓名")
= arr(0)
dr("年度")
= arr(1)
dr("节假日名称")
= arr(2)
dr("补助项目")
= arr(3)
End If
dr("次数")
= DataTables("值班排班表").GetValues("值班日期|处级带班_姓名","处级带班_姓名 ='" & arr(0) & "' and 年度 ='" & arr(1) & "' and 节假日名称 ='" & arr(2) & "' and 补助项目 ='" & arr(3) & "'").Count
+ DataTables("值班排班表").GetValues("值班日期|科级带班_姓名","科级带班_姓名='" & arr(0) & "' and 年度='" & arr(1) & "' and 节假日名称 ='" & arr(2) & "' and 补助项目 ='" & arr(3) & "'").Count
+ DataTables("值班排班表").GetValues("值班日期|值班人员_姓名","值班人员_姓名='" & arr(0) & "' and 年度='" & arr(1) & "' and 节假日名称 ='" & arr(2) & "' and 补助项目 ='" & arr(3) & "'").Count
Dim dr2 As DataRow = DataTables("值班排班表").find("(处级带班_姓名 ='"
& arr(0) & "' or 科级带班_姓名 ='" & arr(0) & "' or 值班人员_姓名 ='" & arr(0) & "') and 年度 ='" & arr(1) & "'and 节假日名称 ='" & arr(2) & "' And 补助项目 ='" & arr(3) & "'")
If dr2 IsNot Nothing Then
dr("值班日期") = dr2
("值班日期")
End
If
Next
SystemReady = True