'Dim service As New ExchangeService(requestedServerVersion:=ExchangeVersion.Exchange2010)
Dim service As New ExchangeService(ExchangeVersion.Exchange2010_SP1)
Dim tmptype As String, tmpID As Integer, tmpEmail As String, tmpEvtDescription As String, tmpBody As String, tmpSchDate As Date, tmpEmpName As String
Dim tmpStatusDesc As String
Dim tmpPrtDescription As String, tmpLocDescription As String, tmpPosDescription As String, tmpTypDescription As String, tmpStDescription As String, tmpNotes As String
tmptype = Request.QueryString("Type")
tmpID = Request.QueryString("ID")
If Not IsDBNull(tmpID) And Not IsDBNull(tmptype) Then
Dim rs1 As OleDbDataReader
Dim sSql As String, tmpMessage As String = "", tmpNewStatus As String = ""
& "tblSchedule ON tblEmployees.empID = tblSchedule.schEmpID) ON tblEvents.evtID = tblSchedule.schEvtID) ON tblParts.prtID = tblSchedule.schPartsID) ON tblLocations.locID = tblSchedule.schLocID) ON " _
& "tblPositions.posID = tblSchedule.schPosID) ON tblScheduleStatus.stID = tblSchedule.schStatus) ON tblTypes.typID = tblSchedule.schTypID WHERE schSchID=" & tmpID
Conn = New cConnection()
rs1 = Conn.GetTempDataReader(sSql)
If rs1.Read() Then
tmpMessage = Session("TFProduction_Status_UserID") & " changed event status from "
Select Case rs1("schStatus")
Case 1
tmpMessage += "'Confirmed'"
Case 2
tmpMessage += "'Unconfirmed'"
Case 3
tmpMessage += "'Cannot Work'"
Case 4
tmpMessage += "'Tentative'"
End Select
tmpMessage += " to "
Select Case tmptype
Case "C"
sSql = "UPDATE tblSchedule SET schStatus = 1 WHERE schSchID = " & tmpID
tmpMessage += "'Confirmed'"
tmpNewStatus = "Confirmed"
Case "T"
sSql = "UPDATE tblSchedule SET schStatus = 4 WHERE schSchID = " & tmpID
tmpMessage += "'Tentative'"
tmpNewStatus = "Tentative"
Case "X"
sSql = "UPDATE tblSchedule SET schStatus = 3 WHERE schSchID = " & tmpID
tmpMessage += "'Cannot Work'"
tmpNewStatus = "Cannot Work"
Case "U"
sSql = "UPDATE tblSchedule SET schStatus = 2 WHERE schSchID = " & tmpID
'see if it already exists - if so, delete and re-add
Dim findResults As FindItemsResults(Of Appointment) = service.FindAppointments(WellKnownFolderName.Calendar, New CalendarView(tmpSchDate, tmpSchDate.AddHours(24)))
Dim items As New List(Of Item)()
For Each appointment As Appointment In findResults
' Dim findResults2 As FindItemsResults(Of Appointment) = service.FindAppointments(WellKnownFolderName.Calendar, New CalendarView(tmpSchDate, tmpSchDate.AddHours(24)))
' Dim items2 As New List(Of Item)()
' For Each appointment As Appointment In findResults2
Private Function ValidateCertificate(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
'Return True to force the certificate to be accepted.
Return True
End Function
Private Shared Function RedirectionUrlValaditionCallback(ByVal redirectionUrl As String) As Boolean