Exemplo n.º 1
0
    /// <summary>
    /// Loads activity info data.
    /// </summary>
    /// <param name="ai"></param>
    public override bool LoadData(ActivityInfo ai)
    {
        if (ai == null)
        {
            return(false);
        }

        string mvtComb     = null;
        string queryString = null;
        string abVariant   = null;

        switch (ai.ActivityType)
        {
        case PredefinedActivityType.LANDING_PAGE:
        case PredefinedActivityType.PAGE_VISIT:
            PageVisitInfo pvi = PageVisitInfoProvider.GetPageVisitInfoByActivityID(ai.ActivityID);
            if (pvi == null)
            {
                return(false);
            }

            mvtComb     = pvi.PageVisitMVTCombinationName;
            queryString = pvi.PageVisitDetail;
            abVariant   = pvi.PageVisitABVariantName;
            break;
        }

        // Loads data to grid
        ucDetails.AddRow("om.activitydetails.query", queryString);
        ucDetails.AddRow("om.activitydetails.abvariant", abVariant);
        ucDetails.AddRow("om.activitydetails.mvtcomb", mvtComb);
        return(ucDetails.IsDataLoaded);
    }
Exemplo n.º 2
0
        public int GenerateActivitiesForContacts(IEnumerable <ContactInfo> contacts, int mediumActivitiesCount, List <TreeNode> treeNodes)
        {
            var      activities = new List <ActivityInfo>();
            DateTime created    = DateTime.Now;

            foreach (var contact in contacts)
            {
                int activitiesCount = (int)(mediumActivitiesCount * StaticRandom.NextDouble() * 2);

                for (int i = 0; i < activitiesCount; i++)
                {
                    var treeNode = treeNodes[StaticRandom.Next(treeNodes.Count)];

                    var activityInfo = new ActivityInfo
                    {
                        ActivityCreated           = created,
                        ActivityType              = "pagevisit",
                        ActivityActiveContactID   = contact.ContactID,
                        ActivityOriginalContactID = contact.ContactID,
                        ActivitySiteID            = contact.ContactSiteID,
                        ActivityTitle             = "Page visit on '" + treeNode.DocumentName + "' page",
                        ActivityItemID            = 0,
                        ActivityItemDetailID      = 0,
                        ActivityURL         = treeNode.DocumentUrlPath,
                        ActivityNodeID      = treeNode.NodeID,
                        ActivityValue       = "",
                        ActivityIPAddress   = "123.123.456.789",
                        ActivityCampaign    = "",
                        ActivityURLReferrer = treeNode.DocumentUrlPath + "-totojereferrer",
                        ActivityCulture     = treeNode.DocumentCulture,
                    };

                    activities.Add(activityInfo);
                }
            }
            BulkInsertion.Insert(activities);

            var activityIds = ActivityInfoProvider.GetActivities().WhereEquals("ActivityCreated", created).Select(a => a.ActivityID);

            var pageVisits = new List <PageVisitInfo>();

            foreach (var activityId in activityIds)
            {
                var pageVisitInfo = new PageVisitInfo
                {
                    PageVisitActivityID         = activityId,
                    PageVisitMVTCombinationName = "",
                    PageVisitABVariantName      = "",
                    PageVisitDetail             = "?totojequerystring=prase",
                };

                pageVisits.Add(pageVisitInfo);
            }

            BulkInsertion.Insert(pageVisits);

            return(activities.Count);
        }
        public int GenerateActivitiesForContacts(IEnumerable<ContactInfo> contacts, int mediumActivitiesCount, List<TreeNode> treeNodes)
        {
            var activities = new List<ActivityInfo>();
            DateTime created = DateTime.Now;

            foreach (var contact in contacts)
            {
                int activitiesCount = (int)(mediumActivitiesCount * StaticRandom.NextDouble() * 2);

                for (int i = 0; i < activitiesCount; i++)
                {
                    var treeNode = treeNodes[StaticRandom.Next(treeNodes.Count)];

                    var activityInfo = new ActivityInfo
                    {
                        ActivityCreated = created,
                        ActivityType = "pagevisit",
                        ActivityActiveContactID = contact.ContactID,
                        ActivityOriginalContactID = contact.ContactID,
                        ActivitySiteID = contact.ContactSiteID,
                        ActivityTitle = "Page visit on '" + treeNode.DocumentName + "' page",
                        ActivityItemID = 0,
                        ActivityItemDetailID = 0,
                        ActivityURL = treeNode.DocumentUrlPath,
                        ActivityNodeID = treeNode.NodeID,
                        ActivityValue = "",
                        ActivityIPAddress = "123.123.456.789",
                        ActivityCampaign = "",
                        ActivityURLReferrer = treeNode.DocumentUrlPath + "-totojereferrer",
                        ActivityCulture = treeNode.DocumentCulture,
                    };

                    activities.Add(activityInfo);
                }
            }
            BulkInsertion.Insert(activities);

            var activityIds = ActivityInfoProvider.GetActivities().WhereEquals("ActivityCreated", created).Select(a => a.ActivityID);

            var pageVisits = new List<PageVisitInfo>();

            foreach (var activityId in activityIds)
            {
                var pageVisitInfo = new PageVisitInfo
                {
                    PageVisitActivityID = activityId,
                    PageVisitMVTCombinationName = "",
                    PageVisitABVariantName = "",
                    PageVisitDetail = "?totojequerystring=prase",
                };

                pageVisits.Add(pageVisitInfo);
            }

            BulkInsertion.Insert(pageVisits);

            return activities.Count;
        }