Dim st As Date = Date.Now '将开始时间保存在变量st中
SystemReady = False
' Try
'追加数据代码
DataTables("出库单明细").DataCols("折后单价").Expression = ""
DataTables("出库单明细").DataCols("金额").Expression = ""
'Sum(Child(出库关联).数量)
Output.Show("去掉出库单明细表达式耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
DataTables("出库单明细").StopRedraw
DataTables("出库单明细").RemoveFor("出库日期 = '" & e.Form.Controls("DateTimePicker1").Text & "'")
Output.Show("移除出库单明细耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
DataTables("出库单明细").AppendLoad("出库日期 = '" & e.Form.Controls("DateTimePicker1").Text & "'")
Output.Show("追加出库单明细耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
DataTables("出库单明细").DataCols("折后单价").Expression = "单价 * 折扣率"
DataTables("出库单明细").DataCols("金额").Expression = "数量 * 折后单价 * 修正"
Output.Show("添加出库单明细表达式耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
DataTables("出库单明细").ResumeRedraw
Output.Show("恢复绘制出库单明细耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
DataTables("出库单汇总").DataCols("金额").Expression = ""
DataTables("出库单汇总").DataCols("数量").Expression = ""
Output.Show("去掉出库单汇总达式耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
DataTables("出库单汇总").StopRedraw
DataTables("出库单汇总").RemoveFor("出库日期 = '" & e.Form.Controls("DateTimePicker1").Text & "'")
Output.Show("移除出库单汇总耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
DataTables("出库单汇总").AppendLoad("出库日期 = '" & e.Form.Controls("DateTimePicker1").Text & "'")
Output.Show("追加出库单汇总耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
DataTables("出库单汇总").DataCols("数量").Expression = "Sum(Child(出库关联).数量)"
DataTables("出库单汇总").DataCols("金额").Expression = "Sum(Child(出库关联).金额)"
Output.Show("添加出库单汇总表达式耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
DataTables("出库单汇总").ResumeRedraw
Output.Show("恢复绘制出库单汇总耗时: " & (Date.Now - st).TotalSeconds & "秒")
st = Date.Now
With Tables("销售出库单_Table2")
.Position = .Rows.Count - 1
End With
'e.Form.Controls("Label7").Visible = False
'Catch ex As Exception
' MessageBox.Show("追加数据失败")
'End Try
SystemReady = True