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