Class ActivityInfoProviderExtensions
- Namespace
- CMS.Activities
- Assembly
- CMS.Activities.dll
Contains extension methods for ActivityInfo's IInfoProvider<TInfo>.
public static class ActivityInfoProviderExtensions
- Inheritance
-
objectActivityInfoProviderExtensions
Methods
BulkMoveActivitiesToAnotherContact(IInfoProvider<ActivityInfo>, int, int)
Moves all activities assigned to the contact identified by given sourceContactID to the contact identified by targetContactID.
public static void BulkMoveActivitiesToAnotherContact(this IInfoProvider<ActivityInfo> activityInfoProvider, int sourceContactID, int targetContactID)
Parameters
activityInfoProviderIInfoProvider<ActivityInfo>Activity info provider.
sourceContactIDintIdentifier of the contact the activities are moved from
targetContactIDintIdentifier of the contact the activities are moved to
Remarks
This method should be used only in the merging process. Note that there is no consistency check on whether the contacts with given IDs exist or not (nor is the foreign key check in DB). Caller of this method should perform all the necessary checks prior to the method invocation.
ContactDidActivity(IInfoProvider<ActivityInfo>, int, string, string, int, string)
Returns true if the contact did a specified activity.
public static bool ContactDidActivity(this IInfoProvider<ActivityInfo> activityInfoProvider, int contactId, string activityType, string cancelActivityType, int lastXDays, string whereCondition)
Parameters
activityInfoProviderIInfoProvider<ActivityInfo>Activity info provider.
contactIdintContact ID
activityTypestringName of the activity to check (can specify more than one separated with semicolon, all of the types match than)
cancelActivityTypestringName of the activity which cancels the original activity.
lastXDaysintConstraint for last X days (if zero, negative value or number greater than CMS.Activities.Internal.ActivityConstraintsConstants.MAX_LAST_X_DAYS is given, no constraint is applied).
whereConditionstringAdditional WHERE condition
Returns
- bool
ContactDidActivityWithValue(IInfoProvider<ActivityInfo>, int, string, string, string, int)
Returns true if the contact with contactId did a specified activity (of given activityType) with a given value and queryOperator applied.
public static bool ContactDidActivityWithValue(this IInfoProvider<ActivityInfo> activityInfoProvider, int contactId, string activityType, string queryOperator, string value, int lastXDays)
Parameters
activityInfoProviderIInfoProvider<ActivityInfo>Activity info provider.
contactIdintContact ID.
activityTypestringName of the activity to check.
queryOperatorstringOperator (notcontains, notcontains, startswith, endswith, equals, notequals).
valuestringValue of ActivityValue column.
lastXDaysintConstraint for last X days (if zero, negative value or number greater than CMS.Activities.Internal.ActivityConstraintsConstants.MAX_LAST_X_DAYS is given, no constraint is applied).
Returns
- bool
ContactDidActivityWithValue(IInfoProvider<ActivityInfo>, int, string, string, string, int, string)
Returns true if the contact with contactId did a specified activity
(of given activityType) with a given whereCondition, value,
and queryOperator applied.
public static bool ContactDidActivityWithValue(this IInfoProvider<ActivityInfo> activityInfoProvider, int contactId, string activityType, string queryOperator, string value, int lastXDays, string whereCondition)
Parameters
activityInfoProviderIInfoProvider<ActivityInfo>Activity info provider.
contactIdintContact ID.
activityTypestringName of the activity to check.
queryOperatorstringOperator (notcontains, notcontains, startswith, endswith, equals, notequals).
valuestringValue of ActivityValue column.
lastXDaysintConstraint for last X days (if zero, negative value or number greater than CMS.Activities.Internal.ActivityConstraintsConstants.MAX_LAST_X_DAYS is given, no constraint is applied).
whereConditionstringAdditional WHERE condition
Returns
- bool
GetContactsLastActivity(IInfoProvider<ActivityInfo>, int, string)
Returns last contact's activity, may be restricted to specific activity type.
public static ActivityInfo GetContactsLastActivity(this IInfoProvider<ActivityInfo> activityInfoProvider, int contactId, string activityType)
Parameters
activityInfoProviderIInfoProvider<ActivityInfo>Activity info provider.
contactIdintContact ID
activityTypestringActivity type - optional