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.")]
[ObsoleteSince(29, 5)]
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
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.")]
[ObsoleteSince(29, 0)]
public static void BulkInsert(IEnumerable<IDataTransferObject> activities)
Parameters
activities
IEnumerable<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.")]
[ObsoleteSince(29, 0)]
public static int BulkInsertAndGetLastID(IEnumerable<IDataTransferObject> activities)
Parameters
activities
IEnumerable<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.")]
[ObsoleteSince(29, 5)]
public static void BulkMoveActivitiesToAnotherContact(int sourceContactID, int targetContactID)
Parameters
sourceContactID
intIdentifier of the contact the activities are moved from
targetContactID
intIdentifier 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.")]
[ObsoleteSince(29, 5)]
public static bool ContactDidActivity(int contactId, string activityType, string cancelActivityType, int lastXDays, string whereCondition)
Parameters
contactId
intContact ID
activityType
stringName of the activity to check (can specify more than one separated with semicolon, all of the types match than)
cancelActivityType
stringName of the activity which cancels the original activity.
lastXDays
intConstraint for last X days (if zero or negative value is given, no constraint is applied)
whereCondition
stringAdditional 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.")]
[ObsoleteSince(29, 5)]
public static bool ContactDidActivityWithValue(int contactId, string activityType, string queryOperator, string value, int lastXDays)
Parameters
contactId
intContact ID.
activityType
stringName of the activity to check.
queryOperator
stringOperator (notcontains, notcontains, startswith, endswith, equals, notequals).
value
stringValue of ActivityValue column.
lastXDays
intConstraint 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.")]
[ObsoleteSince(29, 5)]
public static ObjectQuery<ActivityInfo> GetContactActivities(int contactId, string activityType, string cancelActivityType, int lastXDays, string whereCondition)
Parameters
contactId
intContact ID
activityType
stringName of the activity to check (can specify more than one separated with semicolon, all of the types match than)
cancelActivityType
stringName of the activity which cancels the original activity.
lastXDays
intConstraint for last X days (if zero or negative value is given, no constraint is applied)
whereCondition
stringAdditional 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.")]
[ObsoleteSince(29, 5)]
protected virtual ActivityInfo GetContactsEdgeActivity(int contactId, string activityType, OrderDirection orderBy)
Parameters
contactId
intContact ID
activityType
stringActivity type - optional
orderBy
OrderDirectionOrder 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.")]
[ObsoleteSince(29, 5)]
public static ActivityInfo GetContactsFirstActivity(int contactId, string activityType)
Parameters
contactId
intContact ID
activityType
stringActivity 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.")]
[ObsoleteSince(29, 5)]
public static ActivityInfo GetContactsLastActivity(int contactId, string activityType)
Parameters
contactId
intContact ID
activityType
stringActivity type - optional