'自动输入物料资料
If e.DataCol.Name = "物料编号" Then
Dim dr As DataRow
dr = DataTables("物料字典").Find("物料编号 = '" & e.DataRow("物料编号") & "'" )
If dr IsNot Nothing
e.DataRow("铜铝") = dr("细分一")
e.DataRow("单位") = dr("库存单位")
e.DataRow("宽度类型") = dr("宽度类型")
e.DataRow("物料名称") = dr("物料名称")
e.DataRow("字头") = e.DataRow("物料编号").substring(0,3)
e.DataRow("单重") = dr("单重")
End If
If e.DataRow("物料编号").Endswith("SL") Then
e.DataRow("简化物料编号") = e.DataRow("物料编号").
Else
If e.DataRow("物料编号").Endswith("S") Then
e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("S", "")
ElseIf e.DataRow("物料编号").Endswith("A") Then
e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("A", "")
ElseIf e.DataRow("物料编号").Endswith("B") Then
e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("B", "")
ElseIf e.DataRow("物料编号").Endswith("C") Then
e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("C", "")
ElseIf e.DataRow("物料编号").Endswith("D") Then
e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("D", "")
ElseIf e.DataRow("物料编号").Endswith("E") Then
e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("E", "")
ElseIf e.DataRow("物料编号").Endswith("L") Then
e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("L", "")
Else
e.DataRow("简化物料编号") = e.DataRow("物料编号")
End If
End If
End If