出入库 datacolchanged 代码:If e.DataCol.name = "余数" Then
e.DataRow.save '必须先保存,后面SQL才能统计到此数据的变化
Dim max As Integer = DataTables("出入库").Compute("Max(_Identify)", "物料编号 = '" & e.DataRow("物料编号") & "'") '取得同物料的最大识别号
If e.DataRow("_Identify") = max Then
If user.Group = "仓库" OrElse user.Group = "组装仓库" OrElse user.Group = "仓库(铝巴)" OrElse user.Group = "品质" OrElse user.Group = "品质工程师" OrElse user.name = "开发者"Then
DataTables("物料字典").DataCols("物料编号").RaiseDataColChanged("物料编号 = '" & e.DataRow("物料编号") & "'")
End If
End If
End If
物料字典 datacolchanged 代码:
If e.DataCol.Name = "物料编号" Then
If e.NewValue IsNot Nothing Then
Dim dr1 As DataRow = DataTables("出入库").SQLFind("物料编号 = '" & e.DataRow("物料编号") & "'", "_Sortkey Desc")
If dr1 IsNot Nothing Then
e.DataRow("最后余数1") = dr1("余数")
End If
Dim dr As DataRow = DataTables("出入库2").SQLFind("物料编号 = '" & e.DataRow("物料编号") & "'", "_Sortkey Desc")
If dr IsNot Nothing Then
e.DataRow("最后余数2") = dr("余数")
End If
end if
end if
上面 出入库 代码执行时,会触发 物料字典 发生|“无法创建新的堆栈防护页面” 提示。请问要怎样修改代码好呢?谢谢。