This commit is contained in:
Thoscellen
2020-05-16 17:38:46 +02:00
parent e497ffc1e1
commit c66626ff3a
139 changed files with 9396 additions and 1 deletions

View File

@@ -0,0 +1,97 @@
Public Class BabySitter
Inherits Person
Private _phone1 As String
Public Property phone1() As String
Get
Return _phone1
End Get
Set(ByVal value As String)
_phone1 = value
End Set
End Property
Private _phone2 As String
Public Property phone2() As String
Get
Return _phone2
End Get
Set(ByVal value As String)
_phone2 = value
End Set
End Property
Private _meet1 As Meet
Public Property meet1() As Meet
Get
Return _meet1
End Get
Set(ByVal value As Meet)
_meet1 = value
End Set
End Property
Private _meet2 As Meet
Public Property meet2() As Meet
Get
Return _meet2
End Get
Set(ByVal value As Meet)
_meet2 = value
End Set
End Property
Private _meet3 As Meet
Public Property meet3() As Meet
Get
Return _meet3
End Get
Set(ByVal value As Meet)
_meet3 = value
End Set
End Property
'Private _meet1 As Integer
'Public Property meet1() As Integer
' Get
' Return _meet1
' End Get
' Set(ByVal value As Integer)
' _meet1 = value
' End Set
'End Property
'Private _meet2 As Integer
'Public Property meet2() As Integer
' Get
' Return _meet2
' End Get
' Set(ByVal value As Integer)
' _meet2 = value
' End Set
'End Property
'Private _meet3 As Integer
'Public Property meet3() As Integer
' Get
' Return _meet3
' End Get
' Set(ByVal value As Integer)
' _meet3 = value
' End Set
'End Property
<Obsolete("This method is deprecated, use New with the id parameter insead")>
Public Sub New(id As Integer, fname As String, lname As String, gender As Boolean, address As String, phone1 As String, Optional phone2 As String = Nothing)
MyBase.New(id, fname, lname, gender, address)
Me.phone1 = phone1
Me.phone2 = phone2
End Sub
Public Sub New(id As Integer)
MyBase.New(id)
End Sub
End Class

View File

@@ -0,0 +1,57 @@
Public Class Child
Inherits Person
Private _bornDate As Date
Public Property bornDate() As Date
Get
Return _bornDate
End Get
Set(ByVal value As Date)
_bornDate = value
End Set
End Property
Private _parent1 As Parent
Public Property parent1() As Parent
Get
Return _parent1
End Get
Set(ByVal value As Parent)
_parent1 = value
End Set
End Property
Private _parent2 As Parent
Public Property parent2() As Parent
Get
Return _parent2
End Get
Set(ByVal value As Parent)
_parent2 = value
End Set
End Property
Private _meet As Meet
Public Property meet() As Meet
Get
Return _meet
End Get
Set(ByVal value As Meet)
_meet = value
End Set
End Property
<Obsolete("This method is deprecated, use New with the id parameter insead")>
Public Sub New(id As Integer, fname As String, lname As String, gender As Boolean, address As String, born As Date, meet As Meet, Optional parent1 As Parent = Nothing, Optional parent2 As Parent = Nothing)
MyBase.New(id, fname, lname, gender, address)
Me.bornDate = born
Me.meet = meet
Me.parent1 = parent1
Me.parent2 = parent2
End Sub
Public Sub New(id As Integer)
MyBase.New(id)
End Sub
End Class

View File

