Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET General

Post new topic   Reply to topic
I need some help with If/Then
View previous topic :: View next topic  
Author Message
krazykrisi
Newbie


Joined: 19 Oct 2005
Posts: 2

PostPosted: Oct 19th, 2005 11:52 AM    Post subject: I need some help with If/Then Reply with quote

Here is what I want to do:
Create a customer order entry system. The order taker will select the item to purchase and the quantity.
GIVEN:

Hammer $2.25 each Socket Set $12.00 each
*beep* Driver $1.75 each Compressor $125.00

By default the Apply Discount box is not seen

Calculate total calculates the total and determines of the discount box shows.

If Quantity is greater then 250 then display the discount group box and display on the 1% discount. Apply that discount to the total and display in the Label 2 area.

If the Quantity is greater then 500 then display only the 3% discount option, apply the 3% discount to the total and display in the Label 2 area.

Here is what I have for the calculate button event:

Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim dblHammer, dblScrewDriver, dblSocketSet, dblCompressor As Double
Dim dblQuantity As Double
Dim dblTotal As Double
dblTotal = Convert.ToDouble(lblTotal.Text)
dblHammer = 2.25
dblScrewDriver = 1.75
dblSocketSet = 12.0
dblCompressor = 125.0
dblQuantity = Convert.ToDouble(nudQuantity.Value)

If radHammer.Visible Then
dblTotal = dblHammer * dblQuantity
Else
If radScrewDriver.Visible Then
dblTotal = dblScrewDriver * dblQuantity
Else
If radSocketSet.Visible Then
dblTotal = dblSocketSet * dblQuantity
Else
If radCompressor.Visible Then
dblTotal = dblCompressor * dblQuantity
End If
End If
End If

End If
' If dblQuantity > 250 Then
'grpDiscount()
'End If

It runs but it doesn't work, what am I doing wrong?
Back to top
View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic