/// <summary>
        /// Get a contact for a user and decide whether to merge matching activities.
        /// </summary>
        /// <param name="userName">User name of the user to get a contact for</param>
        /// <param name="forceMatching">Merge matched activities to contact</param>
        /// <returns><see cref="ContactInfo"/> returned for the user.</returns>
        private async Task <ContactInfo> GetContactAsync(string userName, bool forceMatching)
        {
            if (!mContactProcessingChecker.CanProcessContactInCurrentContext())
            {
                return(null);
            }

            var userInfo = await GetCurrentUserInfoAsync(userName);

            var currentContact = mCurrentContactProvider.GetCurrentContact(userInfo, forceMatching);

            mCurrentContactProvider.SetCurrentContact(currentContact);

            return(currentContact);
        }
Beispiel #2
0
        private void SetCustomerRelationAndUpdateContact(CustomerInfo customerInfo)
        {
            if (mCurrentContactProvider == null)
            {
                return;
            }

            var currentContact = mCurrentContactProvider.GetCurrentContact(MembershipContext.AuthenticatedUser, false);

            mCurrentContactProvider.SetCurrentContact(currentContact);

            Service.Entry <IContactRelationAssigner>().Assign(MemberTypeEnum.EcommerceCustomer, customerInfo, currentContact, true);
            ContactInfoProvider.UpdateContactFromExternalData(
                customerInfo,
                DataClassInfoProvider.GetDataClassInfo(CustomerInfo.TYPEINFO.ObjectClassName).ClassContactOverwriteEnabled,
                currentContact.ContactID);
        }
Beispiel #3
0
        /// <summary>
        /// Get a contact for a user and decide whether to merge matching activities.
        /// </summary>
        /// <param name="userName">User name of the user to get a contact for</param>
        /// <param name="forceMatching">Merge matched activities to contact</param>
        /// <returns><see cref="ContactInfo"/> returned for the user.</returns>
        private async Task <ContactInfo> GetContactAsync(string userName, bool forceMatching)
        {
            var currentSite         = (SiteInfo)mSiteService.CurrentSite;
            var requestDependencies = GetRequestDependencies();

            if (!CheckEnabled(currentSite, requestDependencies))
            {
                return(null);
            }

            var userInfo = await GetCurrentUserInfoAsync(userName);

            var currentContact = mCurrentContactProvider.GetCurrentContact(userInfo, forceMatching);

            mCurrentContactProvider.SetCurrentContact(currentContact);

            return(currentContact);
        }