473,382 Members | 1,258 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

What am I doing Wrong?

Expand|Select|Wrap|Line Numbers
  1. [CODE Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
  2.         btnCalculate.Enabled = True
  3.         btnCustomer.Enabled = False
  4.  
  5.         Dim decTotal As Decimal
  6.         Dim intHours As Integer
  7.  
  8.         intHours = CInt(txtHours.Text)
  9.  
  10.         If CInt(txtHours.Text) > 744 Then
  11.             MessageBox.Show("Monthly Hours Can't Exceed 744")
  12.             txtHours.Text = String.Empty
  13.             lblTotal.Text = String.Empty
  14.         End If
  15.         If radA.Checked = False AndAlso radB.Checked = False AndAlso radC.Checked = False Then
  16.             MessageBox.Show("Please select an internet package to proceed")
  17.             btnTotal.Enabled = False
  18.         End If
  19.  
  20.  
  21.  
  22.  
  23.         If radA.Checked AndAlso intHours > 10 Then
  24.             decTotal = CDec((9.95 + ((intHours - 10) * 2)))
  25.         ElseIf radA.Checked AndAlso intHours <= 10 Then
  26.             decTotal = CDec(9.95)
  27.         End If
  28.  
  29.         If radB.Checked AndAlso intHours > 20 Then
  30.             decTotal = CDec((14.95 + ((intHours - 20) * 1)))
  31.         ElseIf radB.Checked AndAlso intHours <= 20 Then
  32.             decTotal = CDec(14.95)
  33.         End If
  34.         If radC.Checked Then
  35.             decTotal = CDec(19.95)
  36.         End If
  37.  
  38.  
  39.         lblTotal.Text = decTotal.ToString("c")
  40.         If (txtHours.Text.Length > 0) Then
  41.             intHours = CInt(txtHours.Text)
  42.         Else
  43.             MsgBox("Please enter an amount of hours")
  44.             Exit Sub
  45.         End If
  46.  
  47.     End Sub
  48.     Private Sub btnTotal_Click(sender As Object, e As EventArgs) Handles btnTotal.Click
  49.         Dim decPackA As Integer
  50.         Dim decPackB As Integer
  51.         Dim decPackC As Integer
  52.         Dim decPackAHours As Integer
  53.         Dim decPackBHours As Integer
  54.         Dim decPackCHours As Integer
  55.         Dim GrandTotal As Integer
  56.         Dim inthours As Integer
  57.         Dim decTotal As Integer
  58.  
  59.         If radA.Checked AndAlso inthours > 10 Then
  60.             decTotal = CInt(CDec((9.95 + ((inthours - 10) * 2))))
  61.             decPackA = decPackA + decTotal
  62.             decPackAHours = decPackAHours + inthours
  63.         ElseIf radA.Checked AndAlso inthours <= 10 Then
  64.             decTotal = CInt(CDec(9.95))
  65.             decPackA = decPackA + decTotal
  66.             decPackAHours = decPackAHours + inthours
  67.         End If
  68.  
  69.         If radB.Checked AndAlso inthours > 20 Then
  70.             decTotal = CInt(CDec((14.95 + ((inthours - 20) * 1))))
  71.             decPackB = decPackB + decTotal
  72.             decPackBHours = decPackBHours + inthours
  73.         End If
  74.         If radC.Checked AndAlso inthours <= 20 Then
  75.             decTotal = CInt(CDec(19.95))
  76.             decPackC = decPackC + decTotal
  77.             decPackCHours = decPackCHours + inthours
  78.             GrandTotal = decPackA + decPackB + decPackC
  79.         End If
  80.     End Sub
  81.     Private Sub btnReset_Click(sender As Object, e As EventArgs) Handles btnReset.Click
  82.         radA.Checked = False
  83.         radB.Checked = False
  84.         radC.Checked = False
  85.         cbNonProfit.Checked = False
  86.         lblTotal.Text = String.Empty
  87.         txtHours.Text = String.Empty
  88.         txtName.Clear()
  89.         txtCityState.Clear()
  90.         txtName.Focus()
  91.         btnCustomer.Enabled = True
  92.         btnCalculate.Enabled = False
  93.         btnTotal.Enabled = False
  94.     End Sub
  95.  
  96.     Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
  97.         Dim GrandTotal As Integer
  98.         Dim decPackA, decPackB, decPackC As Decimal
  99.  
  100.         GrandTotal = CInt(decPackA + decPackB + decPackC)
  101.  
  102.         GrandTotal = CInt("Package A: " & decPackA.ToString("c"))
  103.         GrandTotal = CInt("Package B: " & decPackB.ToString("c"))
  104.         GrandTotal = CInt("Package C: " & decPackC.ToString("c"))
  105.         Me.Close()
  106.     End Sub]
[/code]
I am trying to get a messagebox in the Click even exit button to display with Package = hours = price it is not working
Mar 25 '16 #1
0 3200

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Vic | last post by:
Dear All, I found this code snippet on this list (taken from a nice webpage of a courteous fellow), which I used to filter a form on a combo box. I wanted to repeat the same code to have an...
2
by: Aaron Ackerman | last post by:
I cannot a row to this bound DataGrid to SAVE MY LIFE! I have tried everything and I am at a loss. The using goes into add mode with the add button adds his data then updates with the update...
2
by: Phil Certain | last post by:
Hi, Relative newbie to .Net but experienced with classic ASP. I am trying to create a simple business object to contain commonly used functions. This is what I have done: 1 - Created a simple...
2
by: vvenk | last post by:
Hello: I have the following code: Dim lsFilter As String = Nothing Select Case rblStatus.SelectedItem.Value Case "S" lsFilter = String.Concat("D_STAT_CD_C = '", "N'") Case "R" lsFilter =...
0
by: Steve | last post by:
I have a gridview which uses an objectdatasource for its select and delete. The delete command uses the function below. The delete itself works but the extra logic which requires parameters...
8
by: watkinsdev | last post by:
Hi, I have created a mesh class in visual studio 6.0 c++. I can create a device, render objects and can edit the objects by for instancnce selecting a cluster of vertices and processing the...
0
by: shapper | last post by:
Hello, I am creating a class with a control. I compiled the class and used it on an Asp.Net 2.0 web site page. I can see the begin and end tags of my control (<oland </ol>) but somehow the...
16
by: SirG | last post by:
I'm looking for an explanation of why one piece of code works and another does not. I have to warn you that this is the first piece of Javascript I've ever written, so if there is a better way or a...
10
by: Enkidu | last post by:
Beginner question, sorry! I am using indexers to access an array of StringBuilders in an instance of a class: Getting: value = board1; Setting: board1 = value1 ;
10
by: DavidSeck.com | last post by:
Hi, I am working with the Facebook API right now, an I have kind of a problem, but I don't know what I am doing wrong. So I have a few arrays, f.ex.: User albums: array(2) {
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.