Dim cmd1 As new SQLCommand
cmd1.C
Dim cmd4 As new SQLCommand
cmd4.C
Dim cmd5 As new SQLCommand
cmd5.C
For Each rrr As Row In Tables("物料需求")
cmd1.CommandText = "Se lect FItemID From {t_ICItemCore} Where FNumber = '"& rrr("PartNo") & "'"
Dim Values = cmd1.ExecuteValues
If Values.Count > 0 Then
rrr("FItemID") = Values("FItemID")
End If
cmd4.CommandText = "Sel ect FPrice,FCyID,FTax From {t_SupplyEntry} Where FItemID = '" & rrr("FItemID") & "'and FUsed = 1 and FPrioritized = 1"
Dim Values4 = cmd4.ExecuteValues
If Values4.Count > 0 Then
rrr("UnitPrice_WithoutVAT") = Values4("FPrice")
rrr("FCyID") = Values4("FCyID")
rrr("FVAT") = Values4("FTax")
' rrr("FSupID") = Values4("FSupID")
End If
cmd5.CommandText = "Sel ect FName From {t_Currency} Where FCurrencyID = '" & rrr("FCyID") & "'"
Dim Values5 = cmd5.ExecuteValues
If Values5.Count > 0 Then
rrr("Currency") = Values5("FName")
End If
If rrr("Currency") ="人民币"
rrr("ExchangeRate") = 1
ElseIf rrr("Currency") ="欧元"
rrr("ExchangeRate") = 7.7
ElseIf rrr("Currency") ="瑞士法郎"
rrr("ExchangeRate") = 7
ElseIf rrr("Currency") ="美元"
rrr("ExchangeRate") = 6.7
End If
Next
msgbox("Done !!!")