public bool IssuePoints(string userId, int points)
 {
     using (var strategy = CreateStrategy())
     {
         var rewardPoint = new hcc_RewardsPoints
         {
             Points          = points,
             StoreId         = Context.CurrentStore.Id,
             UserId          = userId,
             TransactionTime = DateTime.UtcNow
         };
         strategy.Add(rewardPoint);
         return(strategy.SubmitChanges());
     }
 }
        public bool DecreasePoints(string userId, int points)
        {
            var currentPoints = FindAvailablePoints(userId);

            if (currentPoints - points < 0)
            {
                return(false);
            }

            using (var strategy = CreateStrategy())
            {
                var rewardPoint = new hcc_RewardsPoints
                {
                    Points          = -1 * points,
                    StoreId         = Context.CurrentStore.Id,
                    UserId          = userId,
                    TransactionTime = DateTime.UtcNow
                };
                strategy.Add(rewardPoint);
                return(strategy.SubmitChanges());
            }
        }