コード例 #1
0
        private void CreateFormSubmission(TreeNode document, string formName, ContactInfo contact)
        {
            var form      = BizFormInfo.Provider.Get(formName, mSite.SiteID);
            var classInfo = DataClassInfoProvider.GetDataClassInfo(form.FormClassID);
            var formItem  = new BizFormItem(classInfo.ClassName);
            var url       = DocumentURLProvider.GetAbsoluteUrl(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       = mSite.SiteID,
                ActivityTitle        = nameBuilder.CreateTitle(PredefinedActivityType.BIZFORM_SUBMIT, form.FormDisplayName),
                ActivityType         = PredefinedActivityType.BIZFORM_SUBMIT,
                ActivityURL          = url
            };

            ActivityInfo.Provider.Set(activity);
        }
コード例 #2
0
        private void GeneratePurchaseActivity(double spent, ContactInfo contact)
        {
            var activityTitleBuilder = new ActivityTitleBuilder();

            ActivityInfoProvider.SetActivityInfo(new ActivityInfo
            {
                ActivityTitle = activityTitleBuilder.CreateTitle("purchase", "$" + spent),
                ActivityValue = spent.ToString(CultureHelper.EnglishCulture),
                //ActivityURL = "/",
                ActivityItemID    = 0,
                ActivityType      = "purchase",
                ActivitySiteID    = _mSiteInfo.SiteID,
                ActivityContactID = contact.ContactID
            });
        }
コード例 #3
0
        private void GeneratePageVisitActivity(TreeNode document, ContactInfo contact)
        {
            var nameBuilder = new ActivityTitleBuilder();
            var url         = DocumentURLProvider.GetAbsoluteUrl(document);

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

            ActivityInfo.Provider.Set(activity);
        }