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); }
private void InsertOrderHeaders(out int orderId, out int totalPoints) { var orderHeader = _DB.OrderHeaders; orderHeader.Entity.member_id = this.Member.id; orderHeader.Entity.price = this.TotalPrice; orderHeader.Entity.points = this.TotalPoints; orderHeader.Insert(); orderId = orderHeader.Entity.id ?? 0; totalPoints = orderHeader.Entity.points ?? 0; TokensStrategy.Add(this.Member.id, totalPoints); MemberStrategy.UpdateMemberWallet(this.Member.id, -this.TotalPrice); }