我在生产计划管理系统中DataColChanged写的
If e.DataCol.Name = "生产流程单_判定" AndAlso e.DataRow("生产流程单_判定") = True Then
Dim nma() As String = {"生产通知单_产品名称","生产通知单_订单编号","生产流程单_合格数", "生产通知单_图号","生产流程单_半成品入库","生产流程单_成品入库"} 'A表数据来源列
Dim nmb() As String = {"出入库登记表_产品名称","出入库登记表_产品订单号","出入库登记表_入库数量","出入库登记表_产品编号","出入库登记表_半成品","出入库登记表_成品"} 'B表数据接收列
Dim dr As DataRow = DataTables("库房管理系统").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
End If
我在库房管理系统datacolchangde 写的
Select Case e.DataCol.Name
Case "出入库登记表_产品编号","出入库登记表_入库数量","出入库登记表_出库数量"
Dim s As String
Dim dr As DataRow
Dim mr As DataRow = e.DataRow
If mr("出入库登记表_半成品") Then
s = " And 出入库登记表_半成品=true"
ElseIf mr("出入库登记表_成品") Then
s = " And 出入库登记表_成品=true"
Else
Return
End If
Dim drs As List(of DataRow)
dr = e.DataTable.Find("[_SortKey] < " & mr("_SortKey") & " And [出入库登记表_产品编号] = '" & mr("出入库登记表_产品编号") & "' " & s , "[_SortKey] Desc")
If dr Is Nothing Then
mr("出入库登记表_库存数量") = mr("出入库登记表_入库数量") - mr("出入库登记表_出库数量")
dr = mr
End If
drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey") & " And [出入库登记表_产品编号] = '" & dr("出入库登记表_产品编号") & "' " & s , "[_SortKey]")
For i As Integer = 1 To drs.Count - 1
drs(i)("出入库登记表_库存数量") = drs(i-1)("出入库登记表_库存数量") + drs(i)("出入库登记表_入库数量") - drs(i)("出入库登记表_出库数量")
Next
If e.DataCol.Name = "出入库登记表_产品编号" AndAlso e.OldValue IsNot Nothing AndAlso e.OldValue <> e.NewValue Then
dr = e.DataTable.Find("[_SortKey] < " & mr("_SortKey") & " And [出入库登记表_产品编号] = '" & e.OldValue & "' " & s, "[_SortKey] Desc")
If dr Is Nothing Then
dr = e.DataTable.Find("[出入库登记表_产品编号] = '" & e.OldValue & "' " & s, "[_SortKey]")
If dr IsNot Nothing Then
dr("出入库登记表_库存数量") = dr("出入库登记表_入库数量") - dr("出入库登记表_出库数量")
End If
End If
If dr IsNot Nothing Then
drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey") & " And [出入库登记表_产品编号] = '" & dr("出入库登记表_产品编号") & "' " & s , "[_SortKey]")
For i As Integer = 1 To drs.Count - 1
drs(i)("出入库登记表_库存数量") = drs(i-1)("出入库登记表_库存数量") + drs(i)("出入库登记表_入库数量") - drs(i)("出入库登记表_出库数量")
Next
End If
End If
End Select
但是从《生产计划管理系统》点完判定后 会把相应的数据传到《库房管理系统》 但是库房管理系统虽然有数据传递过来 但是并没有运行
后来我又尝试手动输入数据 也没有运行