Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Strict On
  2. Public Class Form1
  3.     'Roshelle Cunningham
  4.  
  5.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  6.         'clears the information
  7.        lstInvoice.Items.Clear()
  8.         'program reads and opens the txt file
  9.        Dim sr As IO.StreamReader
  10.         sr = IO.File.OpenText("C:\Temp\Resort.txt")
  11.         'variables
  12.        Dim cboName, cboPhone As String
  13.         'txt values added to the input boxes
  14.        Do While sr.Peek <> -1
  15.             cboName = sr.ReadLine
  16.             cboPhone = sr.ReadLine
  17.             sr.ReadLine()
  18.             sr.ReadLine()
  19.             sr.ReadLine()
  20.             sr.ReadLine()
  21.             sr.ReadLine()
  22.             sr.ReadLine()
  23.             'sorts and lists the txt information
  24.            cboGuestSearch.Sorted = True
  25.             cboGuestSearch.Items.Add(cboName & " " & cboPhone)
  26.         Loop
  27.         'close the txt file
  28.        sr.Close()
  29.     End Sub
  30.     Private Sub RetrieveData() Handles cboGuestSearch.SelectedIndexChanged
  31.         'program reads and opens the txt file
  32.        Dim sr As IO.StreamReader
  33.         sr = IO.File.OpenText("C:\Temp\Resort.txt")
  34.         Dim strSearchID As String
  35.         Dim strName, strPhone, strAdults, strDate, strKids, strNights, strMeal, strMembership As String
  36.         strSearchID = GetPhone() 'return
  37.  
  38.  
  39.         Do While sr.Peek <> -1
  40.             If strSearchID <> strPhone Then
  41.                 strName = sr.ReadLine
  42.                 strPhone = sr.ReadLine
  43.                 strAdults = sr.ReadLine
  44.                 strDate = sr.ReadLine
  45.                 strKids = sr.ReadLine
  46.                 strNights = sr.ReadLine
  47.                 strMeal = sr.ReadLine
  48.                 strMembership = sr.ReadLine
  49.             End If
  50.             Exit Do
  51.  
  52.  
  53.  
  54.     End Sub
  55.     Private Function GetPhone() As String
  56.         Dim strPhoneNumber As String = cboGuestSearch.SelectedItem.ToString
  57.         Dim bytePhone As Byte
  58.         bytePhone = CByte(strPhoneNumber.IndexOf(" ")) + CByte(1) 'gets rid of the first name
  59.        strPhoneNumber = strPhoneNumber.Substring(bytePhone) 'gets rid of the last name
  60.        bytePhone = CByte(strPhoneNumber.IndexOf(" ")) + CByte(1)
  61.         strPhoneNumber = strPhoneNumber.Substring(bytePhone)
  62.         Return strPhoneNumber
  63.     End Function
  64.    
  65.  
  66.     Private Sub ProduceInvoice()
  67.  
  68.     End Sub
  69.  
  70.     Private Sub btnPrepareInvoice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrepareInvoice.Click
  71.  
  72.     End Sub
  73. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement