Class FilterDialogDataHandler
Data fetch/save class for the Filter dialog. This class can be used (together with the FilterAssociates, FilterGroups and SelectableListHelper classes to fetch the currently selected groups and associates of the filter dialog, as well as the from and to dates.
Inherited Members
Namespace: SuperOffice.CRM
Assembly: SoDataBase.dll
Syntax
public static class FilterDialogDataHandler
Methods
AddFilterRestrictions(Select, FieldInfo, FieldInfo)
Data fetch/save class for the Filter dialog. This class can be used (together with the FilterAssociates, FilterGroups and SelectableListHelper classes to fetch the currently selected groups and associates of the filter dialog, as well as the from and to dates.
Declaration
public static void AddFilterRestrictions(Select query, FieldInfo associateField, FieldInfo dateField)
Parameters
Type | Name | Description |
---|---|---|
Select | query | |
FieldInfo | associateField | |
FieldInfo | dateField |
AddFilterRestrictions(Select, FieldInfo, FieldInfo, bool)
Data fetch/save class for the Filter dialog. This class can be used (together with the FilterAssociates, FilterGroups and SelectableListHelper classes to fetch the currently selected groups and associates of the filter dialog, as well as the from and to dates.
Declaration
public static void AddFilterRestrictions(Select query, FieldInfo associateField, FieldInfo dateField, bool includeAssoc0)
Parameters
Type | Name | Description |
---|---|---|
Select | query | |
FieldInfo | associateField | |
FieldInfo | dateField | |
bool | includeAssoc0 |
AddFilterRestrictionsByEjuser(Select, FieldInfo, FieldInfo)
Data fetch/save class for the Filter dialog. This class can be used (together with the FilterAssociates, FilterGroups and SelectableListHelper classes to fetch the currently selected groups and associates of the filter dialog, as well as the from and to dates.
Declaration
public static void AddFilterRestrictionsByEjuser(Select query, FieldInfo ejUserField, FieldInfo dateField)
Parameters
Type | Name | Description |
---|---|---|
Select | query | |
FieldInfo | ejUserField | |
FieldInfo | dateField |
AreAllAssociatesSelected()
Data fetch/save class for the Filter dialog. This class can be used (together with the FilterAssociates, FilterGroups and SelectableListHelper classes to fetch the currently selected groups and associates of the filter dialog, as well as the from and to dates.
Declaration
public static bool AreAllAssociatesSelected()
Returns
Type | Description |
---|---|
bool |
AreAllAssociatesSelectedAsync(CancellationToken)
Data fetch/save class for the Filter dialog. This class can be used (together with the FilterAssociates, FilterGroups and SelectableListHelper classes to fetch the currently selected groups and associates of the filter dialog, as well as the from and to dates.
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static Task<bool> AreAllAssociatesSelectedAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> |
DefaultFilterValue()
Data fetch/save class for the Filter dialog. This class can be used (together with the FilterAssociates, FilterGroups and SelectableListHelper classes to fetch the currently selected groups and associates of the filter dialog, as well as the from and to dates.
Declaration
public static FilterDialogDataHandler.DefaultFilter DefaultFilterValue()
Returns
Type | Description |
---|---|
FilterDialogDataHandler.DefaultFilter |
DefaultFilterValueAsync(CancellationToken)
Data fetch/save class for the Filter dialog. This class can be used (together with the FilterAssociates, FilterGroups and SelectableListHelper classes to fetch the currently selected groups and associates of the filter dialog, as well as the from and to dates.
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static Task<FilterDialogDataHandler.DefaultFilter> DefaultFilterValueAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<FilterDialogDataHandler.DefaultFilter> |
GetFromDate()
Get the 'from date', i.e., the date of the earliest visible activity. The date is recalculated based on the 'days before' (today) value every time this method is called, and so moves with real time.
Declaration
public static DateTime GetFromDate()
Returns
Type | Description |
---|---|
DateTime | Date of earliest visible activity, not necessarily earlier than today |
GetFromDateAsync(CancellationToken)
Get the 'from date', i.e., the date of the earliest visible activity. The date is recalculated based on the 'days before' (today) value every time this method is called, and so moves with real time.
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static Task<DateTime> GetFromDateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DateTime> | Date of earliest visible activity, not necessarily earlier than today |
GetSelectedAssociateIds()
Get the id's of the currently selected associates in the Filter dialog. Note that a selected group implies that all its associates should be selected, but that logic is not maintained here - only in the presentation layer. If the All preference is set, all associates are considered selected. If no associates are selected, the defaulting rules apply.
Declaration
public static int[] GetSelectedAssociateIds()
Returns
Type | Description |
---|---|
int[] | Unique (but not sorted) associate ids, may be empty |
GetSelectedAssociateIdsAsync(CancellationToken)
Get the id's of the currently selected associates in the Filter dialog. Note that a selected group implies that all its associates should be selected, but that logic is not maintained here - only in the presentation layer. If the All preference is set, all associates are considered selected. If no associates are selected, the defaulting rules apply.
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static Task<int[]> GetSelectedAssociateIdsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int[]> | Unique (but not sorted) associate ids, may be empty |
GetSelectedGroupIdsAsync(CancellationToken)
Get the id's of the currently selected groups in the Filter dialog. If the All preference is set, all groups are considered selected. If no groups are set, the defaulting rules apply.
Declaration
public static Task<int[]> GetSelectedGroupIdsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int[]> | Unique (but not sorted) group ids, may be empty |
GetToDate()
Get the 'to date', i.e., the date of the newest visible activity. The date is recalculated based on the 'days after' (today) value every time this method is called, and so moves with real time.
Declaration
public static DateTime GetToDate()
Returns
Type | Description |
---|---|
DateTime | Date of latest visible activity, not necessarily greater than today |
GetToDateAsync(CancellationToken)
Get the 'to date', i.e., the date of the newest visible activity. The date is recalculated based on the 'days after' (today) value every time this method is called, and so moves with real time.
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static Task<DateTime> GetToDateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DateTime> | Date of latest visible activity, not necessarily greater than today |
SaveAsync(int[], int[], DateTime, DateTime, CancellationToken)
Save the current Filter dialog settings: Groups, associates, from and to date. The dates are converted into days before and days after today, for recalculation when fetching so that the interval moves properly with real time.
Declaration
public static Task SaveAsync(int[] groupIds, int[] associateIds, DateTime fromDate, DateTime toDate, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | groupIds | Array (may be empty but not null) of currently selected group ids. The SelectableListHelper can be used to extract these ids from a list of selectable list items. |
int[] | associateIds | Array (may be empty but not null) of currently selected associate ids. The SelectableListHelper can be used to extract these ids from a list of selectable list items. |
DateTime | fromDate | Date of earliest visible activity, will be converted to days before today |
DateTime | toDate | Date of latest visible activity, will be converted to days after today |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
Remarks
There is a special case: 'All'. This case implies that there is no filtering on associates/groups, and is triggered by one of two possible parameter values. Either both the associateIds and groupIds parameters are empty arrays (Length==0, not null!); or the arrays exactly match in content the FilterAssociates and FilterGroups associate and group lists (that is, the same elements are present, though they do not have to be in the same order).
If the 'All' case is triggered, the number of associates and number of groups are saved as 0, and the special 'All' preference is set to true. This saves a lot of time on databases with many users, and is exactly the logic used in the Windows Client.