📄 wbltimesheets.vb
字号:
Public Class WBLTimeSheets
Implements IDisposable
#Region " Class Level Variables "
Private objWDATimeSheets As WroxDataAccess.WDATimeSheets
#End Region
#Region " Constructor and Destructor "
Public Sub New(ByVal Company As String, ByVal Application As String)
objWDATimeSheets = New WroxDataAccess.WDATimeSheets(Company, Application)
End Sub
Public Sub Dispose() Implements System.IDisposable.Dispose
objWDATimeSheets.Dispose()
objWDATimeSheets = Nothing
End Sub
#End Region
#Region " Public TimeSheet Functions "
Public Function GetTimeSheet(ByVal UserID As Guid, _
ByVal WeekEndingDate As Date) As DataSet
Try
'Call the data component to get a user timesheet
GetTimeSheet = objWDATimeSheets.GetTimeSheet(UserID, WeekEndingDate)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function AddTimeSheet(ByVal TimeSheet As DataSet) As Boolean
Try
'Call the data component to add the new group
Return objWDATimeSheets.AddTimeSheet(TimeSheet)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function SaveTimeSheet(ByVal TimeSheet As DataSet) As Boolean
Try
'Call the data component to save the timesheet
Return objWDATimeSheets.SaveTimeSheet(TimeSheet)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function SubmitTimeSheet(ByVal TimeSheetID As Guid) As Boolean
Try
'Call the data component to submit the timesheet
Return objWDATimeSheets.SubmitTimeSheet(TimeSheetID)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function ApproveTimeSheet(ByVal TimeSheetID As Guid, _
ByVal ManagerID As Guid) As Boolean
Try
'Call the data component to approve the timesheet
Return objWDATimeSheets.ApproveTimeSheet(TimeSheetID, ManagerID)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function GetManagerName(ByVal ManagerID As Guid) As String
Try
'Call the data component to get the manager's name
GetManagerName = objWDATimeSheets.GetManagerName(ManagerID)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function TimeSheetsDue(ByVal ManagerID As Guid, _
ByVal WeekEndingDate As Date) As DataSet
Try
'Call the data component to get all timesheets that have
'not been submitted for the given week ending date
TimeSheetsDue = objWDATimeSheets.TimeSheetsDue( _
ManagerID, WeekEndingDate)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function TimeSheetsSubmitted(ByVal ManagerID As Guid, _
ByVal WeekEndingDate As Date) As DataSet
Try
'Call the data component to get all timesheets that have
'been submitted for the given week ending date
TimeSheetsSubmitted = objWDATimeSheets.TimeSheetsSubmitted( _
ManagerID, WeekEndingDate)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function TimeSheetsMTD(ByVal ManagerID As Guid) As DataSet
Try
'Call the data component to get all timesheets that have
'been submitted for the current month
TimeSheetsMTD = objWDATimeSheets.TimeSheetsMTD(ManagerID)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function TimeSheetsQTD(ByVal ManagerID As Guid) As DataSet
Try
'Call the data component to get all timesheets that have
'been submitted for the current quarter
TimeSheetsQTD = objWDATimeSheets.TimeSheetsQTD(ManagerID)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
Public Function TimeSheetsYTD(ByVal ManagerID As Guid) As DataSet
Try
'Call the data component to get all timesheets that have
'been submitted for the current year
TimeSheetsYTD = objWDATimeSheets.TimeSheetsYTD(ManagerID)
Catch ExceptionErr As Exception
Throw New System.Exception(ExceptionErr.Message, _
ExceptionErr.InnerException)
End Try
End Function
#End Region
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -