Class AppointmentProviderBase<RootExtender>
Base class for appointment providers, containing the logic that implements the special rules, such as done today or preference-based booking filters. Derived classes must call the ProcessKindRestrictions(ActivityArchiveKind) method from their InnerMapFields to activate the functionality.
Inheritance
Implements
Inherited Members
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
public abstract class AppointmentProviderBase<RootExtender> : ActivityProviderBase<RootExtender>, IArchiveProviderQueryMapping, IArchiveQueryProvider, IArchiveProviderExtensible, IArchiveTypedProvider<ArchiveRow>, IArchiveTypedProviderBase, IArchiveProvider, IArchiveProviderHasRows, IArchiveProviderHasColumns, IArchiveProviderHasEntities where RootExtender : IArchiveExtender, new()
Type Parameters
Name | Description |
---|---|
RootExtender |
Constructors
AppointmentProviderBase(ArchiveRowTypeInfo)
Base class for appointment providers, containing the logic that implements the special rules, such as done today or preference-based booking filters. Derived classes must call the ProcessKindRestrictions(ActivityArchiveKind) method from their InnerMapFields to activate the functionality.
Declaration
protected AppointmentProviderBase(ArchiveRowTypeInfo entity)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRowTypeInfo | entity |
Fields
_colParticipating
Base class for appointment providers, containing the logic that implements the special rules, such as done today or preference-based booking filters. Derived classes must call the ProcessKindRestrictions(ActivityArchiveKind) method from their InnerMapFields to activate the functionality.
Declaration
protected ArchiveColumnInfo _colParticipating
Field Value
Type | Description |
---|---|
ArchiveColumnInfo |
Properties
DropTablesFromPhaseTwo
The fields in this enumeration will be dropped from a Phase Two query; that may also cause one or more tables to be dropped. A useful optimization in a very small number of cases (where fields/joins are only used for Phase One/AcceptRow processing)
Declaration
protected override TableInfo[] DropTablesFromPhaseTwo { get; }
Property Value
Type | Description |
---|---|
TableInfo[] |
Overrides
Methods
AcceptRow(SoDataReader)
Decide whether the current row of the passed-in reader should be accepted or not. If false is returned, this row is skipped by the base class and never seen by the client. This method implements those parts of the activity archive rules that are too complex to reasonably express in SQL.
Declaration
protected override bool AcceptRow(SoDataReader reader)
Parameters
Type | Name | Description |
---|---|---|
SoDataReader | reader | reader with the current row |
Returns
Type | Description |
---|---|
bool | true if the current row should be further processed |
Overrides
InnerPopulateRowFromReader(SoDataReader, ArchiveRow)
Override: Populate the column that tells us whether the current user is invited to an activity
Declaration
protected override void InnerPopulateRowFromReader(SoDataReader reader, ArchiveRow row)
Parameters
Type | Name | Description |
---|---|---|
SoDataReader | reader | |
ArchiveRow | row |
Overrides
PostProcessQuery()
LEFT-outerjoin appointments to detect and manage bookings, if this is a contactactivity archive
Declaration
public override void PostProcessQuery()
Overrides
Remarks
Bookings are tricky in entity archives; we'd like to show "my" instance if I have been invited, and otherwise the master. But the rows will come in some arbitrary order, so we need to "peek ahead" to know if the current has been invited; and also to see if the master will be visible (Filter settings might exclude it, in which case we'll take the first we can get as the ultimate fallback).
ProcessKindRestrictions(ActivityArchiveKind)
Process as many of the kind-based restrictions (see ActivityArchiveKind) as possible in SQL, and order up enough return fields to do the rest.
Declaration
protected override void ProcessKindRestrictions(ActivityArchiveKind kind)
Parameters
Type | Name | Description |
---|---|---|
ActivityArchiveKind | kind | Archive kind, passed in from caller |
Overrides
RequiredPhaseOneFields()
Return the fields needed for AcceptRow, these are the same fields as specified at the end of ProcessKindRestrictions
Declaration
protected override FieldInfo[] RequiredPhaseOneFields()
Returns
Type | Description |
---|---|
FieldInfo[] |
Overrides
SetRestriction(params ArchiveRestrictionInfo[])
Set the restriction by calling the base class and InnerSetRestriction; take this opportunity to note that a restriction has actually been set, so we can report cases of totally missing restrictions (which is not acceptable as it might end up fetching the whole database)
Declaration
public override bool SetRestriction(params ArchiveRestrictionInfo[] restrictions)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo[] | restrictions |
Returns
Type | Description |
---|---|
bool |