Show / Hide Table of Contents

Interface IAppointmentUtility

Namespace: SuperOffice.Util
Assembly: SoDataBase.dll
Syntax
public interface IAppointmentUtility

Methods

AcceptAsync(int, RecurrenceUpdateMode, CancellationToken)

Declaration
Task AcceptAsync(int appointmentId, RecurrenceUpdateMode recurrenceUpdateMode, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
RecurrenceUpdateMode recurrenceUpdateMode
CancellationToken cancellationToken
Returns
Type Description
Task

CleanSynchronizerValuesFromDescription(string)

Cleaning function for stripping out prefix and dividing line InfoBridge added to their appointments

Declaration
string CleanSynchronizerValuesFromDescription(string description)
Parameters
Type Name Description
string description
Returns
Type Description
string

DeleteCancelledAsync(int, RecurrenceUpdateMode, CancellationToken)

Deletes appointment if it is cancelled.

Declaration
Task DeleteCancelledAsync(int appointmentId, RecurrenceUpdateMode recurrenceUpdateMode, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId

.

RecurrenceUpdateMode recurrenceUpdateMode

How recurrence updates should be handled

CancellationToken cancellationToken
Returns
Type Description
Task

GetAgenda(string, bool)

Declaration
string GetAgenda(string description, bool cleanDescription = false)
Parameters
Type Name Description
string description
bool cleanDescription
Returns
Type Description
string

GetAgendaHtml(string, bool)

Declaration
string GetAgendaHtml(string description, bool cleanDescription = false)
Parameters
Type Name Description
string description
bool cleanDescription
Returns
Type Description
string

GetAllAppointmentRowsOfRecurrenceRuleIDAsync(int, bool, CancellationToken)

Declaration
Task<AppointmentRow[]> GetAllAppointmentRowsOfRecurrenceRuleIDAsync(int recurrenceRuleId, bool motherAppointmentsOnly = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recurrenceRuleId
bool motherAppointmentsOnly
CancellationToken cancellationToken
Returns
Type Description
Task<AppointmentRow[]>

GetAppointmentIdFromRecurringIdAsync(int, CancellationToken)

Declaration
Task<int> GetAppointmentIdFromRecurringIdAsync(int recurringId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recurringId
CancellationToken cancellationToken
Returns
Type Description
Task<int>

GetAppointmentIdFromUIDAsync(string, CancellationToken)

Declaration
Task<int> GetAppointmentIdFromUIDAsync(string uid, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string uid
CancellationToken cancellationToken
Returns
Type Description
Task<int>

GetConnectionInfoAsync()

Declaration
Task<(ServiceAuthRecordData imap, ServiceAuthRecordData smtp, string sentFolder)> GetConnectionInfoAsync()
Returns
Type Description
Task<(ServiceAuthRecordData imap, ServiceAuthRecordData smtp, string sentFolder)>

GetDescription(string, string)

Declaration
string GetDescription(string title, string agenda)
Parameters
Type Name Description
string title
string agenda
Returns
Type Description
string

GetExistingInvitationIdFromUIDAsync(string, CancellationToken)

Declaration
Task<int> GetExistingInvitationIdFromUIDAsync(string uid, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string uid
CancellationToken cancellationToken
Returns
Type Description
Task<int>

GetInvitationRecordDataAsync(int, CancellationToken)

Declaration
Task<InvitationRecordData> GetInvitationRecordDataAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
CancellationToken cancellationToken
Returns
Type Description
Task<InvitationRecordData>

GetInvitationRecordDataFromUidAsync(string, CancellationToken)

Declaration
Task<InvitationRecordData> GetInvitationRecordDataFromUidAsync(string uid, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string uid
CancellationToken cancellationToken
Returns
Type Description
Task<InvitationRecordData>

GetInvitationRowFromUidAsync(string, CancellationToken)

Declaration
Task<InvitationRow> GetInvitationRowFromUidAsync(string uid, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string uid
CancellationToken cancellationToken
Returns
Type Description
Task<InvitationRow>

GetLastModifiedDateOfAppointment(AppointmentRow)

Returns the newest of the row's Registered and Updated fields. The fields are stored as UTC in the DB, but are converted to DB-TZ when retrieved by the system, so we don't have to do any conversion.

Declaration
DateTime GetLastModifiedDateOfAppointment(AppointmentRow row)
Parameters
Type Name Description
AppointmentRow row
Returns
Type Description
DateTime

GetOrCreateInvitationIdFromUIDAsync(string, CancellationToken)

Declaration
Task<(int, bool)> GetOrCreateInvitationIdFromUIDAsync(string uid, CancellationToken cancellationToken)
Parameters
Type Name Description
string uid
CancellationToken cancellationToken
Returns
Type Description
Task<(int, bool)>

GetOrCreateUidOfAppointmentAsync(int, string, DateTime, DateTime?, DateTime?, string, CancellationToken)

Declaration
Task<(string, int)> GetOrCreateUidOfAppointmentAsync(int appointmentId, string from, DateTime lastModified, DateTime? recurringStartDate, DateTime? recurringEndDate, string templateLanguage, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
string from
DateTime lastModified
DateTime? recurringStartDate
DateTime? recurringEndDate
string templateLanguage
CancellationToken cancellationToken
Returns
Type Description
Task<(string, int)>

GetOrganizerEmailAsync(int, CancellationToken)

Declaration
Task<string> GetOrganizerEmailAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
CancellationToken cancellationToken
Returns
Type Description
Task<string>

GetOrganizerInfoAsync(int, CancellationToken)

Declaration
Task<(string email, string fullname)> GetOrganizerInfoAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
CancellationToken cancellationToken
Returns
Type Description
Task<(string value, string tooltip)>

GetParticipantAsync(int, int, int, int, AppointmentStatus, bool, CancellationToken)

Declaration
Task<ParticipantInfo> GetParticipantAsync(int associateId, int personId, int contactId, int emailId, AppointmentStatus appointmentStatus, bool sendEmail, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int associateId
int personId
int contactId
int emailId
AppointmentStatus appointmentStatus
bool sendEmail
CancellationToken cancellationToken
Returns
Type Description
Task<ParticipantInfo>

GetRecurrenceRuleIdOfAppointmentIdAsync(int, CancellationToken)

Declaration
Task<int> GetRecurrenceRuleIdOfAppointmentIdAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
CancellationToken cancellationToken
Returns
Type Description
Task<int>

GetRecurringSeriesForInvitedEmailAttendeeAsync(int, int, CancellationToken)

Returns a RecurringSeries object containing recurring subseries that are related to the given recurrenceRuleId. The returned array is sorted by DoBy, ascending. I.e. the earliest subseries is the first item in the list.

Declaration
Task<RecurringSeries> GetRecurringSeriesForInvitedEmailAttendeeAsync(int recurrenceRuleId, int invitedEmailId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recurrenceRuleId
int invitedEmailId
CancellationToken cancellationToken
Returns
Type Description
Task<RecurringSeries>

GetRecurringSeriesForInvitedPersonAsync(int, int, CancellationToken)

Returns a RecurringSeries object containing recurring subseries that are related to the given recurrenceRuleId. The returned array is sorted by DoBy, ascending. I.e. the earliest subseries is the first item in the list.

Declaration
Task<RecurringSeries> GetRecurringSeriesForInvitedPersonAsync(int recurrenceRuleId, int invitedPersonId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recurrenceRuleId
int invitedPersonId
CancellationToken cancellationToken
Returns
Type Description
Task<RecurringSeries>

GetRecurringSeriesOnlyMotherAppointmentsAsync(int, CancellationToken)

Returns a RecurringSeries object containing recurring subseries that are related to the given recurrenceRuleId. The returned array is sorted by DoBy, ascending. I.e. the earliest subseries is the first item in the list.

Declaration
Task<RecurringSeries> GetRecurringSeriesOnlyMotherAppointmentsAsync(int recurrenceRuleId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recurrenceRuleId
CancellationToken cancellationToken
Returns
Type Description
Task<RecurringSeries>

GetTemplateLanguageAsync(int, CancellationToken)

SO Language code used for e-mail invites for this appointment.

Declaration
Task<string> GetTemplateLanguageAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
CancellationToken cancellationToken
Returns
Type Description
Task<string>

SO Language code ("US", "SW" or "GE") or NULL if appointment not found.

GetTitle(string, bool)

Declaration
string GetTitle(string description, bool cleanDescription = false)
Parameters
Type Name Description
string description
bool cleanDescription
Returns
Type Description
string

HasCalendarAccessAsync(int, int, CancellationToken)

Checks whether the active person has access to see someones calendar.

Declaration
Task<bool> HasCalendarAccessAsync(int activePersonId, int calendarOwnerId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int activePersonId

Person id of the active person (the one logged on).

int calendarOwnerId

The id of the person whose calendar the logged on user wants to see

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if access is allowed, false otherwise.

HaveChanged(string, string)

Declaration
bool HaveChanged(string dataContainerValue, string carrierValue)
Parameters
Type Name Description
string dataContainerValue
string carrierValue
Returns
Type Description
bool

ModifyOnRowsAsync(int, RecurrenceUpdateMode, RowModification, RowModification, CancellationToken)

Declaration
Task ModifyOnRowsAsync(int appointmentId, RecurrenceUpdateMode recurrenceUpdateMode, RowModification operationOnFirst, RowModification operationOnConsecutive, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
RecurrenceUpdateMode recurrenceUpdateMode
RowModification operationOnFirst
RowModification operationOnConsecutive
CancellationToken cancellationToken
Returns
Type Description
Task

RejectAsync(int, RecurrenceUpdateMode, string, CancellationToken)

Rejects all occurrences of the appointment for the participant. If only one occurrence exist, then only this one is rejected (not a recurring booking appointment). The result of the rejection is saved to the database.

Declaration
Task RejectAsync(int appointmentId, RecurrenceUpdateMode recurrenceUpdateMode, string rejectReason, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId

AppointmentId of Invitation or Assignment to be set to rejected.

RecurrenceUpdateMode recurrenceUpdateMode

How recurrence updates should be handled

string rejectReason

Text that explains why he/she can not attend

CancellationToken cancellationToken
Returns
Type Description
Task

SetSeenAsync(int, RecurrenceUpdateMode, CancellationToken)

Sets an appointment Invitation or Assignment to seen and save it to the database.

Declaration
Task SetSeenAsync(int appointmentId, RecurrenceUpdateMode recurrenceUpdateMode, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId

AppointmentId of Invitation or Assignment to be set to seen.

RecurrenceUpdateMode recurrenceUpdateMode

How recurrence updates should be handled

CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

Set Seen (Booking or Assignment) or MovedSeen (Booking) depending on the previous status of the Appointment

TryGetNearestUidOfAppointmentIdAsync(int, int, CancellationToken)

Declaration
Task<(bool, string, int)> TryGetNearestUidOfAppointmentIdAsync(int recurrenceRuleId, int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recurrenceRuleId
int appointmentId
CancellationToken cancellationToken
Returns
Type Description
Task<(bool, string, int)>

TryGetOfAppointmentIdFromRecurrenceIdAsync(int, CancellationToken)

Attempts to match the appointment id to a recurring id from the Invitation table.

Declaration
Task<int> TryGetOfAppointmentIdFromRecurrenceIdAsync(int recurrenceRuleId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recurrenceRuleId
CancellationToken cancellationToken
Returns
Type Description
Task<int>

TryGetRelatedUidOfAppointmentIdAsync(int, CancellationToken)

Attempts to match the appointment id to a Uid in the Invitation table. If the appointment id refers to a child, the mother id is used.

Declaration
Task<(bool, string)> TryGetRelatedUidOfAppointmentIdAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
CancellationToken cancellationToken
Returns
Type Description
Task<(bool, string)>

TryGetUidFromRecurringAppointmentChildAsync(int, CancellationToken)

Recurring chilren are not directly connected to the mother appointment listed in the invitation table

Declaration
Task<(bool, string)> TryGetUidFromRecurringAppointmentChildAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
CancellationToken cancellationToken
Returns
Type Description
Task<(bool, string)>

TryGetUidOfAppointmentIdAsync(int, CancellationToken)

Attempts to match the appointment id to a Uid in the Invitation table.

Declaration
Task<(bool, string, int, string)> TryGetUidOfAppointmentIdAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int appointmentId
CancellationToken cancellationToken
Returns
Type Description
Task<(bool, string, int, string)>

First Uid found, sorted by invitationId ascending.

TryGetUidOfRecurrenceIdAsync(int, CancellationToken)

Attempts to match the appointment id to a Uid in the Invitation table.

Declaration
Task<(bool, string)> TryGetUidOfRecurrenceIdAsync(int recurrenceRuleId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recurrenceRuleId
CancellationToken cancellationToken
Returns
Type Description
Task<(bool, string)>

UpdateLastModifiedAndIncrementSequenceAsync(int, DateTime, DateTime?, DateTime?, CancellationToken)

Declaration
Task<(int, string)> UpdateLastModifiedAndIncrementSequenceAsync(int invitationId, DateTime lastModified, DateTime? recurringStartDate = null, DateTime? recurringEndDate = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int invitationId
DateTime lastModified
DateTime? recurringStartDate
DateTime? recurringEndDate
CancellationToken cancellationToken
Returns
Type Description
Task<(int, string)>

UpdateLastModifiedAndIncrementSequenceOfRowAsync(InvitationRow, DateTime, DateTime?, DateTime?, CancellationToken)

Declaration
Task<(int, string)> UpdateLastModifiedAndIncrementSequenceOfRowAsync(InvitationRow row, DateTime lastModified, DateTime? recurringStartDate = null, DateTime? recurringEndDate = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
InvitationRow row
DateTime lastModified
DateTime? recurringStartDate
DateTime? recurringEndDate
CancellationToken cancellationToken
Returns
Type Description
Task<(int, string)>

UpdateLastModifiedAndIncrementSequenceOfUidAsync(string, DateTime, DateTime?, DateTime?, CancellationToken)

Updates the last modified value, and increments the sequence number of the uid in the Invitation table. Returns the new sequence number.

Declaration
Task<(int, string)> UpdateLastModifiedAndIncrementSequenceOfUidAsync(string uid, DateTime lastModified, DateTime? recurringStartDate = null, DateTime? recurringEndDate = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string uid
DateTime lastModified
DateTime? recurringStartDate
DateTime? recurringEndDate
CancellationToken cancellationToken
Returns
Type Description
Task<(int, string)>

The new sequence number. -1 if failed.

ValidateParticipantAsync(CancellationToken, params ParticipantInfo[])

Validates the information in the ParticipantInfo given as parameter and fills inn lacking information if needed. I.e assoc_id could both represent an associate or a resource. In the case of an associate, the person_id should also be present. Person that are actually associates are similarly updated with their associate id.

This also ensures consistent processing later on (associates really are processed as associates, etc)
Declaration
Task ValidateParticipantAsync(CancellationToken cancellationToken, params ParticipantInfo[] participants)
Parameters
Type Name Description
CancellationToken cancellationToken
ParticipantInfo[] participants
Returns
Type Description
Task

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top