物料字典_DataColChanged
Select Case e.DataCol.Name
Case "模具型号","物料编号"
Dim dr As DataRow = DataTables("模具清单").Find("模具型号='" & e.DataRow("模具型号") & "'")
If dr Is Nothing Then
dr = DataTables("模具清单").AddNew
dr("模具型号") = e.DataRow("模具型号")
End If
dr("所应用的产品") = e.DataTable.GetComboListString("物料编号","模具型号='" & e.DataRow("模具型号") & "'").Replace("|",",")
If e.DataCol.Name = "模具型号" AndAlso e.OldValue > "" Then
dr = DataTables("模具清单").Find("模具型号='" & e.OldValue & "'")
If dr IsNot Nothing Then
dr("所应用的产品") = e.DataTable.GetComboListString("物料编号","模具型号='" & e.OldValue & "'").Replace("|",",")
End If
End If
End Select
物料字典_DataRowDeleting
Dim dr As DataRow = DataTables("模具清单").Find("模具型号='" & e.DataRow("模具型号") & "'")
If dr IsNot Nothing Then
dr("所应用的产品") = e.DataTable.GetComboListString("物料编号","模具型号='" & e.DataRow("模具型号") & "' and [_Identify] <>" & e.DataRow("_Identify")).Replace("|",",")
End If