@@ -0,0 +1,140 @@
Public Class Meet
Private _id As Integer
Public ReadOnly Property id() As Integer
Get
Return _id
End Get
End Property
Private _weekdays As New Dictionary(Of String, Boolean)
Public ReadOnly Property weekdays() As Dictionary(Of String, Boolean)
Get
Return _weekdays
End Get
End Property
Public Sub New(id As Integer)
_id = id
_weekdays.Add("monday", False)
_weekdays.Add("tuesday", False)
_weekdays.Add("wednesday", False)
_weekdays.Add("thursday", False)
_weekdays.Add("friday", False)
_weekdays.Add("saturday", False)
_weekdays.Add("sunday", False)
End Sub
Public Sub New(weekDayName As String, Optional weekDayName2 As String = Nothing, Optional weekDayName3 As String = Nothing, Optional weekDayName4 As String = Nothing, Optional weekDayName5 As String = Nothing, Optional weekDayName6 As String = Nothing, Optional weekDayName7 As String = Nothing)
If Not weekDayName Is Nothing And _weekdays.ContainsKey(weekDayName.ToLower) Then
_weekdays(weekDayName) = True
End If
If Not weekDayName2 Is Nothing And _weekdays.ContainsKey(weekDayName2.ToLower) Then
_weekdays(weekDayName2) = True
End If
If Not weekDayName3 Is Nothing And _weekdays.ContainsKey(weekDayName3.ToLower) Then
_weekdays(weekDayName3) = True
End If
If Not weekDayName4 Is Nothing And _weekdays.ContainsKey(weekDayName4.ToLower) Then
_weekdays(weekDayName4) = True
End If
If Not weekDayName5 Is Nothing And _weekdays.ContainsKey(weekDayName5.ToLower) Then
_weekdays(weekDayName5) = True
End If
If Not weekDayName6 Is Nothing And _weekdays.ContainsKey(weekDayName6.ToLower) Then
_weekdays(weekDayName6) = True
End If
If Not weekDayName7 Is Nothing And _weekdays.ContainsKey(weekDayName7.ToLower) Then
_weekdays(weekDayName7) = True
End If
End Sub
Public Property monday() As Boolean
Get
Return _weekdays("monday")
End Get
Set(ByVal value As Boolean)
_weekdays("monday") = value
End Set
End Property
Public Property tuesday() As Boolean
Get
Return _weekdays("tuesday")
End Get
Set(ByVal value As Boolean)
_weekdays("tuesday") = value
End Set
End Property
Public Property wednesday() As Boolean
Get
Return _weekdays("wednesday")
End Get
Set(ByVal value As Boolean)
_weekdays("wednesday") = value
End Set
End Property
Public Property thursday() As Boolean
Get
Return _weekdays("thursday")
End Get
Set(ByVal value As Boolean)
_weekdays("thursday") = value
End Set
End Property
Public Property friday() As Boolean
Get
Return _weekdays("friday")
End Get
Set(ByVal value As Boolean)
_weekdays("friday") = value
End Set
End Property
Public Property saturday() As Boolean
Get
Return _weekdays("saturday")
End Get
Set(ByVal value As Boolean)
_weekdays("saturday") = value
End Set
End Property
Public Property sunday() As Boolean
Get
Return _weekdays("sunday")
End Get
Set(ByVal value As Boolean)
_weekdays("sunday") = value
End Set
End Property
Public Overrides Function toString() As String
Return Me.monday + Me.tuesday + Me.wednesday + Me.thursday + Me.friday + Me.saturday + Me.sunday
End Function
Public Function overlap(anotherMeet As Meet) As Boolean
If anotherMeet Is Nothing Then Return False
Dim isOverlapped As Boolean = (Me.monday = True And anotherMeet.monday = True) Or
(Me.tuesday = True And anotherMeet.tuesday = True) Or
(Me.wednesday = True And anotherMeet.wednesday = True) Or
(Me.thursday = True And anotherMeet.thursday = True) Or
(Me.friday = True And anotherMeet.friday = True) Or
(Me.saturday = True And anotherMeet.saturday = True) Or
(Me.sunday = True And anotherMeet.sunday = True)
Return isOverlapped
End Function
End Class

View File

@@ -0,0 +1,24 @@
Public Class Parent
Inherits Person
Private _phone As String
Public Property phone() As String
Get
Return _phone
End Get
Set(ByVal value As String)
_phone = value
End Set
End Property
<Obsolete("This method is deprecated, use New with the id parameter insead")>
Public Sub New(id As Integer, fname As String, lname As String, gender As Boolean, phone As String, address As String)
MyBase.New(id, fname, lname, gender, address)
Me.phone = phone
End Sub
Public Sub New(id As Integer)
MyBase.New(id)
End Sub
End Class

View File

@@ -0,0 +1,68 @@
Public MustInherit Class Person
Private _id As Integer
Public ReadOnly Property id() As Integer
Get
Return _id
End Get
End Property
Private _firstName As String
Public Property firstname() As String
Get
Return _firstName
End Get
Set(ByVal value As String)
_firstName = value
End Set
End Property
Private _lastname As String
Public Property lastname() As String
Get
Return _lastname
End Get
Set(ByVal value As String)
_lastname = value
End Set
End Property
Private _gender As Boolean
Public Property gender() As Boolean
Get
Return _gender
End Get
Set(ByVal value As Boolean)
_gender = value
End Set
End Property
Private _address As String
Public Property address() As String
Get
Return _address
End Get
Set(ByVal value As String)
_address = value
End Set
End Property
Public Sub New(id As Integer, fname As String, lname As String, gender As Boolean, address As String)
Me._id = id
Me.firstname = fname
Me.lastname = lname
Me.gender = gender
Me.address = address
End Sub
Public Sub New(id As Integer)
Me._id = id
End Sub
Public Overrides Function toString() As String
Return Me.id.ToString + " ) " + Me.firstname + " " + Me.lastname
End Function
End Class