Advertisement
LettuceCookie

WeeklyProject2: JM Sales Ver. 2

Nov 21st, 2017
147
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: 19 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.     'This is the array for the sales made
  14.    Dim salesMade(4) As Decimal
  15.  
  16.  
  17.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
  18.         salesIDListBox.Items.Add("101")
  19.         salesIDListBox.Items.Add("112")
  20.         salesIDListBox.Items.Add("203")
  21.         salesIDListBox.Items.Add("301")
  22.         salesIDListBox.Items.Add("302")
  23.  
  24.     End Sub
  25.  
  26.     Private Sub addToTotalButton_Click(sender As Object, e As EventArgs) Handles addToTotalButton.Click
  27.  
  28.         Dim sales As Decimal
  29.  
  30.         'This will convert the enter tbox text to decimals
  31.        Decimal.TryParse(enterSalesTextBox.Text, sales)
  32.  
  33.         'This will add to the sales in each array element, correspodning to the listbox indexes
  34.        salesMade(salesIDListBox.SelectedIndex) += sales
  35.  
  36.  
  37.  
  38.     End Sub
  39.  
  40.     Private Sub CreateTheReport(sender As Object, e As EventArgs) Handles createReportButton.Click
  41.  
  42.         'Parts of the loop used for cycling through each array element and item
  43.        Dim highestSub As Integer = salesMade.GetUpperBound(0)
  44.         Dim subscript As Integer = 0
  45.  
  46.         'Convert the array elements to strings
  47.        salesMade
  48.  
  49.  
  50.  
  51.         'Here each element of the array must be cycled through, and the elements & items printed
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.     End Sub
  59.  
  60.  
  61. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement