コード例 #1
0
        private void GetMediumSourceByRef()
        {
            Entity leadSourceUrlEntity          = null;
            Entity subDomainLeadSourceUrlEntity = null;

            foreach (Entity item in LeadSourceUrl)
            {
                string urlLookupValue    = item.GetTypedColumnValue <string>("URL");
                string dotUrlLookupValue = string.Format(".{0}", urlLookupValue);
                if (bpmRef.Equals(urlLookupValue, StringComparison.OrdinalIgnoreCase))
                {
                    leadSourceUrlEntity = item;
                }
                if (bpmRef.EndsWith(dotUrlLookupValue, StringComparison.OrdinalIgnoreCase))
                {
                    subDomainLeadSourceUrlEntity = item;
                }
            }
            leadSourceUrlEntity = leadSourceUrlEntity ?? subDomainLeadSourceUrlEntity;
            if (leadSourceUrlEntity == null)
            {
                if (ResultLeadMediumId == Guid.Empty)
                {
                    ResultLeadMediumId = LeadMediumConsts.LeadMediumReferrerTrafficId;
                }
                ResultLeadSourceId = LeadSourceConsts.LeadSourceOtherId;
                return;
            }
            ResultLeadSourceId = leadSourceUrlEntity.GetTypedColumnValue <Guid>("LeadSourceId");
            var leadSourceEntity = LeadSource.Find("Id", leadSourceUrlEntity.GetTypedColumnValue <Guid>("LeadSourceId"));

            if (leadSourceEntity != null)
            {
                ResultLeadSourceId = leadSourceEntity.GetTypedColumnValue <Guid>("Id");
                if (ResultLeadMediumId == Guid.Empty)
                {
                    ResultLeadMediumId = leadSourceEntity.GetTypedColumnValue <Guid>("LeadMediumId");
                }
            }
        }
コード例 #2
0
        private void GetMediumSourceByUtm()
        {
            string utmMediumValue   = bpmHrefParameters["utm_medium"];
            string utmSourceValue   = bpmHrefParameters["utm_source"];
            string utmCampaignValue = bpmHrefParameters["utm_campaign"];
            Guid   leadMediumId     = Guid.Empty;
            Guid   leadSourceId     = Guid.Empty;

            if (!string.IsNullOrEmpty(utmMediumValue))
            {
                var leadMediumEntity = LeadMediumCode.Find("Code", utmMediumValue);
                if (leadMediumEntity != null)
                {
                    leadMediumId = leadMediumEntity.GetTypedColumnValue <Guid>("LeadMediumId");
                }
            }
            if (!string.IsNullOrEmpty(utmSourceValue) || !string.IsNullOrEmpty(utmCampaignValue))
            {
                var searchValue          = !string.IsNullOrEmpty(utmSourceValue) ? utmSourceValue : utmCampaignValue;
                var LeadSourceCodeEntity = LeadSourceCode.Find("Code", searchValue);
                if (LeadSourceCodeEntity != null)
                {
                    leadSourceId = LeadSourceCodeEntity.GetTypedColumnValue <Guid>("LeadSourceId");
                    if (leadMediumId == Guid.Empty)
                    {
                        var leadSourceEntity = LeadSource.Find("Id", leadSourceId);
                        if (leadSourceEntity != null)
                        {
                            leadMediumId = leadSourceEntity.GetTypedColumnValue <Guid>("LeadMediumId");
                        }
                    }
                }
            }
            ResultLeadMediumId = leadMediumId;
            ResultLeadSourceId = leadSourceId;
        }
コード例 #3
0
 public LeadSource(LeadSource source)
     : base(source)
 {
 }
コード例 #4
0
 public LeadSource(Terrasoft.Configuration.LeadSource source)
     : base(source)
 {
     this.CopyEntityLookupProperties(source);
 }