public String GetClearStringBalance(BalanceType type) { if (BalanceTypeHelper.IsCryptoBalance(type)) { return(UserCryptocurrencyBalance.Get(Member.CurrentId, CryptocurrencyTypeHelper.ConvertToCryptocurrencyType(type)).ToClearString()); } return(GetBasicBalance(type).ToClearString()); }
private static int GetPurchaseBalanceDecimalPlaces() { if (BalanceTypeHelper.IsCryptoBalance(AppSettings.InternalExchange.InternalExchangePurchaseVia) && AppSettings.InternalExchange.InternalExchangePurchaseVia != BalanceType.BTC) { return(18); } return(8); }
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()); } }
protected void AllAskOffersGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[0].Text += String.Format("({0})", InternalExchangeManager.GetBalanceCode(true)); e.Row.Cells[1].Text += String.Format("({0})", InternalExchangeManager.GetBalanceCode(false)); e.Row.Cells[2].Text += String.Format("({0})", InternalExchangeManager.GetBalanceCode(false)); } if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header) { if (e.Row.RowIndex == 0) { e.Row.Style.Add("font-weight", "bold"); } e.Row.Cells[0].Style.Add("text-align", "right"); e.Row.Cells[1].Style.Add("text-align", "right"); e.Row.Cells[2].Style.Add("text-align", "right"); if (e.Row.RowType == DataControlRowType.DataRow) { if (BalanceTypeHelper.IsCryptoBalance(AppSettings.InternalExchange.InternalExchangeStockType)) { e.Row.Cells[0].Text = new CryptocurrencyMoney(CryptocurrencyType.BTC, Decimal.Parse(e.Row.Cells[0].Text)).ToClearString(); } else { e.Row.Cells[0].Text = new Money(Decimal.Parse(e.Row.Cells[0].Text)).ToClearString(); } if (BalanceTypeHelper.IsCryptoBalance(AppSettings.InternalExchange.InternalExchangePurchaseVia)) { e.Row.Cells[2].Text = new CryptocurrencyMoney(CryptocurrencyType.BTC, Decimal.Parse(e.Row.Cells[2].Text)).ToClearString(); e.Row.Cells[1].Text = new CryptocurrencyMoney(CryptocurrencyType.BTC, Decimal.Parse(e.Row.Cells[1].Text)).ToClearString(); } else { e.Row.Cells[2].Text = new Money(Decimal.Parse(e.Row.Cells[2].Text)).ToClearString(); e.Row.Cells[1].Text = new Money(Decimal.Parse(e.Row.Cells[1].Text)).ToClearString(); } e.Row.Cells[0].CssClass = "paramAskAmount"; e.Row.Cells[1].CssClass = "paramAskValue"; } } }
private void FillData() { BidButton.CssClass = "TabButton IeOfferSelected"; AskButton.CssClass = "TabButton IeOfferNotSelected"; if (AppSettings.InternalExchange.ICOInternalExchangeMinimalStockPrice <= Decimal.Zero) { if (!BalanceTypeHelper.IsCryptoBalance(AppSettings.InternalExchange.InternalExchangePurchaseVia) || AppSettings.InternalExchange.InternalExchangePurchaseVia == BalanceType.BTC) { PricePerStockRangeValidator.MinimumValue = "0.00000001"; // 1/8 } else { PricePerStockRangeValidator.MinimumValue = "0.000000000000000001"; // 1/18 } } else { PricePerStockRangeValidator.MinimumValue = AppSettings.InternalExchange.ICOInternalExchangeMinimalStockPrice.ToString(); } Amount_RangeValidator.MinimumValue = AppSettings.InternalExchange.InternalExchangeMinimalSellAmount.ToString("N18"); Amount_RangeValidator.Text = U6013.STOCKBUYERROR; NumberOfStockTextBox.Text = "0"; ValueOfStockTextBox.Text = "0"; TotalValueTextBox.Text = "0"; currentMultiplier.Text = (AppSettings.InternalExchange.InternalExchangeBidCommissionPercent / 100m).ToString(); UpdateStatistics(); UpdateGridViewTitles(); if (TitanFeatures.IsTrafficThunder) { EstimatedValueLabel.Visible = true; } ChartTitle = TitanFeatures.IsTrafficThunder ? string.Empty : String.Format("{0} ({1})", U6012.VALUEOFSTOCK, SignOfStock); }
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()); }