-
Notifications
You must be signed in to change notification settings - Fork 0
/
Profile Page.vb
54 lines (47 loc) · 2.1 KB
/
Profile Page.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Public Class Profile_Page
Sub loadProfile()
Dim lines() As String = FileManipulator.readData(activeAccount.getUsername() & ".txt")
Dim listOfBookings As List(Of Appointment) = FileManipulator.ReadBookings(activeAccount.strName)
lblPetOwnerName.Text = activeAccount.strName
lblPetOwnerAge.Text = activeAccount.intAge
lblPetOwnerSex.Text = activeAccount.strSex
lblPetOwnerAddress.Text = activeAccount.strAddress
lblPetOwnerNumPets.Text = lines.Length
registeredPetsPanel.Controls.Clear()
schedulesPanel.Controls.Clear()
Dim noPetsLabel As Label
If lines.Length > 0 Then
For Each line In lines
Dim petObject As Pet = FileManipulator.parseAsPet(line)
Dim petPanel As New PetPanel(petObject)
registeredPetsPanel.Controls.Add(petPanel)
Next
Else
noPetsLabel = New Label()
noPetsLabel.Text = "No Registered Pets"
noPetsLabel.ForeColor = Color.White
noPetsLabel.Font = New Font("Microsoft Sans Serif", 12, FontStyle.Bold)
noPetsLabel.Margin = New Padding(15, 15, 0, 0)
noPetsLabel.AutoSize = True
registeredPetsPanel.Controls.Add(noPetsLabel)
End If
If listOfBookings.Count > 0 Then
For Each booking In listOfBookings
Dim apptPanel As New AppointmentPanel(booking)
schedulesPanel.Controls.Add(apptPanel)
Next
Else
Dim noApptsLabel As New Label()
noApptsLabel.Text = "No Appointment Schedules"
noApptsLabel.ForeColor = Color.White
noApptsLabel.Font = New Font("Microsoft Sans Serif", 12, FontStyle.Bold)
noApptsLabel.Margin = New Padding(15, 15, 0, 0)
noApptsLabel.AutoSize = True
schedulesPanel.Controls.Add(noApptsLabel)
End If
End Sub
Private Sub btnBackToHome_Click(sender As Object, e As EventArgs) Handles btnBackToHome.Click
Login_Page.Show()
NavigatorPage.Hide()
End Sub
End Class