“实有并行”datacolchanged
Dim dr As DataRow = e.DataRow
Dim dt As DataTable =DataTables("人员信息")
Dim de As DataTable =DataTables("人员信息")
If e.DataCol.Name = "单位"
For Each dc As DataCol In e.DataTable.DataCols
Dim cnt As Integer = 0
If dc.Name.StartsWith("实有职级_") Then
cnt = dt.Compute("Count(姓名)", "单位='" & e.NewValue & "' And 职级并行 = '" & dc.Name.Split("_")(1) & "'")
If cnt > 0 Then
dr(dc.Name) = cnt
Else
dr(dc.Name) = Nothing
End If
ElseIf dc.Name.StartsWith("实配职数_") Then
cnt = de.Compute("Count(姓名)", "单位='" & e.NewValue & "' And 单位正副职 = '" & dc.Name.Split("_")(1) & "'")
If cnt > 0 Then
dr(dc.Name) = cnt
Else
dr(dc.Name) = Nothing
End If
End If
Next
End If