Hey everyone,
I am pretty new to visual basic and I'm currently taking a Business App Dev class at my university. We have a homework assignment that is not due until monday that im stuck on. Em pretty sure I have it setup correctly but for some reason I cannot get the total price to display anything other than 0.00. The program needs you to input units, click a wholesaler or retailer radio button and depending on your amount of units will determine your total order price. Can anyone look at this code and tell me where I'm going wrong or what I might be missing? Your help would be greatly appreciated.
Name: ScreenShot001.bmp Views: 10 Size: 285.8 KB
Option Explicit On
Option Strict Off
Option Infer On
Public Class JohnsonProject
Private Sub calculateButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles calculateButton.Click
Dim unitsTextBox As Decimal
Dim orderprice As Integer
Dim price As Decimal
Dim quantity As Integer
Dim wholesaler As Integer
Dim retailer As Integer
Integer.TryParse(wholesalerRadioButton.Checked, wholesaler)
Integer.TryParse(retailerRadioButton.Checked, retailer)
Integer.TryParse(unitsTextBox, quantity)
Integer.TryParse(orderprice, price)
Select Case unitsTextBox
Case retailerRadioButton.Checked()
Case 1 To 4
orderprice = 10D
Case Is >= 5
orderprice = 9D
End Select
Select Case unitsTextBox
Case wholesalerRadioButton.Checked()
Case 1 To 3
orderprice = 15D
Case 4 To 8
orderprice = 14D
Case Is >= 9
orderprice = 12D
End Select
orderprice = price * quantity
orderPriceLabel.Text = Convert.ToInt32(orderprice)
End Sub
Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click
Me.Close()
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles orderPriceLabel.Click
End Sub
End Class
I am pretty new to visual basic and I'm currently taking a Business App Dev class at my university. We have a homework assignment that is not due until monday that im stuck on. Em pretty sure I have it setup correctly but for some reason I cannot get the total price to display anything other than 0.00. The program needs you to input units, click a wholesaler or retailer radio button and depending on your amount of units will determine your total order price. Can anyone look at this code and tell me where I'm going wrong or what I might be missing? Your help would be greatly appreciated.
Name: ScreenShot001.bmp Views: 10 Size: 285.8 KB
Option Explicit On
Option Strict Off
Option Infer On
Public Class JohnsonProject
Private Sub calculateButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles calculateButton.Click
Dim unitsTextBox As Decimal
Dim orderprice As Integer
Dim price As Decimal
Dim quantity As Integer
Dim wholesaler As Integer
Dim retailer As Integer
Integer.TryParse(wholesalerRadioButton.Checked, wholesaler)
Integer.TryParse(retailerRadioButton.Checked, retailer)
Integer.TryParse(unitsTextBox, quantity)
Integer.TryParse(orderprice, price)
Select Case unitsTextBox
Case retailerRadioButton.Checked()
Case 1 To 4
orderprice = 10D
Case Is >= 5
orderprice = 9D
End Select
Select Case unitsTextBox
Case wholesalerRadioButton.Checked()
Case 1 To 3
orderprice = 15D
Case 4 To 8
orderprice = 14D
Case Is >= 9
orderprice = 12D
End Select
orderprice = price * quantity
orderPriceLabel.Text = Convert.ToInt32(orderprice)
End Sub
Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click
Me.Close()
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles orderPriceLabel.Click
End Sub
End Class