如果是出库单填写完 数量以后 需要更改 库存表里的出库数量,是否可以通过事件解决.
例如下面这个代码 学员签到以后,会在学员信息表你 统计签到数量.
Dim pr1 As DataRow
pr1 = DataTables("学员管理_学员信息表").Find("学号 = '" & e.DataRow.OriginalValue("学号") & "'")
If pr1 IsNot Nothing Then
pr1("消耗课时") = e.DataTable.compute("count(学号)","学号 = '" & e.DataRow.OriginalValue("学号") & "' and 签到状态 = '签到' And 签到类型 = '正常'")
pr1("账户消耗") = e.DataTable.compute("sum(课时标准)","学号 = '" & e.DataRow.OriginalValue("学号") & "' and 签到状态 = '签到' And 签到类型 = '正常'")
pr1("赠课消耗") = e.DataTable.compute("count(学号)","学号 = '" & e.DataRow.OriginalValue("学号") & "' and 签到状态 = '签到' And 签到类型 = '赠课'")
pr1("年卡上课") = e.DataTable.compute("count(学号)","学号 = '" & e.DataRow.OriginalValue("学号") & "' and 签到状态 = '签到' And 签到类型 = '年卡'")
pr1("欠课数量") = e.DataTable.compute("count(学号)","学号 = '" & e.DataRow.OriginalValue("学号") & "' and 签到状态 = '签到' And 签到类型 = '欠课'")
pr1("清欠课") = e.DataTable.compute("count(学号)","学号 = '" & e.DataRow.OriginalValue("学号") & "' and 签到状态 = '签到' And 签到类型 = '清欠课'")
pr1("清欠金额") = e.DataTable.compute("sum(课时标准)","学号 = '" & e.DataRow.OriginalValue("学号") & "' and 签到状态 = '签到' And 签到类型 = '清欠课'")
'pr("请假人数") = e.DataTable.compute("count(签到表编号)","签到表编号 = '" & e.DataRow("签到表编号") & "' and 签到状态 = '请假'")
'pr("未到人数") = e.DataTable.compute("count(签到表编号)","签到表编号 = '" & e.DataRow("签到表编号") & "' and 签到状态 = '未到'")
'pr("应到人数") = e.DataTable.compute("count(签到表编号)","签到表编号 = '" & e.DataRow("签到表编号") & "' and 签到状态 <> ''")
pr1.Save
End If