public String GetClearStringBalance(BalanceType type) { if (BalanceTypeHelper.IsCryptoBalance(type)) { return(UserCryptocurrencyBalance.Get(Member.CurrentId, CryptocurrencyTypeHelper.ConvertToCryptocurrencyType(type)).ToClearString()); } return(GetBasicBalance(type).ToClearString()); }
public decimal GetDecimalBalance(BalanceType type) { if (BalanceTypeHelper.IsCryptoBalance(type)) { return(UserCryptocurrencyBalance.Get(Member.CurrentId, CryptocurrencyTypeHelper.ConvertToCryptocurrencyType(type)).ToDecimal()); } else { return(GetBasicBalance(type).ToDecimal()); } }
public static String RecognizeCurrencyAndReturnString(bool asStock, decimal value) { BalanceType targetType = asStock ? AppSettings.InternalExchange.InternalExchangeStockType : AppSettings.InternalExchange.InternalExchangePurchaseVia; if (BalanceTypeHelper.IsCryptoBalance(targetType)) { return(new CryptocurrencyMoney(CryptocurrencyTypeHelper.ConvertToCryptocurrencyType(targetType), value).ToString()); } return(new Money(value).ToString()); }
public static String GetBalanceCode(bool isStock) { BalanceType targetBalance = isStock == true ? AppSettings.InternalExchange.InternalExchangeStockType : AppSettings.InternalExchange.InternalExchangePurchaseVia; if (BalanceTypeHelper.IsCryptoBalance(targetBalance)) { return(CryptocurrencyFactory.Get(CryptocurrencyTypeHelper.ConvertToCryptocurrencyType(targetBalance)).Code); } return(AppSettings.Site.CurrencyCode); }
public static String GetBalanceSign(bool isStock) { BalanceType targetBalance = isStock == true ? AppSettings.InternalExchange.InternalExchangeStockType : AppSettings.InternalExchange.InternalExchangePurchaseVia; if (BalanceTypeHelper.IsCryptoBalance(targetBalance)) { Cryptocurrency crypto = CryptocurrencyFactory.Get(CryptocurrencyTypeHelper.ConvertToCryptocurrencyType(targetBalance)); if (String.IsNullOrEmpty(crypto.CurrencyDisplaySignBefore)) { return(crypto.CurrencyDisplaySignAfter.Trim()); } return(crypto.CurrencyDisplaySignBefore.Trim()); } return(AppSettings.Site.CurrencySign.Trim()); }
public String GetStringBalance(BalanceType type) { if (BalanceTypeHelper.IsCryptoBalance(type)) { return(UserCryptocurrencyBalance.Get(Member.CurrentId, CryptocurrencyTypeHelper.ConvertToCryptocurrencyType(type)).ToString().Trim()); } else { if (type == BalanceType.PTCCredits || type == BalanceType.PointsBalance) { return(GetBasicBalance(type).ToClearString().Trim()); } return(GetBasicBalance(type).ToString().Trim()); } }
public static String GetDisplayValue(BalanceType balanceType, decimal input) { Money ValueInMoney = new Money(input); if (balanceType == BalanceType.PointsBalance) { return(ValueInMoney.AsPoints().ToString()); } else if (balanceType == BalanceType.PTCCredits) { return(ValueInMoney.ToClearString()); } else if (BalanceTypeHelper.IsCryptoBalance(balanceType)) { return((new CryptocurrencyMoney(CryptocurrencyTypeHelper.ConvertToCryptocurrencyType(balanceType), input)).ToString()); } return(ValueInMoney.ToString()); }