物料信息(表)
Select Case e.DataCol.Name
Case "物料描述","规格型号","单位","物料属性"
Dim Filter As String = "[物料代码] = \'" & e.DataRow("物料代码") & "\'"
Dim drs As List(Of DataRow) = DataTables("采购订单").sqlSelect(Filter)
For Each dr As DataRow In drs
dr(e.DataCol.Name) = e.NewValue
Next
DataTables("采购订单").SQLUpdate(drs)
End Select
采购订单(表)
If e.DataCol.Name = "物料代码" Then
If e.NewValue Is Nothing Then
e.DataRow("物料描述") = Nothing
e.DataRow("规格型号") = Nothing
e.DataRow("单位") = Nothing
e.DataRow("物料属性") = Nothing
Else
Dim dr As DataRow
dr = DataTables("物料信息").Find("[物料代码] = \'" & e.NewValue & "\'")
If dr Is Nothing Then
dr = DataTables("物料信息").SQLFind("[物料代码] = \'" & e.NewValue & "\'")
End If
If dr IsNot Nothing
e.DataRow("物料描述") = dr("物料描述")
e.DataRow("规格型号") = dr("规格型号")
e.DataRow("单位") = dr("单位")
e.DataRow("物料属性") = dr("物料属性")
End If
End If
End If
物料信息(表)
Select Case e.DataCol.Name
Case "采购在途"
Dim dr As DataRow = DataTables("采购订单").Find("物料代码 = \'" & e.DataRow("物料代码") & "\'")
If dr IsNot Nothing Then
DataTables("采购订单").DataCols("物料代码").RaiseDataColChanged(dr)
End If
End Select
Select Case e.DataCol.Name
Case "物料代码"
e.DataRow("采购在途") = DataTables("物料信息").Compute("Sum(采购在途)","[物料代码] = \'" & e.NewValue & "\'")
End Select