Class ActivityInfoProvider
- Namespace
- CMS.Activities
- Assembly
- CMS.Activities.dll
Class providing ActivityInfo management.
[ProviderInterface(typeof(IActivityInfoProvider))]
[Obsolete("Use CMS.DataEngine.IInfoProvider<ActivityInfo> instead. Use CMS.DataEngine.InfoProviderExtensions for additional methods for individual objects retrieval. To get an instance of the interface's implementation use dependency injection or access the instance directly via the CMS.DataEngine.Provider<ActivityInfo>.Instance property. When faking metadata in CMS.Tests.UnitTests using Fake() use the obsolete provider class until fully removed.")]
public class ActivityInfoProvider : AbstractInfoProvider<ActivityInfo, ActivityInfoProvider>, IInfoProvider, ICustomizableProvider, IBulkOperationProvider, IWebFarmProvider, IInfoValidator<ActivityInfo>, IInfoByGuidProvider<ActivityInfo>, IInfoByNameProvider<ActivityInfo>, IBulkInfoProvider<ActivityInfo>, IActivityInfoProvider, IInfoProvider<ActivityInfo>, IInfoByIdProvider<ActivityInfo>
- Inheritance
-
objectActivityInfoProvider
- Implements
- Inherited Members
-
AbstractInfoProvider<ActivityInfo, ActivityInfoProvider, ObjectQuery<ActivityInfo>>.GetObjectQuery()
- Extension Methods
Constructors
ActivityInfoProvider()
public ActivityInfoProvider()
Methods
BulkInsert(IEnumerable<IDataTransferObject>)
Bulk inserts the given activities.
[Obsolete("Method was not intended for public use and will be removed in the next version.")]
public static void BulkInsert(IEnumerable<IDataTransferObject> activities)
Parameters
activitiesIEnumerable<IDataTransferObject>Data table containing values to be inserted.
BulkInsertAndGetLastID(IEnumerable<IDataTransferObject>)
Bulk inserts the given activities and returns the last inserted ActivityID.
[Obsolete("Method was not intended for public use and will be removed in the next version.")]
public static int BulkInsertAndGetLastID(IEnumerable<IDataTransferObject> activities)
Parameters
activitiesIEnumerable<IDataTransferObject>Data table containing values to be inserted
Returns
- int
BulkMoveActivitiesToAnotherContact(int, int)
Moves all activities assigned to the contact identified by given sourceContactID to the contact identified by targetContactID.
[Obsolete("Use CMS.Activities.ActivityInfoProviderExtensions.BulkMoveActivitiesToAnotherContact(IInfoProvider<ActivityInfo>, int, int) instead.")]
public static void BulkMoveActivitiesToAnotherContact(int sourceContactID, int targetContactID)
Parameters
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(int, string, string, int, string)
Returns true if the contact did a specified activity.
[Obsolete("Use CMS.Activities.ActivityInfoProviderExtensions.ContactDidActivity(IInfoProvider<ActivityInfo>, int, string, string, int, string) instead.")]
public static bool ContactDidActivity(int contactId, string activityType, string cancelActivityType, int lastXDays, string whereCondition)
Parameters
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 or negative value is given, no constraint is applied)
whereConditionstringAdditional WHERE condition
Returns
- bool
ContactDidActivityWithValue(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.
[Obsolete("Use CMS.Activities.ActivityInfoProviderExtensions.ContactDidActivityWithValue(IInfoProvider<ActivityInfo>, int, string, string, string, int) instead.")]
public static bool ContactDidActivityWithValue(int contactId, string activityType, string queryOperator, string value, int lastXDays)
Parameters
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 or negative value is given, no constraint is applied).
Returns
- bool
GetContactActivities(int, string, string, int, string)
Returns activities of specified type for contact.
[Obsolete("Method is no longer used by the system and will be removed.")]
public static ObjectQuery<ActivityInfo> GetContactActivities(int contactId, string activityType, string cancelActivityType, int lastXDays, string whereCondition)
Parameters
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 or negative value is given, no constraint is applied)
whereConditionstringAdditional WHERE condition
Returns
GetContactsEdgeActivity(int, string, OrderDirection)
Returns TOP 1 from the contact's activities ordered by ActivityCreated.
ActivityType filter may be specified by setting value of activityType.
[Obsolete("Use CMS.Activities.ActivityInfoProviderExtensions.GetContactsLastActivity(IInfoProvider<ActivityInfo>, int, int) instead.")]
protected virtual ActivityInfo GetContactsEdgeActivity(int contactId, string activityType, OrderDirection orderBy)
Parameters
contactIdintContact ID
activityTypestringActivity type - optional
orderByOrderDirectionOrder by
Returns
Remarks
Use Ascending to obtain first contact's activity or Descending to obtain last contact's activity.
GetContactsFirstActivity(int, string)
Returns first contact's activity, may be restricted to specific activity type.
[Obsolete("Method is no longer used by the system and will be removed.")]
public static ActivityInfo GetContactsFirstActivity(int contactId, string activityType)
Parameters
contactIdintContact ID
activityTypestringActivity type - optional
Returns
GetContactsLastActivity(int, string)
Returns last contact's activity, may be restricted to specific activity type.
[Obsolete("Use CMS.Activities.ActivityInfoProviderExtensions.GetContactsLastActivity(IInfoProvider<ActivityInfo>, int, int) instead.")]
public static ActivityInfo GetContactsLastActivity(int contactId, string activityType)
Parameters
contactIdintContact ID
activityTypestringActivity type - optional