Public Function tlcSendEventInfo(ByVal tmpSchID As Long, ByRef tmpSchDate As Date, ByRef tmpEvtDescription As String, ByRef tmpPrtDescription As String, ByRef tmpCallTime As Date, _
ByRef tmpStartTime As Date, ByRef tmpEndTime As Date, ByRef tmpOutTime As Date, ByRef tmpLocDescription As String, ByRef tmpPosDescription As String, ByRef tmpStDescription As String, _
ByRef tmpTypDescription As String, ByRef tmpEmpName As String, ByRef tmpEmail As String, ByVal tmpAction As String, ByVal tmpStatus As String, ByVal tmpType As String, ByRef smtpStatus As Boolean, _
ByRef smtpMessage As String) As Integer
Dim tmpBody As String = "", strResult As String = ""
Dim appt As New AppointmentWebDav(tmpSchDate & " " & tmpCallTime, tmpSchDate & " " & tmpOutTime, tmpLocDescription, tmpBody, tmpLocDescription, Left(tmpEmail, InStr(tmpEmail, "@") - 1), tmpSchID, tmpAction, tmpStatus)
appt.SemdAppointment(strResult)
ew_Session("strResult") = strResult
smtpMessage = strResult
Else
Dim appt As New AppointmentWebDav(tmpSchDate & " " & tmpCallTime, tmpSchDate & " " & tmpOutTime, tmpLocDescription, tmpBody, tmpLocDescription, Left(tmpEmail, InStr(tmpEmail, "@") - 1), tmpSchID, tmpAction, "")
appt.SemdAppointment(strResult)
ew_Session("strResult") = strResult
smtpMessage = strResult
End If
ew_Session("strResult") = strResult
smtpMessage = strResult
End If
Return True
End Function
Public Function tlcGetEventInfo(ByVal tmpSchID As Long, ByRef tmpSchDate As Date, ByRef tmpEvtDescription As String, ByRef tmpPrtDescription As String, ByRef tmpCallTime As Date, _
ByRef tmpStartTime As Date, ByRef tmpEndTime As Date, ByRef tmpOutTime As Date, ByRef tmpLocDescription As String, ByRef tmpPosDescription As String, ByRef tmpStDescription As String, _
ByRef tmpTypDescription As String, ByRef tmpEmpName As String, ByRef tmpEmail As String, ByRef tmpStatus As String, ByRef tmpNotes As String) As Integer
Dim RsRow As OleDbDataReader
Dim sSql As String = "SELECT tblSchedule.schSchID, tblSchedule.schDate, tblEvents.evtDescription, tblParts.prtDescription, tblSchedule.schCallTime, tblSchedule.schStartTime, tblSchedule.schEndTime, " _
& "tblEvents.evtID = tblSchedule.schEvtID) ON tblEmployees.empID = tblSchedule.schEmpID) ON tblLocations.locID = tblSchedule.schLocID) ON tblParts.prtID = tblSchedule.schPartsID) ON " _
& "tblPositions.posID = tblSchedule.schPosID) ON tblScheduleStatus.stID = tblSchedule.schStatus) ON tblTypes.typID = tblSchedule.schTypID " _
Dim command As OleDbCommand = Conn.GetCommand(Sql)
Return command.ExecuteNonQuery()
End Function
Public Function tlcUpdateIsActive(ByVal tmpTableName As String, ByVal tmpKeyName As String, ByVal tmpColumnName As String, ByVal tmpKey As Long, ByVal tmpValue As Boolean) As Integer
Public Function tlcGetXDay(ByVal DOW As Integer, ByVal X As Integer, ByVal M As Integer, ByVal Y As Integer) As Integer
'Enter the day of week (DOW) you are wanting (0 = Sunday through 6 = Saturday).
'Enter X (an integer from 1 to N). First = 1, Second = 2, Third = 3, Fourth = 4, Fifth = 5... and so on. If the number is too high, it will just return the last DOW.
'M and Y are month and year respectively.
'For example, if you are looking for the last Tuesday of July 2009, you can do get_Xth_DOW(2,6,7,2009).
Dim numDays = tlcGetDaysInMonth(M, Y)
Dim add = 7 * (X - 1)
Dim firstDOW = Weekday(M & "/" & Y) - 1
Dim diff = firstDOW - DOW
Dim d = 1
If diff > 0 Then
d = d + (7 - diff)
End If
If diff < 0 Then
d = d + -1 * diff
End If
d = d + add
Do While d > numDays
d = d - 7
Loop
tlcGetXDay = d
End Function
Public Function tlcGetDaysInMonth(ByVal strMonth As Integer, ByVal strYear As Integer) As Integer
Dim strDays As Integer
Select Case CInt(strMonth)
Case 1, 3, 5, 7, 8, 10, 12
strDays = 31
Case 4, 6, 9, 11
strDays = 30
Case 2
If ((CInt(strYear) Mod 4 = 0 And _
CInt(strYear) Mod 100 <> 0) _
Or (CInt(strYear) Mod 400 = 0)) Then
strDays = 29
Else
strDays = 28
End If
End Select
tlcGetDaysInMonth = strDays
End Function
Public Function tlcCheckTime(ByRef strTime As String) As Integer
Dim pos As Integer, pos2 As Integer, AMPM As String
strTime = UCase(strTime)
If Right(strTime, 1) = "p" Or Right(strTime, 1) = "P" Or Right(strTime, 1) = "a" Or Right(strTime, 1) = "A" Then
strTime = strTime & "M"
End If
strTime = Replace(strTime, ".", ":")
pos = InStr(strTime, ":")
If pos <= 0 Then
If Right(strTime, 2) = "AM" Or Right(strTime, 2) = "PM" Then
pos2 = Len(strTime) - 2
If Mid(strTime, pos2, 1) = " " Then pos2 = pos2 - 1