public void SubtractFromMarketplaceBalance(Money value, String note, BalanceLogType balanceLogType = BalanceLogType.Other) { value = value.Positify(); MarketplaceBalance -= value; BalanceLog.Add(this, BalanceType.MarketplaceBalance, value.Negatify().ToDecimal(), note, balanceLogType); MarketplaceBalanceLogManager.MoneySpent(this.Id, value); }
public void SubstractFromLoginAdsCredits(int value, string note, BalanceLogType balanceLogType = BalanceLogType.Other) { if (value < 0) { throw new MsgException("You cannot add negative value."); } LoginAdsCredits -= value; BalanceLog.Add(this, BalanceType.LoginAdsCredits, -value, note, balanceLogType); }
public void SubtractFromPointsBalance(Int32 value, String note, BalanceLogType balanceLogType = BalanceLogType.Other, bool setMinPoints = true) { if (value < 0) { value = -value; } if (value != 0) { PointsBalance -= value; BalanceLog.Add(this, BalanceType.PointsBalance, -value, note, balanceLogType); LevelManager.PointsChanged(this, setMinPoints); } }
public void AddToPointsBalance(Int32 value, String note, BalanceLogType balanceLogType = BalanceLogType.Other, bool triggerActions = true, bool checkLeadershipSystem = true) { if (value != 0) { PointsBalance += value; BalanceLog.Add(this, BalanceType.PointsBalance, value, note, balanceLogType); LevelManager.PointsChanged(this, true, triggerActions); if (checkLeadershipSystem) { var list = new List <RestrictionKind>(); list.Add(RestrictionKind.Points); LeadershipSystem.CheckSystem(list, this); } } }
public void Downgrade(IMembership membership, bool setMinPoints = true, bool resolveReferrals = true) { setMembership(membership, AppSettings.ServerTime, null); if (resolveReferrals) { ResolveReferralLimits(membership); } if (AppSettings.Points.LevelMembershipPolicyEnabled && setMinPoints) { if (PointsBalance > membership.MinPointsToHaveThisLevel) { int substracted = PointsBalance - membership.MinPointsToHaveThisLevel; PointsBalance = membership.MinPointsToHaveThisLevel; SaveBalances(); BalanceLog.Add(this, BalanceType.PointsBalance, -substracted, "Level downgrade", BalanceLogType.Other); } } }
private void SubtractFromCryptocurrencyBalance(CryptocurrencyType cryptocurrencyType, CryptocurrencyMoney value, string note, BalanceLogType logType = BalanceLogType.Other) { UserCryptocurrencyBalance.Remove(this.Id, value, cryptocurrencyType); //Works on ONE crypto balance at the moment BalanceLog.Add(this, CryptocurrencyTypeHelper.ConvertToBalanceType(cryptocurrencyType), value.ToDecimal() * -1, note, logType); }
public void SubtractFromCommissionBalance(Money value, String note, BalanceLogType balanceLogType = BalanceLogType.Other) { value = value.Positify(); CommissionBalance -= value; BalanceLog.Add(this, BalanceType.CommissionBalance, value.Negatify().ToDecimal(), note, balanceLogType); }
public void AddToMarketplaceBalance(Money value, String note, BalanceLogType balanceLogType = BalanceLogType.Other) { MarketplaceBalance += value; BalanceLog.Add(this, BalanceType.MarketplaceBalance, value.ToDecimal(), note, balanceLogType); MarketplaceBalanceLog.Add(this.Id, value); }
public void AddToInvestmentBalance(Money value, String note, BalanceLogType balanceLogType = BalanceLogType.Other) { InvestmentBalance += value; BalanceLog.Add(this, BalanceType.InvestmentBalance, value.ToDecimal(), note, balanceLogType); }
public void AddToCommissionBalance(Money value, String note, BalanceLogType balanceLogType = BalanceLogType.Other) { CommissionBalance += value; BalanceLog.Add(this, BalanceType.CommissionBalance, value.ToDecimal(), note, balanceLogType); }
public void AddToPurchaseBalance(Money value, String note, BalanceLogType balanceLogType = BalanceLogType.Other) { PurchaseBalance += value; BalanceLog.Add(this, BalanceType.PurchaseBalance, value.ToDecimal(), note, balanceLogType); }