Select Case e.DataCol.Name
Case "分群码说明","品名"
If e.DataRow.isnull("分群码说明") = False AndAlso e.DataRow("分群码说明").length >= 2
If e.DataRow("分群码说明").Substring(0,2) = "板卡"
Dim n As Integer = e.DataRow("品名").IndexOf("组件")
If n = -1 Then
e.DataRow("分类") = "其他板卡组件"
ElseIf
e.DataRow("分类") = e.DataRow("品名").Substring(n-2,2)
End If
Else If e.DataRow("分群码说明").Substring(0,2) = "成品" Then
e.DataRow("分类") = "成品"
Else If e.DataRow("分群码说明").Substring(0,2) = "裸机" Then
e.DataRow("分类") = "裸机"
Else If e.DataRow("分群码说明").Substring(0,2) = "辅料" Then
e.DataRow("分类") = "辅料"
Else If e.DataRow("分群码说明").Substring(0,2) = "组装" Then
e.DataRow("分类") = "组装"
Else
e.DataRow("分类") = "其他"
End If
End If
Case "料号","分类"
If e.DataRow.isnull("料号") = False AndAlso e.DataRow("分群码说明").length >= 6
e.DataRow("料号1") = e.DataRow("料号").Substring(0,6) + e.DataRow("分类")
Else
e.DataRow("料号1") = e.DataRow("分类")
End If
End Select