Class AppointmentUtility
Utility functions for Appointment services
Inheritance
AppointmentUtility
Assembly: SoDataBase.dll
Syntax
public static class AppointmentUtility
Methods
GetAllAppointmentRowsOfRecurrenceRuleID(Int32, Boolean)
Declaration
public static AppointmentRow[] GetAllAppointmentRowsOfRecurrenceRuleID(int recurrenceRuleId, bool motherAppointmentsOnly = false)
Parameters
Type |
Name |
Description |
Int32 |
recurrenceRuleId |
|
Boolean |
motherAppointmentsOnly |
|
Returns
GetAppointmentIdFromRecurringId(Int32)
Declaration
public static int GetAppointmentIdFromRecurringId(int recurringId)
Parameters
Type |
Name |
Description |
Int32 |
recurringId |
|
Returns
GetAppointmentIdFromUID(String)
Declaration
public static int GetAppointmentIdFromUID(string uid)
Parameters
Type |
Name |
Description |
String |
uid |
|
Returns
GetConnectionInfo()
Declaration
public static (ServiceAuthRecordData imap, ServiceAuthRecordData smtp, string sentFolder) GetConnectionInfo()
Returns
GetExistingInvitationIdFromUID(String)
Declaration
public static int GetExistingInvitationIdFromUID(string uid)
Parameters
Type |
Name |
Description |
String |
uid |
|
Returns
GetInvitationRecordData(Int32)
Declaration
public static InvitationRecordData GetInvitationRecordData(int appointmentId)
Parameters
Type |
Name |
Description |
Int32 |
appointmentId |
|
Returns
GetInvitationRecordDataFromUid(String)
Declaration
public static InvitationRecordData GetInvitationRecordDataFromUid(string uid)
Parameters
Type |
Name |
Description |
String |
uid |
|
Returns
GetInvitationRowFromUid(String)
Declaration
public static InvitationRow GetInvitationRowFromUid(string uid)
Parameters
Type |
Name |
Description |
String |
uid |
|
Returns
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
public static DateTime GetLastModifiedDateOfAppointment(this AppointmentRow row)
Parameters
Returns
GetOrCreateInvitationIdFromUID(String, out Boolean)
Declaration
public static int GetOrCreateInvitationIdFromUID(string uid, out bool rowCreated)
Parameters
Returns
GetOrCreateUidOfAppointment(Int32, String, DateTime, Nullable<DateTime>, Nullable<DateTime>, out Int32)
Declaration
public static string GetOrCreateUidOfAppointment(int appointmentId, string from, DateTime lastModified, DateTime? recurringStartDate, DateTime? recurringEndDate, out int sequence)
Parameters
Returns
GetOrganizerEmail(Int32)
Declaration
public static string GetOrganizerEmail(int appointmentId)
Parameters
Type |
Name |
Description |
Int32 |
appointmentId |
|
Returns
GetOrganizerInfo(Int32)
Declaration
public static (string email, string fullname) GetOrganizerInfo(int appointmentId)
Parameters
Type |
Name |
Description |
Int32 |
appointmentId |
|
Returns
GetRecurrenceRuleIdOfAppointmentId(Int32)
Declaration
public static int GetRecurrenceRuleIdOfAppointmentId(int appointmentId)
Parameters
Type |
Name |
Description |
Int32 |
appointmentId |
|
Returns
GetRecurringSeriesForInvitedPerson(Int32, Int32)
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
public static RecurringSeries GetRecurringSeriesForInvitedPerson(int recurrenceRuleId, int invitedPersonId)
Parameters
Type |
Name |
Description |
Int32 |
recurrenceRuleId |
|
Int32 |
invitedPersonId |
|
Returns
GetRecurringSeriesOnlyMotherAppointments(Int32)
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
public static RecurringSeries GetRecurringSeriesOnlyMotherAppointments(int recurrenceRuleId)
Parameters
Type |
Name |
Description |
Int32 |
recurrenceRuleId |
|
Returns
HasCalendarAccess(Int32, Int32)
Checks whether the active person has access to see someones calendar.
Declaration
public static bool HasCalendarAccess(int activePersonId, int calendarOwnerId)
Parameters
Type |
Name |
Description |
Int32 |
activePersonId |
Person id of the active person (the one logged on).
|
Int32 |
calendarOwnerId |
The id of the person whose calendar the logged on user wants to see
|
Returns
Type |
Description |
Boolean |
True if access is allowed, false otherwise.
|
TryGetNearestUidOfAppointmentId(Int32, Int32, out String, out Int32)
Declaration
public static bool TryGetNearestUidOfAppointmentId(int recurrenceRuleId, int appointmentId, out string uid, out int sequence)
Parameters
Returns
TryGetOfAppointmentIdFromRecurrenceId(Int32)
Attempts to match the appointment id to a recurring id from the Invitation table.
Declaration
public static int TryGetOfAppointmentIdFromRecurrenceId(int recurrenceRuleId)
Parameters
Type |
Name |
Description |
Int32 |
recurrenceRuleId |
|
Returns
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
public static bool TryGetRelatedUidOfAppointmentId(int appointmentId, out string uid)
Parameters
Returns
TryGetUidFromRecurringAppointmentChild(Int32, out String)
Recurring chilren are not directly connected to the mother appointment listed in the invitation table
Declaration
public static bool TryGetUidFromRecurringAppointmentChild(int appointmentId, out string uid)
Parameters
Returns
TryGetUidOfAppointmentId(Int32, out String, out Int32, out String)
Attempts to match the appointment id to a Uid in the Invitation table.
Declaration
public static bool TryGetUidOfAppointmentId(int appointmentId, out string uid, out int sequence, out string organizerEmail)
Parameters
Returns
Type |
Description |
Boolean |
First Uid found, sorted by invitationId ascending.
|
TryGetUidOfRecurrenceId(Int32, out String)
Attempts to match the appointment id to a Uid in the Invitation table.
Declaration
public static bool TryGetUidOfRecurrenceId(int recurrenceRuleId, out string uid)
Parameters
Type |
Name |
Description |
Int32 |
recurrenceRuleId |
|
String |
uid |
|
Returns
UpdateLastModifiedAndIncrementSequence(Int32, DateTime, out String, Nullable<DateTime>, Nullable<DateTime>)
Declaration
public static int UpdateLastModifiedAndIncrementSequence(int invitationId, DateTime lastModified, out string organizerEmail, DateTime? recurringStartDate = default(DateTime? ), DateTime? recurringEndDate = default(DateTime? ))
Parameters
Returns
UpdateLastModifiedAndIncrementSequenceOfRow(InvitationRow, DateTime, out String, Nullable<DateTime>, Nullable<DateTime>)
Declaration
public static int UpdateLastModifiedAndIncrementSequenceOfRow(InvitationRow row, DateTime lastModified, out string organizerEmail, DateTime? recurringStartDate = default(DateTime? ), DateTime? recurringEndDate = default(DateTime? ))
Parameters
Returns
UpdateLastModifiedAndIncrementSequenceOfUid(String, DateTime, out String, Nullable<DateTime>, Nullable<DateTime>)
Updates the last modified value, and increments the sequence number of the uid in the Invitation table. Returns the new sequence number.
Declaration
public static int UpdateLastModifiedAndIncrementSequenceOfUid(string uid, DateTime lastModified, out string organizerEmail, DateTime? recurringStartDate = default(DateTime? ), DateTime? recurringEndDate = default(DateTime? ))
Parameters
Returns
Type |
Description |
Int32 |
The new sequence number. -1 if failed.
|