Show / Hide Table of Contents

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.

Inheritance
Object
FilterDialogDataHandler
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.CRM
Assembly: SoDataBase.dll
Syntax
public static class FilterDialogDataHandler

Properties

AreAllAssociatesSelected

Declaration
public static bool AreAllAssociatesSelected { get; }
Property Value
Type Description
Boolean

DefaultFilterValue

Declaration
public static FilterDialogDataHandler.DefaultFilter DefaultFilterValue { get; }
Property Value
Type Description
FilterDialogDataHandler.DefaultFilter

Methods

AddFilterRestrictions(Select, FieldInfo, FieldInfo)

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, Boolean)

Declaration
public static void AddFilterRestrictions(Select query, FieldInfo associateField, FieldInfo dateField, bool includeAssoc0)
Parameters
Type Name Description
Select query
FieldInfo associateField
FieldInfo dateField
Boolean includeAssoc0

AddFilterRestrictionsByEjuser(Select, FieldInfo, FieldInfo)

Declaration
public static void AddFilterRestrictionsByEjuser(Select query, FieldInfo ejUserField, FieldInfo dateField)
Parameters
Type Name Description
Select query
FieldInfo ejUserField
FieldInfo dateField

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

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
Int32[]

Unique (but not sorted) associate ids, may be empty

GetSelectedGroupIds()

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 int[] GetSelectedGroupIds()
Returns
Type Description
Int32[]

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

Save(Int32[], Int32[], DateTime, DateTime)

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 void Save(int[] groupIds, int[] associateIds, DateTime fromDate, DateTime toDate)
Parameters
Type Name Description
Int32[] 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.

Int32[] 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

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.

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top