'Dim service As New ExchangeService(requestedServerVersion:=ExchangeVersion.Exchange2010)
Dim service As New ExchangeService(ExchangeVersion.Exchange2010_SP1)
Dim tmpNewStatus As String
lDisplayRecs = 20
lRecRange = EW_PAGER_RANGE
lRecCnt = 0 ' Record count
' Search filters
Dim sSrchAdvanced As String = "" ' Advanced search filter
Dim sSrchBasic As String = "" ' Basic search filter
Dim sFilter As String = ""
sSrchWhere = "" ' Search WHERE clause
' Master/Detail
sDbMasterFilter = "" ' Master filter
sDbDetailFilter = "" ' Detail filter
' Create form object
ObjForm = New cFormObj
If IsPageRequest() Then ' Validate request
' Set up records per page dynamically
SetUpDisplayRecs()
' Handle reset command
ResetCmd()
' Check QueryString parameters
If ObjForm.GetValue("a_list") = "" Then ' Check if post back first
If ew_Get("a") <> "" Then
tblSchedule.CurrentAction = ew_Get("a")
If tblSchedule.CurrentAction = "confirm" Or tblSchedule.CurrentAction = "unconfirm" Or tblSchedule.CurrentAction = "cannotwork" Or tblSchedule.CurrentAction = "tentative" Then
Dim Sql As String, key As String, arRecKeys As String(), values As String
Dim command As OleDbCommand = Conn.GetCommand(Sql)
command.ExecuteNonQuery()
Conn.Dispose()
'Dim tlcsub As New AspNetMaker7_tfpssnet
'Dim intResult As Integer, tmpMessage As String
'Dim tmpSchDate As Date, tmpEvtDescription As String, tmpPrtDescription As String, tmpCallTime As Date
'Dim tmpStartTime As Date, tmpEndTime As Date, tmpOutTime As Date, tmpLocDescription As String, tmpPosDescription As String, tmpStDescription As String
'Dim tmpTypDescription As String, tmpEmpName As String, tmpEmail As String, tmpBody As String, tmpAction As String, tmpStatus As String, tmpType As String
'ew_SendEmail("prodservices@tfchurch.org", "tonyclayton@tfchurch.org", "", "", "PSS Event status change for " & ew_Session("TFProduction_Status_UserID"), tmpMessage, "html")
Dim tmpSchDate As Date, tmpEvtDescription As String, tmpPrtDescription As String, tmpCallTime As Date
Dim tmpStartTime As Date, tmpEndTime As Date, tmpOutTime As Date, tmpLocDescription As String, tmpPosDescription As String, tmpStDescription As String
Dim tmpTypDescription As String, tmpEmpName As String, tmpEmail As String, tmpBody As String, tmpAction As String = "", tmpStatus As String, tmpType As String, tmpNotes As String
Dim intResult As Integer, tmpMessage As String, smtpStatus As Boolean, smtpMessage As String
'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
Message = "EWS Appointment added to Outlook calendar."
End If
'If tmpType = "T" Then
' 'service.ImpersonatedUserId = Nothing
' 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
' Message = "EWS Appointment marked as Tentative in Outlook calendar."
' End If
' End If
' Next
' End If
'End If
End If
Catch ex As Exception
Message = ex.Message
End Try
End If
End If
Next
Page_Terminate("tblScheduleList.aspx")
ElseIf tblSchedule.CurrentAction = "mailAdd" Or tblSchedule.CurrentAction = "mailDel" Then
Dim key As String, arRecKeys As String(), values As String, strResult As String, intResult As Integer
Dim tmpSchDate As Date, tmpEvtDescription As String, tmpPrtDescription As String, tmpCallTime As Date, tmpNotes As String
Dim tmpStartTime As Date, tmpEndTime As Date, tmpOutTime As Date, tmpLocDescription As String, tmpPosDescription As String, tmpStDescription As String
Dim tmpTypDescription As String, tmpEmpName As String, tmpEmail As String, tmpBody As String, tmpAction As String, tmpStatus As String, tmpType As String
'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
Message = "EWS Appointment added to Outlook calendar."
Else
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
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
Dim result As Boolean = False
Dim redirectionuri As New Uri(redirectionURL)
If redirectionuri.Scheme = "https" Then
result = True
End If
Return result
End Function
'
' Set up number of records displayed per page
'
Sub SetUpDisplayRecs()
Dim sWrk As String
sWrk = ew_Get(EW_TABLE_REC_PER_PAGE)
If sWrk <> "" Then
If IsNumeric(sWrk) Then
lDisplayRecs = ew_ConvertToInt(sWrk)
Else
If ew_SameText(sWrk, "all") Then ' Display all records
lDisplayRecs = -1
Else
lDisplayRecs = 20 ' Non-numeric, load default
End If
End If
tblSchedule.RecordsPerPage = lDisplayRecs ' Save to Session
' Reset start position
lStartRec = 1
tblSchedule.StartRecordNumber = lStartRec
End If
End Sub
'
' Return Advanced Search WHERE based on QueryString parameters