If e.DataCol.Name= "写入标记" AndAlso e.DataRow("写入标记")=True Then
Dim drs As List(Of DataRow) = DataTables("工序合并表").SqlSelect("母卷号 = '" & e.DataRow("母卷号") & "'", "", "卷号,起始时间") '指定母卷号计算
If drs.Count=1 Then
drs(0)("库存标记") = True
Else
For i As Integer = 1 To drs.Count - 1
If drs(i)("卷号").Contains(drs(i-1)("卷号")) Then
drs(i-1)("库存标记") = False
Else
drs(i-1)("库存标记") = True
End If
drs(i-1).Save
Next
drs(drs.Count-1)("库存标记") = True
drs(drs.Count-1).Save
End If
End If