예제 #1
0
        public void GenerateScores(int scoresCount, int siteId)
        {
            List <ScoreInfo> scores = new List <ScoreInfo>();

            for (int i = 0; i < scoresCount; i++)
            {
                ScoreInfo score = new ScoreInfo
                {
                    ScoreDisplayName      = "Score #" + i,
                    ScoreName             = "Score-" + Guid.NewGuid(),
                    ScoreBelongsToPersona = false,
                    ScoreEnabled          = true,
                    ScoreStatus           = 0,
                    ScoreSiteID           = siteId
                };
                score.Insert();
                scores.Add(score);
            }

            List <RuleInfo> rules = new List <RuleInfo>();

            foreach (var score in scores)
            {
                rules.AddRange(GenerateRules(score));
            }

            BulkInsertion.Insert(rules);
        }
예제 #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);
        }
예제 #3
0
        public void Generate(int contactsCount)
        {
            List <BaseInfo> contacts = new List <BaseInfo>();

            for (int i = 0; i < contactsCount; ++i)
            {
                contacts.Add(CreateContactInfo(mCompanyNames));
            }

            BulkInsertion.Insert(contacts);
        }