If e.Col.name Like "*调度设备*" Then
Dim str As String = ""
Dim filter As String = "部品ID = \'" & e.Row("部品ID") & "\'"
Dim idx As String = e.Col.Name.Replace("第", "").Replace("序_调度设备", "")
Dim fdr As DataRow = DataTables("工程和工时").Find(filter & " and 工序序号 = \'" & idx & "\'")
If fdr IsNot Nothing Then
For Each dc As DataCol In DataTables("工程和工时").DataCols
If dc.name.StartsWith("使用机器") AndAlso fdr.IsNull(dc.name) = False Then
str &= fdr(dc.name) & "|"
End If
Next
End If
e.Col.ComboList = str
End If
If e.Col.name Like "*调度设备*" Then
Dim str As String = ""
Dim filter As String = "部品ID = \'" & e.Row("部品ID") & "\'"
Dim idx As String = e.Col.Name.Replace("第", "").Replace("序_调度设备", "")
Dim fdr As DataRow = DataTables("工程和工时").Find(filter & " and 工序序号 = \'" & idx & "\'")
If fdr IsNot Nothing Then
For Each dc As DataCol In DataTables("工程和工时").DataCols
If dc.name.StartsWith("使用机器") AndAlso fdr.IsNull(dc.name) = False Then
Dim flag As Boolean = True
For Each c As Col In e.Table.Cols
If c.name Like "*调度设备*" Then
Dim i As Integer = c.Name.Replace("第", "").Replace("序_调度设备", "")
For Each dr As DataRow In e.Table.DataTable.Select(c.name & " = \'" & fdr(dc.name) & "\'")
If dr("第" & i & "序_开始日") < e.Row("第" & i & "序_开始日") Then
If dr("第" & i & "序_结束日") >= e.Row("第" & i & "序_开始日") Then
flag = False
End If
ElseIf dr("第" & i & "序_开始日") >= e.Row("第" & i & "序_开始日") Then
If dr("第" & i & "序_开始日") <= e.Row("第" & i & "序_结束日") Then
flag = False
End If
End If
Next
If flag = False Then Exit For
End If
Next
If flag = True Then
str &= fdr(dc.name) & "|"
End If
End If
Next
End If
e.Col.ComboList = str
End If