0

Below is my Code, it just was working pretty much completely and I made one wrong click and now everything entirely is redlined. Did the system.web.UI.Page malfunction? What happened and how do I fix it?

For reference this is my first coding class in college in ASP.NET. We use Visual Studio.

Code Displaying BC30652

Partial Class Assingments_HW3_VehicleConfigurator
    Inherits System.Web.UI.Page


    'assigned global variables 
    Public Shared GdecTotalCharger, gdecTotalChallenger, gdecTotalDart, gdecTotalDurango, GdecTotalViper As Decimal

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim DecCarQuote, DecCommission As Decimal

        'error checking for if any of the options are not selected in a  message displays 
        If VehicleDropDownList.SelectedIndex = 0 OrElse PackageRBL.SelectedIndex = -1 OrElse WheelsTireRBL.SelectedIndex = -1 OrElse
               NavRBL.SelectedIndex = -1 OrElse AudioRBL.SelectedIndex = -1 OrElse PaintRBL.SelectedIndex = -1 OrElse
               UpPaintRBL.SelectedIndex = -1 OrElse stateRBL.SelectedIndex = -1 Then

            TxtOutput.Text = "Please make sure there is a selection for meach option"
            Exit Sub


        End If

        'selecte case for each individual vehichle 
        'if charger or durango added then 10% reduction nadded 
        'other cars normal priced
        'the case tals all options listed for a vehicle and adds themand sets the price for variable decCarQuote

        'global variables that keep count of quotes are there 

        Select Case VehicleDropDownList.SelectedItem.Text
            Case "Charger (Promotion Deal)"
                DecCarQuote = (VehicleDropDownList.SelectedValue + PackageRBL.SelectedValue + WheelsTireRBL.SelectedValue +
                    NavRBL.SelectedValue + AudioRBL.SelectedValue + UpPaintRBL.SelectedValue + PaintRBL.SelectedValue) * 0.9
                GdecTotalCharger += 1
            Case "Challenger (Promotion Deal) "
                DecCarQuote = (VehicleDropDownList.SelectedValue + PackageRBL.SelectedValue + WheelsTireRBL.SelectedValue +
                    NavRBL.SelectedValue + AudioRBL.SelectedValue + UpPaintRBL.SelectedValue + PaintRBL.SelectedValue) * 0.9
            Case "Dart"
                DecCarQuote = (VehicleDropDownList.SelectedValue + PackageRBL.SelectedValue + WheelsTireRBL.SelectedValue +
                    NavRBL.SelectedValue + AudioRBL.SelectedValue + UpPaintRBL.SelectedValue + PaintRBL.SelectedValue)
                gdecTotalDart += 1
            Case "Durango"
                DecCarQuote = (VehicleDropDownList.SelectedValue + PackageRBL.SelectedValue + WheelsTireRBL.SelectedValue +
                    NavRBL.SelectedValue + AudioRBL.SelectedValue + UpPaintRBL.SelectedValue + PaintRBL.SelectedValue)
                gdecTotalDurango += 1
            Case "Viper"
                DecCarQuote = (VehicleDropDownList.SelectedValue + PackageRBL.SelectedValue + WheelsTireRBL.SelectedValue +
                    NavRBL.SelectedValue + AudioRBL.SelectedValue + UpPaintRBL.SelectedValue + PaintRBL.SelectedValue)
                GdecTotalViper += 1
        End Select

        'take the car quoute and mulitpy by commision ammount. in this case 0.1% 
        DecCommission = (DecCarQuote * 0.01)

        ' Create a VIP Checkbox  for those that sell more 
        If VIP.Checked = True Then
            DecCommission = (DecCarQuote * 0.015)
        End If

        'Outut to main textBox 
        'shows message with car quoute and seletced values 
        'gives total +tax
        TxtOutput.Text = "Quote for Selected vehichles and Incl Accesories" & FormatCurrency(DecCarQuote * stateRBL.SelectedValue) &
        vbNewLine & "Total Commision" & FormatCurrency(DecCommission) & vbNewLine &
        vbNewLine & "Car Model" & VehicleDropDownList.SelectedItem.Text & vbNewLine &
       "Package" & PackageRBL.SelectedItem.Text & vbNewLine &
        "Wheels and Tires" & WheelsTireRBL.SelectedItem.Text & vbNewLine &
        "Navigation" & NavRBL.SelectedItem.Text & vbNewLine &
        "Audio System" & AudioRBL.SelectedItem.Text & vbNewLine &
        "Car Color" & PaintRBL.SelectedItem.Text & vbNewLine &
        "Upgraded Paint" & UpPaintRBL.SelectedItem.Text

        'Manager Running Totals 
        'fpr each vehichle 
        TxtRunningTotal.Text = "TotalQuotes" & vbNewLine &
        "Charger" & GdecTotalCharger & vbNewLine &
        "Challenger" & gdecTotalChallenger & vbNewLine &
        "Dart" & gdecTotalDart & vbNewLine &
        "Durango" & gdecTotalDurango & vbNewLine &
        "Viper" & GdecTotalViper

    End Sub



End Class
Dale K
  • 25,246
  • 15
  • 42
  • 71
  • **What errors** are you referring to? And _please_ try to do some troubleshooting yourself: for example, if you were to take a close-look at those red squiggly lines you'll see that they'll either start or end at a point in your code that has broken syntax, and check the Error List window too. – Dai Oct 01 '22 at 02:47
  • How on earth could we know? We can't see your visual studio... one hopes you are using version control, in which case just check what changed. – Dale K Oct 01 '22 at 03:05
  • 2
    @DaleK I don't have any high expectations for a course that's still teaching VB.NET and WebForms in 2022: I can only desribe _that_ as doing their students a great disservice... if they are even using source-control then I'll bet you a beer at the next in-person conference I see you at that it'll be something like CVS or [the-one-that-must-not-be-named](https://stackoverflow.com/q/1224537/159145)... – Dai Oct 01 '22 at 03:10

0 Answers0