daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     Private seatsArray(3, 3) As Decimal
  2.     'Private currentsale As Decimal
  3.  
  4.  
  5.  
  6.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buyButton1.Click
  7.  
  8.  
  9.         Try
  10.  
  11.  
  12.             If SeatListBox1.SelectedItem.ToString = "Orchestra" Then
  13.                 seatsArray(1, 0) += Integer.Parse(AmountTicketTextBox1.Text)
  14.                 seatsArray(0, 0) += seatsArray(1, 0) * seatsArray(2, 0)
  15.                 seatsArray(3, 0) = Integer.Parse(AmountTicketTextBox1.Text) * seatsArray(2, 0)
  16.                 'currentsale = seatsArray(1, 0) * seatsArray(2, 0)
  17.             ElseIf SeatListBox1.SelectedItem.ToString = "Mezzanine" Then
  18.                 seatsArray(1, 1) += Integer.Parse(AmountTicketTextBox1.Text)
  19.                 seatsArray(0, 1) += seatsArray(1, 1) * seatsArray(2, 1)
  20.                 seatsArray(3, 0) = Integer.Parse(AmountTicketTextBox1.Text) * seatsArray(2, 1)
  21.                 ' currentsale = seatsArray(1, 1) * seatsArray(2, 1)
  22.             ElseIf SeatListBox1.SelectedItem.ToString = "General" Then
  23.                 seatsArray(1, 2) += Integer.Parse(AmountTicketTextBox1.Text)
  24.                 seatsArray(0, 2) += seatsArray(1, 2) * seatsArray(2, 2)
  25.                 seatsArray(3, 0) = Integer.Parse(AmountTicketTextBox1.Text) * seatsArray(2, 2)
  26.                 '  currentsale = seatsArray(1, 2) * seatsArray(2, 2)
  27.             ElseIf SeatListBox1.SelectedItem.ToString = "Balcony" Then
  28.                 seatsArray(1, 3) += Integer.Parse(AmountTicketTextBox1.Text)
  29.                 seatsArray(0, 3) += seatsArray(1, 3) * seatsArray(2, 3)
  30.                 seatsArray(3, 0) = Integer.Parse(AmountTicketTextBox1.Text) * seatsArray(2, 3)
  31.                 ' currentsale = seatsArray(1, 3) * seatsArray(2, 3)
  32.             End If
  33.             AmountTicketTextBox1.Text = 1
  34.             MessageBox.Show("Thank you for the purchase" & ControlChars.NewLine & "Total: " & seatsArray(3, 0).ToString("C"))
  35.  
  36.  
  37.         Catch ex As Exception
  38.             MessageBox.Show("Please enter a correct value")
  39.         End Try
  40.     End Sub
  41.  
  42.     Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
  43.  
  44.     End Sub
  45.  
  46.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  47.         'seat prices
  48.         seatsArray(2, 0) = 40D
  49.         seatsArray(2, 1) = 27.5
  50.         seatsArray(2, 2) = 15D
  51.         seatsArray(2, 3) = 10D
  52.  
  53.     End Sub
RAW Paste Data
Top