Advertisement
LettuceCookie

WeeklyProject2: JM Sales Ver. 1

Nov 19th, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Program Name: WK12- Project 2: JM Sales
  2. 'AUTHOR: STONEBONETHONE
  3. 'DATE:  November, 2017
  4. 'OVERVIEW: Program calculates user entered sales made by 5 employees, who all have a salesID
  5. 'The ID and total sales of the employee are calculated and displayed in a results textbox (edit)
  6.  
  7. Option Explicit On
  8. Option Infer Off
  9. Option Strict On
  10.  
  11. Public Class Form1
  12.  
  13.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
  14.         salesIDListBox.Items.Add("101")
  15.         salesIDListBox.Items.Add("112")
  16.         salesIDListBox.Items.Add("203")
  17.         salesIDListBox.Items.Add("301")
  18.         salesIDListBox.Items.Add("302")
  19.  
  20.  
  21.         '(from when the salesIDs were part of an array)
  22.        'Dim highestSub As Integer = salesID.GetUpperBound(0)
  23.        'For subscript As Integer = 0 To highestSub
  24.        '    salesIDListBox.Items.Add(salesID(subscript))
  25.        'Next
  26.  
  27.     End Sub
  28.  
  29.     Private Sub addToTotalButton_Click(sender As Object, e As EventArgs) Handles addToTotalButton.Click
  30.         'CAN THIS BE IN A SEP. PROCEDURE AND BROUGHT HERE????
  31.  
  32.         'This is the array for the sales made
  33.        Dim salesMade(4) As Double
  34.  
  35.         'This is part of the loop to add the array amounts to the listbox items
  36.        Dim highestSub As Integer = salesMade.GetUpperBound(0)
  37.         Dim subscript As Integer
  38.  
  39.         'Convert the listbox items to Double variables to hold the indv. elements
  40.  
  41.  
  42.         'This loop will add the sales amounts to the  'DCHECK!!!!!
  43.        'Perhaps right, but is just need one at a time, maybe no loop
  44.        Do While subscript <= highestSub
  45.             Double.TryParse(enterSalesTextBox.Text, salesMade(subscript))
  46.             enterSalesTextBox.Text = String.Empty 'NEED?????
  47.            'send each element to each corresponding item
  48.            subscript += 1
  49.         Loop
  50.  
  51.  
  52.     End Sub
  53.  
  54.     Private Sub CreateTheReport(sender As Object, e As EventArgs) Handles createReportButton.Click
  55.         ''Display the IDs and their corresponding sales amounts (NOT MONEY)
  56.        'Dim fillerVariable As Integer
  57.        'Dim highestSub As Integer
  58.        'Dim subscript As Integer
  59.  
  60.         ''  For fillerVariable = 0 To salesIDListBox.SelectedItems.Count - 1 'Need - 1?
  61.        ''salesTotalTextBox.Text &= salesIDListBox.SelectedItems.ToString()
  62.        '' Next
  63.  
  64.  
  65.         'salesTotalTextBox =
  66.  
  67.  
  68.         'Calculate the total sales amount based on all the sales
  69.  
  70.  
  71.  
  72.     End Sub
  73.  
  74.  
  75. End Class
  76. ''This is placed here so that only other private subs can use it 'should it be an array?
  77. 'Private salesID() As String = {"101", "112", "203", "301", "302"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement