实际使用过程中重复?自己用的时候重复,还是多人一起使用的情况重复?
Select e.DataCol.name
Case "到货时间","件号"
If e.DataRow.IsNull("到货时间") OrElse e.DataRow.IsNull("件号") Then
e.DataRow("订单号") = Nothing
Else
Dim bh As String = e.DataRow("代号") & Format(e.DataRow("到货时间"),"yyMMdd")
If e.DataRow("订单号").startsWith(bh) = False
Dim max As String
Dim idx As Integer
max = e.DataTable.Compute("Max(订单号)","代号 = '" & e.DataRow("代号") & "' and 到货时间= #" & e.DataRow("到货时间") & "# And [_Identify] <> " & e.DataRow("_Identify"))
If max > "" Then
idx = CInt(max.Substring(bh.Length,2)) + 1
Else
idx = 1
End If
e.DataRow("订单号") = bh & Format(idx,"00")
End If
End If
End Select