예제 #1
0
        private void CreateReferral(HttpCookieCollection cookies, Guid userId)
        {
            var pcode      = cookies.GetCookieValue(PromoCodeCookie);
            var refcode    = cookies.GetCookieValue(ReferrerCodeCookie);
            var refererUrl = cookies.GetCookieValue(ReferrerUrlCookie);

            if (string.IsNullOrEmpty(pcode) && string.IsNullOrEmpty(refcode) && string.IsNullOrEmpty(refererUrl))
            {
                return;
            }

            var referral = new AffiliationReferral {
                RefereeId = userId, PromotionCode = pcode, ReferralCode = refcode, RefererUrl = refererUrl
            };

            _referralsCommand.CreateAffiliationReferral(referral);
        }