Пример #1
0
    private void btnSave_Click(object sender, EventArgs e)
    {
        if (userIsAuthorized && (activityId > 0))
        {
            ActivityInfo ai = ActivityInfoProvider.GetActivityInfo(activityId);
            EditedObject = ai;
            ai.ActivityComment = txtComment.Value;
            ai.ActivityTitle = TextHelper.LimitLength(txtTitle.Text, 250, String.Empty);
            ai.ActivityURLReferrer = txtURLRef.Text;
            ai.ActivityURL = txtURL.Text;

            // Get changed columns
            List<string> changes = ai.ChangedColumns();

            // Save activity info
            ActivityInfoProvider.SetActivityInfo(ai);
            
            if ((changes != null) && (changes.Count > 0))
            {
                // Get IDs of scores where activity's contact exceeded score limit
                DataSet limitScores = ScoreInfoProvider.GetScoresWhereContactExceededLimit(ai.ActivityActiveContactID);

                // Recalculate scoring groups
                ScoreInfoProvider.RecalculateScores(ai.ActivityType, RuleTypeEnum.Activity, ai.ActivityActiveContactID, ai.ActivitySiteID);

                // Check if contact gained enough points and alternatively send notification e-mail
                ScoreInfoProvider.CheckScoringLimits(ContactInfoProvider.GetContactInfo(ai.ActivityActiveContactID), limitScores);
            }


            // Reload form (due to "view URL" button)
            LoadData();
        }
    }
        private void GeneratePurchaseActivity(double spent, ContactInfo contact)
        {
            var activity = new ActivityInfo
            {
                ActivityTitle     = nameBuilder.CreateTitle(PredefinedActivityType.PURCHASE, "$" + spent),
                ActivityValue     = spent.ToString(CultureHelper.EnglishCulture),
                ActivityItemID    = 0,
                ActivityType      = PredefinedActivityType.PURCHASE,
                ActivitySiteID    = currentSite.SiteID,
                ActivityContactID = contact.ContactID
            };

            ActivityInfoProvider.SetActivityInfo(activity);
        }
Пример #3
0
    void btnSave_Click(object sender, EventArgs e)
    {
        if (userIsAuthorized && (activityId > 0))
        {
            ActivityInfo ai = ActivityInfoProvider.GetActivityInfo(activityId);
            EditedObject       = ai;
            ai.ActivityComment = txtComment.Value;
            ai.ActivityTitle   = TextHelper.LimitLength(txtTitle.Text, 250, String.Empty);
            ai.ActivityURL     = txtURL.Text;
            ActivityInfoProvider.SetActivityInfo(ai);

            // Reload form (due to "view URL" button)
            LoadData();
        }
    }
        private void GeneratePageVisitActivity(TreeNode document, ContactInfo contact)
        {
            var nameBuilder = new ActivityTitleBuilder();
            var hashService = Service.Resolve <IActivityUrlHashService>();
            var url         = DocumentURLProvider.GetAbsoluteLiveSiteURL(document);

            var activity = new ActivityInfo
            {
                ActivityContactID = contact.ContactID,
                ActivitySiteID    = currentSite.SiteID,
                ActivityTitle     = nameBuilder.CreateTitle(PredefinedActivityType.PAGE_VISIT, document.GetDocumentName()),
                ActivityType      = PredefinedActivityType.PAGE_VISIT,
                ActivityURL       = url,
                ActivityURLHash   = hashService.GetActivityUrlHash(url)
            };

            ActivityInfoProvider.SetActivityInfo(activity);
        }
Пример #5
0
    private void btnSave_Click(object sender, EventArgs e)
    {
        if (userIsAuthorized && (activityId > 0))
        {
            ActivityInfo activity = ActivityInfoProvider.GetActivityInfo(activityId);
            EditedObject                 = activity;
            activity.ActivityComment     = txtComment.Value;
            activity.ActivityTitle       = TextHelper.LimitLength(txtTitle.Text, 250, String.Empty);
            activity.ActivityURLReferrer = txtURLRef.Text;
            activity.ActivityURL         = txtURL.Text;

            // Save activity info
            ActivityInfoProvider.SetActivityInfo(activity);

            // Reload form (due to "view URL" button)
            LoadData();

            ltlScript.Text = ScriptHelper.GetScript("CloseDialog();");
        }
    }
        private static void GenerateFakeActivity(string campaignUTMcode, string type, ActivityDataParameters activityDataParameter, int nodeID, int itemID, int siteID, int contactID, string activityUrl = null)
        {
            var hashService = Service.Resolve <IActivityUrlHashService>();
            var activity    = new ActivityInfo
            {
                ActivitySiteID    = siteID,
                ActivityContactID = contactID,
                ActivityCampaign  = campaignUTMcode,
                ActivityType      = type,
                ActivityNodeID    = nodeID,
                ActivityItemID    = itemID,
                ActivityURL       = activityUrl,
                ActivityURLHash   = activityUrl != null?hashService.GetActivityUrlHash(activityUrl) : 0,
                                        ActivityUTMSource  = activityDataParameter.UtmSource,
                                        ActivityUTMContent = activityDataParameter.UtmContent,
                                        ActivityTitle      = "GeneratedActivity_" + type + "_" + contactID
            };

            ActivityInfoProvider.SetActivityInfo(activity);
        }
Пример #7
0
 private static void GenerateFakeActivity(
     string campaignUtMcode,
     string type,
     ActivityDataParameters activityDataParameter,
     int nodeId,
     int itemId,
     int siteId,
     int contactId)
 {
     ActivityInfoProvider.SetActivityInfo(new ActivityInfo
     {
         ActivitySiteID    = siteId,
         ActivityContactID = contactId,
         ActivityCulture   = "en-US",
         ActivityCampaign  = campaignUtMcode,
         ActivityType      = type,
         //ActivityURL = string.IsNullOrEmpty(activityUrl) ? "/" : activityUrl,
         ActivityNodeID     = nodeId,
         ActivityItemID     = itemId,
         ActivityUTMSource  = activityDataParameter.UtmSource,
         ActivityUTMContent = activityDataParameter.UtmContent,
         ActivityTitle      = "GeneratedActivity_" + type + "_" + contactId
     });
 }
        private void CreateFormSubmission(TreeNode document, string formName, ContactInfo contact)
        {
            var form      = BizFormInfoProvider.GetBizFormInfo(formName, currentSite.SiteID);
            var classInfo = DataClassInfoProvider.GetDataClassInfo(form.FormClassID);
            var formItem  = new BizFormItem(classInfo.ClassName);
            var url       = DocumentURLProvider.GetAbsoluteLiveSiteURL(document);

            CopyDataFromContactToForm(contact, classInfo, formItem);
            SetFormSpecificData(formName, contact, formItem);
            formItem.Insert();

            var activity = new ActivityInfo
            {
                ActivityContactID    = contact.ContactID,
                ActivityItemID       = form.FormID,
                ActivityItemDetailID = formItem.ItemID,
                ActivitySiteID       = currentSite.SiteID,
                ActivityTitle        = nameBuilder.CreateTitle(PredefinedActivityType.BIZFORM_SUBMIT, form.FormDisplayName),
                ActivityType         = PredefinedActivityType.BIZFORM_SUBMIT,
                ActivityURL          = url
            };

            ActivityInfoProvider.SetActivityInfo(activity);
        }