这个问题,其实,增加的和减少的,都是一样的内容吧,只是填写到的位置不同。
Dim names1 As List(Of String) = DataTables("一一与一二对比").GetUniqueValues("", "在岗人员对比_一一年")
Dim names2 As List(Of String) = DataTables("一一与一二对比").GetUniqueValues("", "在岗人员对比_一二年")
Dim names3 As New List(Of String)
Dim flag As Boolean = false
If names1 < names2 then '左边的人数少,即是 减少
dim temp As List(Of String) = names1
names1 = names2
names2 = names1
flag = true
End If
For Each name As String In names1
If Not names2.Contains(name) Then
names3.add(name)
End If
Next
For i As Integer = 0 To names3.Count - 1
If flag = false Then
Tables("一一与一二对比").Rows(i)("增加") = names3(i)
Else
Tables("一一与一二对比").Rows(i)("减少") = names3(i)
End If
Next