Пример #1
0
 public override void OnStartUp()
 {
     this.Member = MemberStrategy.GetMemberFromSession(this.SessionId);
     if (this.Member == null)
     {
         this.StopProcess();
     }
 }
Пример #2
0
        public void PurchaseBonus(string sessionId)
        {
            var memberId = MemberStrategy.GetMemberFromSession(sessionId)?.id;

            if (memberId == null)
            {
                return;
            }
            this.Bonuses.Entity.member_id = memberId;
            this.Bonuses.Insert();
            TokensStrategy.Add(memberId, -this.Campaign.Entity.price);
        }
Пример #3
0
        public override IEnumerable <ValidationResult> Validate()
        {
            yield return(this.ValidateSession());

            if (this.IsValid(nameof(this.SessionId), nameof(this.SessionKey)))
            {
                this.Library.Member = MemberStrategy.GetMemberFromSession(this.SessionId);
                this.Library.Carts.Entity.SetValuesFromModel(this);
                yield return(this.Library.ValidateCart(nameof(this.SessionKey)));

                this.Library.GetCartItems();
                yield return(this.Library.ValidateWallet(this.SessionId, nameof(this.SessionId)));
            }
        }