void IRegistrationRepository.CreateAffiliationReferral(AffiliationReferral affiliationReferral)
 {
     using (var dc = CreateContext())
     {
         dc.JoinReferralEntities.InsertOnSubmit(affiliationReferral.Map());
         dc.SubmitChanges();
     }
 }
Exemple #2
0
 public static JoinReferralEntity Map(this AffiliationReferral affiliationReferral)
 {
     return(new JoinReferralEntity
     {
         userId = affiliationReferral.RefereeId,
         promotionCode = affiliationReferral.PromotionCode,
         refererUrl = affiliationReferral.RefererUrl,
         referralCode = affiliationReferral.ReferralCode,
     });
 }
Exemple #3
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);
        }
Exemple #4
0
 void IReferralsCommand.CreateAffiliationReferral(AffiliationReferral affiliationReferral)
 {
     affiliationReferral.Prepare();
     affiliationReferral.Validate();
     _repository.CreateAffiliationReferral(affiliationReferral);
 }