If e.DataCol.Name = "审核" Then
If e.NewValue = True Then
Dim pr As DataRow = Tables("业务.车辆信息").Current.DataRow
Dim r As Row = Tables("支出明细").AddNew()
r("支出项目") = "运费"
r("金额") = pr("应付金额")
r("收款人") = pr("车辆信息")
r("关单号") = pr("关单号")
Tables("业务.车辆信息").Current.Locked = True
Tables("业务.车辆信息").Current.Save()
Tables("支出明细").Current.Locked = True
Tables("支出明细").Current.Save()
End If
ElseIf e.DataCol.Name = "支付账户" Then
If e.NewValue IsNot Nothing Then
Dim pd As DataRow = Tables("业务.车辆信息").Current.DataRow
Dim d As Row = Tables("支出明细").AddNew()
d("支出项目") = "出车费"
d("金额") = pd("出车费")
d("收款人") = pd("车辆信息")
d("关单号") = pd("关单号")
d("支出账户") = pd("支出账户")
Tables("业务.车辆信息").Current.Locked = True
Tables("业务.车辆信息").Current.Save()
Tables("支出明细").Current.Locked = True
Tables("支出明细").Current.Save()
End If
End If
[此贴子已经被作者于2011-12-26 16:05:05编辑过]