Example #1
0
        private ParticipantOrigin GetOriginFromStore(EmailAddressWrapper emailAddressWrapper)
        {
            StoreId storeId = null;

            try
            {
                storeId = IdConverter.ConvertItemIdToStoreId(emailAddressWrapper.ItemId, BasicTypes.Item);
            }
            catch (Exception ex)
            {
                this.LogException(ex, "Error occurred when getting store id from item id: {0}", new object[]
                {
                    emailAddressWrapper.ItemId
                });
            }
            if (storeId == null)
            {
                return(new OneOffParticipantOrigin());
            }
            int emailAddressIndex;

            if (!string.IsNullOrEmpty(emailAddressWrapper.EmailAddressIndex) && int.TryParse(emailAddressWrapper.EmailAddressIndex, out emailAddressIndex))
            {
                return(new StoreParticipantOrigin(storeId, (EmailAddressIndex)emailAddressIndex));
            }
            return(new StoreParticipantOrigin(storeId));
        }