Class RecurrenceManager
Inheritance
RecurrenceManager
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public class RecurrenceManager
Constructors
RecurrenceManager()
Declaration
public RecurrenceManager()
RecurrenceManager(Appointment, IEnumerable<Appointment>)
Declaration
public RecurrenceManager(Appointment bookingMaster, IEnumerable<Appointment> repetitions)
Parameters
RecurrenceManager(RecurrenceInfo)
Instantiate a RecurrenceManager providing a new recurrence pattern.
Declaration
public RecurrenceManager(RecurrenceInfo recurrenceInfo)
Parameters
| Type |
Name |
Description |
| RecurrenceInfo |
recurrenceInfo |
Information about the recurrence pattern.
|
RecurrenceManager(DateTime)
Declaration
public RecurrenceManager(DateTime date)
Parameters
Properties
Dates
Get or set the dates of the recurring appointments.
Declaration
public RecurrenceDate[] Dates { get; set; }
Property Value
IsRecurrencePatternChanged
Get if the recurrence pattern has been changed from the currently saved pattern.
This value will allways be false if the recurrence pattern has not yet been
insterted in the database.
Declaration
public bool IsRecurrencePatternChanged { get; }
Property Value
RecurrenceInfo
Get or set the current recurrence pattern.
Declaration
public RecurrenceInfo RecurrenceInfo { get; set; }
Property Value
Methods
ApplyUdefValuesAsync(EntityUdefHelper, EntityUdefHelper)
Declaration
public static Task ApplyUdefValuesAsync(EntityUdefHelper source, EntityUdefHelper target)
Parameters
Returns
BreakRecurrenceAsync(CancellationToken)
Declaration
public Task BreakRecurrenceAsync(CancellationToken cancellationToken = default)
Parameters
Returns
ConvertDayOfWeekToWeekday(DayOfWeek)
Converts the given integer to the corresponding Weekday enum (bit flag).
Declaration
public static Weekday ConvertDayOfWeekToWeekday(DayOfWeek day)
Parameters
Returns
| Type |
Description |
| Weekday |
Returns an integer from 1-7 representing Monday-Sunday respectively.
If the input does not match any known Weekday, it returns 0.
|
ConvertFromTimeZone(DateTime, int)
Declaration
public static DateTime ConvertFromTimeZone(DateTime date, int timeZoneID)
Parameters
Returns
ConvertWeekdayToInteger(Weekday)
Converts the Weekday enum to its corresponding integer representation.
Declaration
public static int ConvertWeekdayToInteger(Weekday weekday)
Parameters
| Type |
Name |
Description |
| Weekday |
weekday |
The Weekday enum value to convert.
|
Returns
| Type |
Description |
| int |
Returns an integer from 1-7 representing Monday-Sunday respectively.
If the input does not match any known Weekday, it returns 0.
|
CreateAppointmentForDateAsync(Appointment, RecurrenceDate, CancellationToken)
Declaration
public static Task<Appointment> CreateAppointmentForDateAsync(Appointment originalAppointment, RecurrenceDate date, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| Appointment |
originalAppointment |
Original appointment to create a copy of with new date information.
|
| RecurrenceDate |
date |
New date information to apply on the newly created appointment record.
|
| CancellationToken |
cancellationToken |
|
Returns
GetDayInMonth(int, DateTime)
Get the date for a day in a month.
Declaration
public static DateTime GetDayInMonth(int day, DateTime month)
Parameters
| Type |
Name |
Description |
| int |
day |
The day in the month.
|
| DateTime |
month |
Month
|
Returns
| Type |
Description |
| DateTime |
Date of the day in the month.
|
GetDaysToMatchInPattern(DateTime)
Declaration
public int GetDaysToMatchInPattern(DateTime date)
Parameters
Returns
GetDaysToMatchInPattern(DayOfWeek)
Declaration
public int GetDaysToMatchInPattern(DayOfWeek dayOfWeek)
Parameters
Returns
GetDaysToMatchInPattern(DayOfWeek, Weekday)
Get Number of days until a match in the week pattern. Matching today is '0'.
Declaration
public static int GetDaysToMatchInPattern(DayOfWeek dayOfWeek, Weekday weekPattern)
Parameters
| Type |
Name |
Description |
| DayOfWeek |
dayOfWeek |
Current day of week as used by DateTime.
|
| Weekday |
weekPattern |
Weekday pattern describing days in the week for recurrence.
|
Returns
| Type |
Description |
| int |
Number of days until Match [0-6]. Today is 0.
|
GetDefaultRecurrenceInfo()
Declaration
public static RecurrenceInfo GetDefaultRecurrenceInfo()
Returns
GetDefaultRecurrenceInfo(DateTime)
Declaration
public static RecurrenceInfo GetDefaultRecurrenceInfo(DateTime date)
Parameters
Returns
GetEstimatedCount()
Declaration
public int GetEstimatedCount()
Returns
GetFirstDate(DateTime)
Get the first date of a recurrence. The first date can be the same as the date provided.
Declaration
public DateTime GetFirstDate(DateTime date)
Parameters
| Type |
Name |
Description |
| DateTime |
date |
First candidate for a date in a recurrence.
|
Returns
| Type |
Description |
| DateTime |
First valid date in a recurrence
|
GetNextDate(DateTime)
Declaration
public DateTime GetNextDate(DateTime date)
Parameters
| Type |
Name |
Description |
| DateTime |
date |
The previous date in recurrence.
|
Returns
| Type |
Description |
| DateTime |
The next date. The day after the provided date is the earliest date that will be returned.
|
GetRecurrenceDate(Appointment)
Declaration
public static RecurrenceDate GetRecurrenceDate(Appointment appointment)
Parameters
Returns
GetRecurrenceDate(AppointmentRow)
Declaration
public static RecurrenceDate GetRecurrenceDate(AppointmentRow appointment)
Parameters
Returns
GetRecurrenceDate(DateTime)
Declaration
public static RecurrenceDate GetRecurrenceDate(DateTime date)
Parameters
Returns
GetRecurrenceInfo(Appointment)
Get RecurrenceInfo from an appointment.
Declaration
public static RecurrenceInfo GetRecurrenceInfo(Appointment bookingMaster)
Parameters
Returns
GetRecurrenceInfo(RecurrenceRuleRow, DateTime)
Get a recurrence info from a recurrence rule row in the database with corresponding doby
Declaration
public static RecurrenceInfo GetRecurrenceInfo(RecurrenceRuleRow ruleRow, DateTime doBy)
Parameters
Returns
GetWeekDayInMonth(Weekday, int, DateTime)
Declaration
public static DateTime GetWeekDayInMonth(Weekday weekday, int week, DateTime month)
Parameters
Returns
OnAgendaHTMLTextChange(Appointment, string, string, string)
Declaration
public void OnAgendaHTMLTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
OnAgendaTextChange(Appointment, string, string, string)
Declaration
public void OnAgendaTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
OnAppointmentRowValueChanged(Appointment, TableRowBase, FieldInfo, object, object, object)
Declaration
public void OnAppointmentRowValueChanged(Appointment app, TableRowBase fieldOwner, FieldInfo field, object persistedValue, object currentValue, object newValue)
Parameters
OnInternalNotesHtmlTextChange(Appointment, string, string, string)
Declaration
public void OnInternalNotesHtmlTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
OnInternalNotesTextChange(Appointment, string, string, string)
Declaration
public void OnInternalNotesTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
OnLinksAddedAsync(Appointment, ActivityLinksHelper, AppointmentRow, RelationsRow, CancellationToken)
Declaration
public Task OnLinksAddedAsync(Appointment app, ActivityLinksHelper linksHelper, AppointmentRow parent, RelationsRow item, CancellationToken cancellationToken = default)
Parameters
Returns
OnLinksEditedAsync(Appointment, ActivityLinksHelper, AppointmentRow, RelationsRow, CancellationToken)
Declaration
public Task<RelationsRow> OnLinksEditedAsync(Appointment app, ActivityLinksHelper linksHelper, AppointmentRow parent, RelationsRow item, CancellationToken cancellationToken = default)
Parameters
Returns
OnLinksRemovedAsync(Appointment, ActivityLinksHelper, AppointmentRow, RelationsRow, CancellationToken)
Declaration
public Task OnLinksRemovedAsync(Appointment app, ActivityLinksHelper linksHelper, AppointmentRow parent, RelationsRow item, CancellationToken cancellationToken = default)
Parameters
Returns
OnSavedAsync(bool, bool)
Declaration
public Task OnSavedAsync(bool bSucceeded, bool isRecurring)
Parameters
| Type |
Name |
Description |
| bool |
bSucceeded |
|
| bool |
isRecurring |
|
Returns
OnTextChange(Appointment, string, string, string)
Declaration
public void OnTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
OnUdefValueChangeAsync(Appointment, string, object, object, CancellationToken)
Declaration
public Task OnUdefValueChangeAsync(Appointment app, string progId, object oldValue, object newValue, CancellationToken cancellationToken = default)
Parameters
Returns
PrepareForSave(bool, bool)
Declaration
public void PrepareForSave(bool isRecurring, bool updateStartDate)
Parameters
| Type |
Name |
Description |
| bool |
isRecurring |
|
| bool |
updateStartDate |
|
RecalculateDays()
Declaration
public void RecalculateDays()
Examples
// Make some modifications to the object.
recurrenceManager.RecalculateDays();
RecurrenceDate[] newDates = recurrenceManager.Days;
UpdateAppointmentWithDate(Appointment, RecurrenceDate)
Apply new date information on an appointment based on the provided date information.
Declaration
public static void UpdateAppointmentWithDate(Appointment appointment, RecurrenceDate date)
Parameters
| Type |
Name |
Description |
| Appointment |
appointment |
Appointment record to modify.
|
| RecurrenceDate |
date |
Date information to apply on the appointment record.
|
UpdateConflictsAsync(int, int, TimeSpan, TimeSpan, CancellationToken, params ParticipantInfo[])
Update the recurrence dates with conflict and letter day information, based on a list of participants.
Declaration
public Task UpdateConflictsAsync(int excludedAppointmentId, int excludedRecurrenceRuleId, TimeSpan startTime, TimeSpan endTime, CancellationToken cancellationToken = default, params ParticipantInfo[] participants)
Parameters
Returns
UpdateFromRecord(RecurrenceInfo, RecurrenceRuleRecordData, DateTime)
Declaration
public static void UpdateFromRecord(RecurrenceInfo recurrenceInfo, RecurrenceRuleRecordData ruleRow, DateTime doBy)
Parameters
Extension Methods