Class ConflictDetector
Utility class for detecting conflicts.
Inherited Members
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public static class ConflictDetector
Methods
GetConflictTimesAsync(int, int, int[], CancellationToken, params ConflictTime[])
Utility class for detecting conflicts.
Declaration
public static Task<List<ConflictDetector.ConflictTime>[,]> GetConflictTimesAsync(int excludedAppointmentId, int excludedRecurrenceRuleId, int[] associates, CancellationToken cancellationToken = default, params ConflictDetector.ConflictTime[] conflictTimes)
Parameters
Type | Name | Description |
---|---|---|
int | excludedAppointmentId | |
int | excludedRecurrenceRuleId | |
int[] | associates | |
CancellationToken | cancellationToken | |
ConflictTime[] | conflictTimes |
Returns
Type | Description |
---|---|
Task<List<ConflictDetector.ConflictTime>[,]> |
GetConflictTimesAsync(int, int, int[], TimeSpan, TimeSpan, CancellationToken, params DateTime[])
Get conflicts.
Declaration
public static Task<List<ConflictDetector.ConflictTime>[,]> GetConflictTimesAsync(int excludedAppointmentId, int excludedRecurrenceRuleId, int[] associates, TimeSpan startTime, TimeSpan endTime, CancellationToken cancellationToken = default, params DateTime[] dates)
Parameters
Type | Name | Description |
---|---|---|
int | excludedAppointmentId | AppointmentId not to include in list of conflicting appointments. Appointment with this id as primary key or mother id will be excluded in the conflict check. |
int | excludedRecurrenceRuleId | Appointment records with this id as recurrence rule id will be excluded in the conflict check. |
int[] | associates | Associates to find conflicts for. |
TimeSpan | startTime | Start time (i.e. time of day) for the appointment. |
TimeSpan | endTime | End time (i.e. time of day) for the appointment. |
CancellationToken | cancellationToken | |
DateTime[] | dates | The dates the appointment occurs. |
Returns
Type | Description |
---|---|
Task<List<ConflictDetector.ConflictTime>[,]> | Two dimensional array of list of conflicting appointment ids. The first dimension contains dates and the second contains associates. Hence; [date, associate] yields the list of conflicting appointment ids. |
Remarks
Conflicts are normally calculated for only one associate or only one date.
GetConflictsAsync(int, int, int[], CancellationToken, params ConflictTime[])
Get Conflicts.
Declaration
public static Task<List<int>[,]> GetConflictsAsync(int excludedAppointmentId, int excludedRecurrenceRuleId, int[] associates, CancellationToken cancellationToken = default, params ConflictDetector.ConflictTime[] conflictTimes)
Parameters
Type | Name | Description |
---|---|---|
int | excludedAppointmentId | AppointmentId not to include in list of conflicting appointments. Appointment with this id as primary key or mother id will be excluded in the conflict check. |
int | excludedRecurrenceRuleId | Appointment records with this id as recurrence rule id will be excluded in the conflict check. |
int[] | associates | Associates to find conflicts for. |
CancellationToken | cancellationToken | |
ConflictTime[] | conflictTimes | Appointment times to find conflicts for. |
Returns
Type | Description |
---|---|
Task<List<int>[,]> | Two dimensional array of list of conflicting appointment ids. The first dimension contains dates and the second contains associates. Hence; [date, associate] yields the list of conflicting appointment ids. |
Remarks
Conflicts are normally calculated for only one associate or only one date. If the number of dates or number of associates is 0, a correspondingly empty response is immediately returned.
GetConflictsAsync(int, int, int[], TimeSpan, TimeSpan, CancellationToken, params DateTime[])
Get conflicts.
Declaration
public static Task<List<int>[,]> GetConflictsAsync(int excludedAppointmentId, int excludedRecurrenceRuleId, int[] associates, TimeSpan startTime, TimeSpan endTime, CancellationToken cancellationToken = default, params DateTime[] dates)
Parameters
Type | Name | Description |
---|---|---|
int | excludedAppointmentId | AppointmentId not to include in list of conflicting appointments. Appointment with this id as primary key or mother id will be excluded in the conflict check. |
int | excludedRecurrenceRuleId | Appointment records with this id as recurrence rule id will be excluded in the conflict check. |
int[] | associates | Associates to find conflicts for. |
TimeSpan | startTime | Start time (i.e. time of day) for the appointment. |
TimeSpan | endTime | End time (i.e. time of day) for the appointment. |
CancellationToken | cancellationToken | |
DateTime[] | dates | The dates the appointment occurs. |
Returns
Type | Description |
---|---|
Task<List<int>[,]> | Two dimensional array of list of conflicting appointment ids. The first dimension contains dates and the second contains associates. Hence; [date, associate] yields the list of conflicting appointment ids. |
Remarks
Conflicts are normally calculated for only one associate or only one date.
UpdateConflictsAsync(int, int, int[], TimeSpan, TimeSpan, RecurrenceDate[], CancellationToken)
Update conflicts on an array of RecurrenceDates ojects.
Declaration
public static Task UpdateConflictsAsync(int excludedAppointmentId, int excludedRecurrenceRuleId, int[] associates, TimeSpan startTime, TimeSpan endTime, RecurrenceDate[] recurrenceDates, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | excludedAppointmentId | AppointmentId not to include in list of conflicting appointments. Appointment with this id as primary key or mother id will be excluded in the conflict check. |
int | excludedRecurrenceRuleId | Appointment records with this id as recurrence rule id will be excluded in the conflict check. |
int[] | associates | Associates to find conflicts for. This should normally only be of length = 1. |
TimeSpan | startTime | Start time (i.e. time of day) for the appointment. |
TimeSpan | endTime | End time (i.e. time of day) for the appointment. |
RecurrenceDate[] | recurrenceDates | Objects to update conflicts on. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
Remarks
There should normally only be one provided associate.