in the SQL selectstatement I use these.
All works fine for UK/US settings of the browser, as soon as I have for example a German setting I believe the decimal point and the decimal comma is causing me problems to no end. Tried various options but seems to loose the battle here.
where i mulitply my sitetime with labourcost for example i get incorrect results.
Can somebody point me in the right direction here?
code is as follows:
Expand|Select|Wrap|Line Numbers
- Private Function CreateData() As SqlDataSource
- Dim conn As String = ConfigurationManager.ConnectionStrings("connstrSQS_SQL").ConnectionString
- Dim EurROECurrency As Double = CDbl(TxEuroROE.Text)
- Dim GBPROECurrency As Double = CDbl(TxGBPROE.Text)
- Dim UserCurrencySettings As String = ""
- Dim LabourCost As Double = CDbl(TxLabour.Text)
- Dim LC As Double = CDbl(TxLabour.Text) '10.12D
- Dim SQL As String
- ' LabourCost = String.Format(LC.ToString(System.Globalization.CultureInfo.InvariantCulture))
- Dim CurrencySetting As String = GetSQSSettingsInfo(Session("CompCode"), "LocalCurrency").ToString
- If CurrencySetting = "DEF" Then
- UserCurrencySettings = GetSQSPriceListInfo(Session("PriceList"), "Currency").ToString()
- Else
- UserCurrencySettings = CurrencySetting
- End If
- Dim selectCmnd As String = "SELECT TblWebServiceSchedule.HRS, TblRtParts.DispRef, TblRtParts.Description, TblWebServiceSchedule.Quantity, TblRtParts.SellPrice * TblWebServiceSchedule.Quantity AS Price, TblWebServiceSchedule.SiteTime, TblWebServiceSchedule.SiteTime * " & LabourCost & " AS Labour[/u][/u], CASE WHEN [Currency SellPrice] = 'EUR' THEN (TblRtParts.SellPrice * " & EurROECurrency & " * TblWebServiceSchedule.Quantity) ELSE (TblRtParts.SellPrice * " & GBPROECurrency & " * TblWebServiceSchedule.Quantity) END AS LocalPrice, '" & UserCurrencySettings & "' AS userCurrency FROM TblWebServiceSchedule INNER JOIN TblRtParts ON TblWebServiceSchedule.PartNoCode = TblRtParts.Ref WHERE (TblWebServiceSchedule.Oil LIKE '%" & ddlOil.Value & "%' OR TblWebServiceSchedule.Oil IS NULL) AND (TblWebServiceSchedule.ModelId LIKE '%" & ddlModel.Value & "%') AND (TblRtParts.LangRef LIKE '%" & ddlPriceList.Value & "%') ORDER BY TblWebServiceSchedule.HRS, TblWebServiceSchedule.PartCode"
- Return New SqlDataSource(conn, selectCmnd)
- End Function