Select e.DataCol.Name Case = "商城","用户名","商号","楼层","ID" Dim idx ,n1 As Integer
Dim dr1 as
DataRow =
e.DataRow
If dr1.IsNull("用户名") OrElse dr1.IsNull("商号") Then
dr1("取货商品名") = Nothing
Else
n1= val(Format(dr1("时间"),"yyyyMMdd"))-20120707
Dim bh As String = "D-" & dr1("合并") & "-" & dr1("商号") & "-" & dr1("用户名") & "-" & n1
idx = e.DataTable.Compute("Count(商品名)","商品名 like '" & bh _
& "*' and [_identify] < " & dr1("_identify") & " ") +1
dr1("取货商品名") = bh
End If
End Select