表事件
应付副表本地表_DataColChanged
Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "contrastmaterialName"
Dim pr1 As DataRow = e.DataRow.GetParentRow("R02_supplier")
If pr1 IsNot Nothing Then
'当单据类型=产品净银重时,对比色=应付科表中相同成色列对应的转换后成色
If e.DataRow("kind") = "产品净银重" Then
If e.DataRow("contrastmaterialName") = "S925银" Then
e.DataRow("materialName1") = pr1("PickingColour925")
Else
If e.DataRow("contrastmaterialName") = "足银990" Then
e.DataRow("materialName1") = pr1("PickingColour990")
Else
If e.DataRow("contrastmaterialName") = "足银999" Then
e.DataRow("materialName1") = pr1("PickingColour999")
Else
If e.DataRow("contrastmaterialName") = "足银999.9" Then
e.DataRow("materialName1") = pr1("PickingColour9999")
End If
End If
End If
End If
Else
'当单据类型 = 实工费 Or = 期初 - 工费时, 对比色 =应付科目表中相同供应商代码对应的主成色
If e.DataRow("kind") = "实工费" Or e.DataRow("kind") = "期初-工费" Then
e.DataRow("materialName1") = pr1("materialName")
Else
'当单据类型=领料重时,对比色=比较成色
If e.DataRow("kind") = "领料重" Then
e.DataRow("materialName1") = e.DataRow("contrastmaterialName")
End If
End If
End If
End If
'依据对比成色得出折点率
Case "materialName1"
Dim pr3 As DataRow = e.DataRow.GetParentRow("R02_supplier")
If pr3 IsNot Nothing Then
If e.DataRow("materialName1") = "S925银" Then
e.DataRow("weightRate") = pr3("ConversionRate925")
Else
If e.DataRow("materialName1") = "足银990" Then
e.DataRow("weightRate") = pr3("ConversionRate990")
Else
If e.DataRow("materialName1") = "足银999" Then
e.DataRow("weightRate") = pr3("ConversionRate999")
Else
If e.DataRow("materialName1") = "足银999.9" Then
e.DataRow("weightRate") = pr3("ConversionRate9999")
Else
If e.DataRow("materialName1") = "黄铜" Then
e.DataRow("weightRate") = 0
End If
End If
End If
End If
End If
End If
End Select
应付副表本地表_AfterCheckRow
'获得相关参数
Dim smartID As String = e.Form.Controls("smartID").Value
For Each r As Row In Tables("应付副表本地表").Rows '遍历表所有行
Dim dr As Row = e.Row '定义当前行
If dr.IsNull("factoryID") = False Then
If r("factoryID") = dr("factoryID") Then '如果遍历到某行ID列与当前行ID列值相同 ‘r("ID")=dr("ID") Or Or r("sourceID") = dr("sourceID")
r.Checked = e.Row.Checked '则某行复选框状态与当前行复选框状态相同
r("checked") = e.Row.Checked
r("smartID") = "" & smartID & ""
If e.Row.Checked = False Then 'And dr.locked = False ‘当复选框为否
r("smartID") = Nothing
r("checked") = e.Row.Checked
End If
End If
End If
Next
DataTables("应付副表本地表").Save()