有一段DataColChanged事件代码,想用按钮代码来替代,如何修改代码,请各位老师指教,谢谢!!
DataColChanged事件代码
If e.DataCol.name = "工位编号" Then
If e.DataRow.IsNull("工位编号") = False
Dim gwbh As String = e.DataRow("工位编号")
Dim cpkh As String = RibbonTabs("工艺管理")("工位").Items("产品款号").Text
e.DataRow("工序编号") = DataTables("资料").GetComboListString("工序编号","(工位编号 = '" & gwbh & "' or 工位编号 like '" & gwbh & "_%' or 工位编号 like '%_" & gwbh & "' or 工位编号 like '%_" & gwbh & "_%') and 产品款号 = '"& cpkh &"'").Replace("|","_")
End If
End If
按钮代码
For Each dr As DataRow In DataTables("工位").DataRows
If dr.IsNull("工位编号") Then
dr("工序编号") = Nothing
Else
Dim pr As DataRow = DataTables("资料").Find("工位编号 = '" & dr("工位编号") & "' and 产品款号 = '"& cpkh &"'")
If pr IsNot Nothing Then
dr("工序编号") = pr("工序编号")
Else
dr("工序编号") = Nothing
End If
End If
Next
[此贴子已经被作者于2015/5/11 9:47:34编辑过]