Select Case e.DataCol.Name
Case "AutoID"
Dim dr As DataRow = DataTables("PODetails").SQLFind("AutoID= " & e.NewValue)
e.DataRow("StyleID") = dr("StyleID")
e.DataRow("PO") = dr("PO")
e.DataRow("Model") = dr("Model")
e.DataRow("Color") = dr("Color")
e.DataRow("Material") = dr("Material")
e.DataRow("Country") = dr("Country")
'提取库存
e.DataRow("RKSize1") = DataTables("TabRKBill").SQLCompute("Sum(Size1)","AutoID = " & e.NewValue)
e.DataRow("CKSize1") = DataTables("TabCKBill").SQLCompute("Sum(Size1)","AutoID = " & e.NewValue)
e.DataRow("RKSize2") = DataTables("TabRKBill").SQLCompute("Sum(Size2)","AutoID = " & e.NewValue)
e.DataRow("CKSize2") = DataTables("TabCKBill").SQLCompute("Sum(Size2)","AutoID = " & e.NewValue)
e.DataRow("RKSize3") = DataTables("TabRKBill").SQLCompute("Sum(Size3)","AutoID = " & e.NewValue)
e.DataRow("CKSize3") = DataTables("TabCKBill").SQLCompute("Sum(Size3)","AutoID = " & e.NewValue)
e.DataRow("RKSize4") = DataTables("TabRKBill").SQLCompute("Sum(Size4)","AutoID = " & e.NewValue)
e.DataRow("CKSize4") = DataTables("TabCKBill").SQLCompute("Sum(Size4)","AutoID = " & e.NewValue)
e.DataRow("RKSize5") = DataTables("TabRKBill").SQLCompute("Sum(Size5)","AutoID = " & e.NewValue)
e.DataRow("CKSize5") = DataTables("TabCKBill").SQLCompute("Sum(Size5)","AutoID = " & e.NewValue)
e.DataRow("RKSize6") = DataTables("TabRKBill").SQLCompute("Sum(Size6)","AutoID = " & e.NewValue)
e.DataRow("CKSize6") = DataTables("TabCKBill").SQLCompute("Sum(Size6)","AutoID = " & e.NewValue)
e.DataRow("RKSize7") = DataTables("TabRKBill").SQLCompute("Sum(Size7)","AutoID = " & e.NewValue)
e.DataRow("CKSize7") = DataTables("TabCKBill").SQLCompute("Sum(Size7)","AutoID = " & e.NewValue)
e.DataRow("RKSize8") = DataTables("TabRKBill").SQLCompute("Sum(Size8)","AutoID = " & e.NewValue)
e.DataRow("CKSize8") = DataTables("TabCKBill").SQLCompute("Sum(Size8)","AutoID = " & e.NewValue)
e.DataRow("RKSize9") = DataTables("TabRKBill").SQLCompute("Sum(Size9)","AutoID = " & e.NewValue)
e.DataRow("CKSize9") = DataTables("TabCKBill").SQLCompute("Sum(Size9)","AutoID = " & e.NewValue)
End Select
选择AutoID之后,然后这一行等全部统计出来得2-3秒。。。
能不能做一些优化?