Click here to Skip to main content
15,887,453 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow must I solve this problem ? ( I don't know what it is ) Pin
Member 1134468130-Dec-14 21:45
Member 1134468130-Dec-14 21:45 
AnswerRe: How must I solve this problem ? ( I don't know what it is ) Pin
jkirkerx31-Dec-14 9:39
professionaljkirkerx31-Dec-14 9:39 
GeneralRe: How must I solve this problem ? ( I don't know what it is ) Pin
Member 113446811-Jan-15 22:25
Member 113446811-Jan-15 22:25 
Answerjquery paging&fancy box Pin
Member 1133082530-Dec-14 18:24
Member 1133082530-Dec-14 18:24 
AnswerRe: jquery paging&fancy box Pin
jkirkerx31-Dec-14 9:43
professionaljkirkerx31-Dec-14 9:43 
GeneralRe: jquery paging&fancy box Pin
Member 113308252-Jan-15 1:09
Member 113308252-Jan-15 1:09 
QuestionMVC/EF - Entity Relationship Not Being Saved Pin
Matt U.30-Dec-14 5:35
Matt U.30-Dec-14 5:35 
QuestionHow to show different results based on user choices??? Pin
samflex30-Dec-14 2:50
samflex30-Dec-14 2:50 
We are building a transportation services website that allows potential users to make transportation services requests online.

We provide the following services:

ONE WAY trip TO the airport
ONE WAY trip FROM the airport
Round Trip services

Also, users have options of what type of vehicles to use.

The vehicles include Sedan and SUV

The way it is supposed to work is this:

If trip is ONE WAY, user is charged a certain fare.

If Round Trip, the user is charged double the ONE WAY fare.

Each fare includes a 10%, a 7% tax and a 20% tip.

If preferred vehicle is SUV, there is an additional $12.00 added to the overall cost.

The code I have below captures the initial fare correctly.

It captures the discount amount, the tax amount, the tip amount, $12.00 for SUV(if that's user's preferred vehicle) and it captures the overall total cost.

The problem we are having is that it does not capture the round trip total cost.

or instance, if overall cost for one way trip from Calhum to airport is $75.00, we expect the round trip be twice that amount for the same route.

Any ideas what to fix on my code to make it work correctly?

PHP
        Dim StrSQL As String = ""
        Dim strWHERE As String = ""
        Dim rs As SqlDataReader
        Dim val As String = tripType.SelectedItem.Value
        Dim suv As String = vpreferred.SelectedItem.Value
        'Response.Write(val)
        'Response.End()
        If val = "hourly" Then
            StrSQL = "select DISTINCT s.carTypes, s.Newfare as Fares, s.tip, (s.total+^SUV^) as total from vwhourly s "
            strWHERE = " WHERE s.Hourly = @hourly"
            If Len(suv) <> 0 Then
                strWHERE += " AND s.carTypes = '" & suv & "'"
            End If
        Else
            '     StrSQL = "SELECT city, fare, (fare*(10/100)) AS Discount, (fare-Discount) * ^RT^ AS NewFare, (Newfare*(7/100)) AS tax, (newFare*(20/100)) AS tip, (Newfare + (Newfare*(7/100)) + (newFare*(20/100)) + ^SUV^) AS total FROM Rates "

            StrSQL = "with CTE_Rates as " & _
"( " & _
 "   Select DISTINCT " & _
            "City, " & _
       "     Fare " & _
     "       FROM Rates " & _
") " & _
"SELECT  " & _
"City, " & _
"Fare,  " & _
"Fare * 0.1 AS Discount,  " & _
"(Fare * 0.9) * ^RT^ AS NewFare,  " & _
"Fare * 0.063 AS Tax,  " & _
"Fare * 0.18 AS Tip, " & _
"Fare * 1.143 + ^SUV^ AS Total  " & _
"FROM CTE_Rates "
            strWHERE = " Where city In('" & lblPreviewfromCityState.Text & "' , '" & lblPreviewDropOff.Text & "')"
        End If
        If suv = "SportUtilityVehicle" Then
            StrSQL = Replace(StrSQL, "^SUV^", "12")
        Else
            StrSQL = Replace(StrSQL, "^SUV^", "0")
        End If
        If val Like "round_trip_*airport" Then
            StrSQL = Replace(StrSQL, "^RT^", "2")
        Else
            StrSQL = Replace(StrSQL, "^RT^", "1")
        End If

        Dim conn As New SqlConnection(connStr)
        Dim cmd As New SqlCommand(StrSQL & strWHERE, conn)

        If val = "hourly" Then
            cmd.Parameters.AddWithValue("@hourly", HourlyCharter.SelectedValue)
        End If
        Response.Write(StrSQL)
        Response.End()
        'Now open connection to the db
        conn.Open()

        'open recordset to receive db values
        rs = cmd.ExecuteReader()

          While rs.Read()

            Dim tipValue As Decimal = rs("tip")
            Dim totValue = rs("total")
            Dim tp As String = [String].Format("{0:C}", tipValue)
            Dim tot As String = [String].Format("{0:C}", totValue)
            lblTip.Text = tp
            lblTotal.Text = tot

        End While

QuestionTerelik GridView Control using Vb.Net Pin
Johndas29-Dec-14 13:48
Johndas29-Dec-14 13:48 
QuestionGridview is out of content place holder Pin
sudevsu29-Dec-14 7:07
sudevsu29-Dec-14 7:07 
AnswerRe: Gridview is out of content place holder Pin
sudevsu30-Dec-14 4:21
sudevsu30-Dec-14 4:21 
Questionbest free Treeview Pin
mrkeivan29-Dec-14 0:02
mrkeivan29-Dec-14 0:02 
QuestionPage Loader Progress Bar Pin
smit66628-Dec-14 20:44
professionalsmit66628-Dec-14 20:44 
AnswerRe: Page Loader Progress Bar Pin
Richard MacCutchan28-Dec-14 22:16
mveRichard MacCutchan28-Dec-14 22:16 
QuestionHow to pass and use web page to an external class? Pin
QuickBooksDev28-Dec-14 7:21
QuickBooksDev28-Dec-14 7:21 
AnswerRe: How to pass and use web page to an external class? Pin
syed shanu28-Dec-14 13:43
mvasyed shanu28-Dec-14 13:43 
GeneralRe: How to pass and use web page to an external class? Pin
QuickBooksDev29-Dec-14 4:10
QuickBooksDev29-Dec-14 4:10 
AnswerRe: How to pass and use web page to an external class? Pin
Dominic Burford30-Dec-14 5:44
professionalDominic Burford30-Dec-14 5:44 
GeneralRe: How to pass and use web page to an external class? Pin
QuickBooksDev31-Dec-14 0:23
QuickBooksDev31-Dec-14 0:23 
GeneralRe: How to pass and use web page to an external class? Pin
Dominic Burford31-Dec-14 0:40
professionalDominic Burford31-Dec-14 0:40 
GeneralRe: How to pass and use web page to an external class? Pin
QuickBooksDev31-Dec-14 1:36
QuickBooksDev31-Dec-14 1:36 
GeneralRe: How to pass and use web page to an external class? Pin
Dominic Burford31-Dec-14 1:56
professionalDominic Burford31-Dec-14 1:56 
GeneralRe: How to pass and use web page to an external class? Pin
QuickBooksDev4-Jan-15 5:35
QuickBooksDev4-Jan-15 5:35 
AnswerRe: How to pass and use web page to an external class? Pin
Ferd Really20-Jan-15 6:31
Ferd Really20-Jan-15 6:31 
GeneralRe: How to pass and use web page to an external class? Pin
QuickBooksDev20-Jan-15 7:11
QuickBooksDev20-Jan-15 7:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.