Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Strict On
- Public Class Form1
- 'Roshelle Cunningham
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- 'clears the information
- lstInvoice.Items.Clear()
- 'program reads and opens the txt file
- Dim sr As IO.StreamReader
- sr = IO.File.OpenText("C:\Temp\Resort.txt")
- 'variables
- Dim cboName, cboPhone As String
- 'txt values added to the input boxes
- Do While sr.Peek <> -1
- cboName = sr.ReadLine
- cboPhone = sr.ReadLine
- sr.ReadLine()
- sr.ReadLine()
- sr.ReadLine()
- sr.ReadLine()
- sr.ReadLine()
- sr.ReadLine()
- 'sorts and lists the txt information
- cboGuestSearch.Sorted = True
- cboGuestSearch.Items.Add(cboName & " " & cboPhone)
- Loop
- 'close the txt file
- sr.Close()
- End Sub
- Private Sub RetrieveData() Handles cboGuestSearch.SelectedIndexChanged
- 'program reads and opens the txt file
- Dim sr As IO.StreamReader
- sr = IO.File.OpenText("C:\Temp\Resort.txt")
- Dim strSearchID As String
- Dim strName, strPhone, strAdults, strDate, strKids, strNights, strMeal, strMembership As String
- strSearchID = GetPhone() 'return
- Do While sr.Peek <> -1
- If strSearchID <> strPhone Then
- strName = sr.ReadLine
- strPhone = sr.ReadLine
- strAdults = sr.ReadLine
- strDate = sr.ReadLine
- strKids = sr.ReadLine
- strNights = sr.ReadLine
- strMeal = sr.ReadLine
- strMembership = sr.ReadLine
- End If
- Exit Do
- End Sub
- Private Function GetPhone() As String
- Dim strPhoneNumber As String = cboGuestSearch.SelectedItem.ToString
- Dim bytePhone As Byte
- bytePhone = CByte(strPhoneNumber.IndexOf(" ")) + CByte(1) 'gets rid of the first name
- strPhoneNumber = strPhoneNumber.Substring(bytePhone) 'gets rid of the last name
- bytePhone = CByte(strPhoneNumber.IndexOf(" ")) + CByte(1)
- strPhoneNumber = strPhoneNumber.Substring(bytePhone)
- Return strPhoneNumber
- End Function
- Private Sub ProduceInvoice()
- End Sub
- Private Sub btnPrepareInvoice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrepareInvoice.Click
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement