Question about Class Inheritance
I have a question about inherited classes. I have a class Days which has properties of days worked. I also have a class Hours which has properties of hours worked. (This might become more clear in the below code).
What I want is to create a Class called "ExemptEmployee", which inherits the Days class, and then set the properties contained in Days from within a method in the ExemptEmployee class. But when I type the "Me" keyword it doesn't work out. Can someone tell me if I'm on the right track with this? TIA!
================================================== =
Public Class ExemptEmployee
Inherits Days
Public Shared Sub FetchExemptEmployeeDays()
'sql fetch which gets the employee days from the Days table in
'the Timesheet database
Dim strSQL as String = "SELECT Regular_Days, Vacation_Days, Sick_Days, " & _
"Jury_Days, Funeral_Days, Holiday_Days, Unpaid_Days FROM " & _
"Days WHERE SSN = '" & s_SSN & "' AND Pay_Period_Number = " & s_PayPeriodNumber
Dim oConn as New SqlConnection(DSN.FetchDSN(DSN.DataBaseName.Timesh eet))
Dim oCmd as New SqlCommand
Dim oReader as SqlDataReader
With oCmd
.Connection.Open()
.CommandText=strSQL
.CommandType=CommandType.Text
.Connection=oConn
oReader = oCmd.ExecuteReader
While oReader.Read
'IN THIS LOOP I WANT TO SET PROPERTIES WHICH WOULD BE INHERITED FROM THE DAYS CLASS.
End While
End With
End Sub
End Class
================================================== ===========
Public Class Days
'regular days
Private dRegularDays as Integer
'vacation days
Private dVacationDays as Integer
'sick days
Private dSickDays as Integer
'holiday days
Private dHolidayDays as Integer
'jury
Private dJuryDays as Integer
'funeral
Private dFuneralDays as Integer
'Duty days
Private dDutyDays as Integer
'Duty weekends
Private dDutyWeekends as Integer
#Region " Property declarations "
Public Property RegularDays as Integer
Get
RegularDays = dRegularDays
End Get
Set
dRegularDays = Value
End Set
End Property
Public Property VacationDays as Integer
Get
VacationDays = dVacationDays
End Get
Set
dVacationDays = Value
End Set
End Property
Public Property SickDays as Integer
Get
SickDays = dSickDays
End Get
Set
dSickDays = Value
End Set
End Property
Public Property HolidayDays as Double
Get
HolidayDays = dHolidayDays
End Get
Set
dHolidayDays = Value
End Set
End Property
Public Property JuryDays as Double
Get
JuryDays = dJuryDays
End Get
Set
dJuryDays = Value
End Set
End Property
Public Property FuneralDays as Double
Get
FuneralDays = dFuneralDays
End Get
Set
dFuneralDays = Value
End Set
End Property
Public Property DutyDays as Integer
Get
DutyDays = dDutyDays
End Get
Set
dDutyDays = Value
End Set
End Property
Public Property DutyWeekends as Integer
Get
DutyWeekends = dDutyWeekends
End Get
Set
dDutyWeekends = Value
End Set
End Property
#End Region
End Class
"A spirit with a vision is a dream with a mission"
__________________
\"A spirit with a vision is a dream with a mission\"
|