All pastes #792967 Raw Edit

Stuff

public text v1 · immutable
·published 2007-11-21 21:05 UTC
rendered paste body
Public Class Form1
    Dim itemUPC(-1) As String
    Dim itemQuantity(-1) As String
    Dim itemName(,) As String = {{"0921115150", "Dark Chocolate Truffles"}, _
    {"2221001501", "Mint Meltaways"}, _
    {"6652300415", "Chocolate Covered Cherries"}, _
    {"0255541028", "Malted Milk Balls"}, _
    {"0921115141", "Chocolate Covered Raisins"}}

    Dim upc As String
    Dim quantity As String
    Dim item As String
    Dim totalquan(-1) As Integer
    Dim totquantemp As Integer

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        quantity = Me.txtQuantity.Text
        ReDim Preserve itemQuantity(itemQuantity.Length)
        itemQuantity(itemQuantity.Length - 1) = quantity

        upc = Me.txtUPC.Text
        ReDim Preserve itemUPC(itemUPC.Length)
        itemUPC(itemUPC.Length - 1) = upc



    End Sub

    Private Sub btnTotals_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTotals.Click
        Dim x As Integer

        'make it so quantity displays with the name of the treat thingy
        ' it displays the last quantity entered

        For x = 0 To itemUPC.Length - 1
            If itemName(x, 0) = itemUPC(x) Then
                item = itemName(x, 1)
                lstOrder.Items.Add(itemQuantity(x) & "  " & item)
            End If
        Next
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Close()
    End Sub
End Class