Case "出差管理"
Dim Names As List(of String)
Dim name,name0 As String
Dim ta As New DropTreeBuilder
ta.SourceTable = DataTables("人员管理")
Ta.treesort = "部门名称,员工姓名"
ta.TreeCols = "部门名称|员工姓名"
ta.SourceCols = "部门名称|员工姓名|差费标准"
ta.ReceiveCols = "部门名称|姓名|差费标准"
If _userroles <> "开发者" AndAlso _userroles <> "管理者" AndAlso _userroles <> "审核人员" Then
If xmjl = 1 OrElse ((_userroles = "部门干事" OrElse _userroles = "部门领导" OrElse _userroles = "财务领导" OrElse _userroles = "生产领导") AndAlso _office = "机关") Then
If xmjl = 1 Then
names = DataTables("考勤管理").SQLGetValues("姓名","[复核人] = '" & _username & "' and (([年度] = " & ye1 & " and [月份] = " & mo1 & ") or ([年度] = " & ye0 & " and [月份] = " & mo0 & "))")
Else
names = DataTables("考勤管理").SQLGetValues("姓名","[复核人] <> '' and (([年度] = " & ye1 & " and [月份] = " & mo1 & ") or ([年度] = " & ye0 & " and [月份] = " & mo0 & "))")
End If
If names.Count > 0 Then
For Each name In names
name0 = name0 & ",'" & name & "'"
Next
name0 = name0.trim(",")
ta.TreeFilter = "[部门名称] in (" & _usergroup & ") and [员工姓名] in (" & name0 & ")"
DataTables("人员管理").LoadFilter ="[部门名称] in (" & _usergroup & ") and [员工姓名] in (" & name0 & ")"
DataTables("人员管理").Load
Else
ta.TreeFilter = "[员工姓名] = ''"
End If
Else
ta.TreeFilter = "[员工姓名] = ''"
End If
End If
CurrentTable.Cols("部门名称").DropTree = ta.Build()