Advertisement
GearedGeek

Untitled

Mar 27th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. Public Class frmBloodPressureReport
  2.  
  3. Public Shared intNumberOfPatient As Integer = 16
  4. Public Shared strPatientName(intNumberOfPatient) As String
  5. Private intBloodPressure(intNumberOfPatient) As Integer
  6.  
  7. Private Sub frmBloodPressureReport_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
  8.  
  9. Dim objReader As IO.StreamReader
  10. Dim strLocationAndNameOfFile As String = "C:\patient.txt"
  11.  
  12. Dim intCount As Integer = 0
  13. Dim intFill As Integer
  14.  
  15. If IO.File.Exists(strLocationAndNameOfFile) Then
  16. objReader = IO.File.OpenText(strLocationAndNameOfFile)
  17.  
  18. Do While objReader.Peek <> -1
  19. strPatientName(intCount) = objReader.ReadLine()
  20. intBloodPressure(intCount) = Convert.ToInt32(objReader.ReadLine())
  21.  
  22. 'Debugging
  23. Console.WriteLine(strPatientName(intCount))
  24. Console.WriteLine(intBloodPressure(intCount))
  25. Loop
  26.  
  27. objReader.Close()
  28.  
  29. For intFill = 0 To (strPatientName.Length - 1)
  30. 'lstPatientName.Items.Add(strPatientName(intCount))
  31. lstPatientName.Items.Add(strPatientName(intFill))
  32. Next
  33.  
  34. Else
  35. MsgBox("The file is not available. Restart the program when the file is available",, "Error")
  36. Close()
  37. End If
  38. End Sub
  39.  
  40. Private Sub mnuExit_Click(sender As Object, e As EventArgs) Handles mnuExit.Click
  41. 'The mnuExit click event closes the application
  42. Application.Exit()
  43. End Sub
  44.  
  45. Private Sub mnuDisplay_Click(sender As Object, e As EventArgs) Handles mnuDisplay.Click
  46. 'The mnuDisplay click event creates an instance of the frmDisplayPatient
  47. Dim frmSecond As New frmDisplayPatient
  48.  
  49. 'Hide this form and show the Display Patient Information
  50. Hide()
  51. frmSecond.ShowDialog()
  52. End Sub
  53.  
  54. Private Sub btnPatientCheck_Click(sender As Object, e As EventArgs) Handles btnPatientCheck.Click
  55. lblConsultDocument.Visible = True
  56. End Sub
  57.  
  58. Private Sub mnuClear_Click(sender As Object, e As EventArgs) Handles mnuClear.Click
  59. lstPatientName.Items.Clear()
  60. lblConsultDocument.Visible = False
  61. End Sub
  62. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement