protected void btnDepositBTC_Click(object sender, EventArgs e) { try { if (BtcCryptocurrency.DepositEnabled) { if (CryptocurrencyApiFactory.GetDepositApi(BtcCryptocurrency).AllowToUsePaymentButtons()) { BTCDepositInfopanel.Visible = false; var amount = Money.Parse(BTCAmountTextBox.Text).FromMulticurrency(); var bg = new DepositCryptocurrencyButtonGenerator(user, amount); BTCPaymentButton.Text = GenerateHTMLButtons.GetBtcButton(bg); } else { classicbtcDepositBTC.Visible = false; BTCValuePanel.Visible = true; string adminAddress = CryptocurrencyApiFactory.Get(BtcCryptocurrency.DepositApiProcessor).TryGetAdminAddress(); WalletToBTCPanel.Visible = true; ClassicBTCPanel.Visible = true; if (!string.IsNullOrWhiteSpace(adminAddress)) { multipleDepositWarningLiteral.Visible = true; multipleDepositWarningLiteral.Text = "<p class='alert alert-warning'>" + U5005.MUSTWAITTODEPOSIT + "</p>"; BitcoinQRCode.ImageUrl = "~/Handlers/Utils/BitcoinQRCode.ashx?address=" + adminAddress; depositBTCLabel.Text = adminAddress; DepositBTCInfoPanel.Visible = true; DepositBTCInfoLabel.Text = string.Format(U4200.DEPOSITBTCDESCRIPTION, "<b>" + adminAddress + "</b>", "<br/>", BtcCryptocurrency.DepositMinimumConfirmations.ToString()); } else { depositBTCLabel.Text = "<p class='alert alert-danger'>" + U4200.DEPOSITUNAVAILABLE + "</p>"; } } } else { throw new MsgException(U4200.DEPOSITUNAVAILABLE); } } catch (MsgException ex) { ErrorMessagePanelBTC.Visible = true; ErrorMessageBTC.Text = ex.Message; } catch (Exception ex) { ErrorLogger.Log(ex); ErrorMessagePanelBTC.Visible = true; ErrorMessageBTC.Text = ex.Message; } }
public static string GetPaymentButtons(BaseButtonGenerator bg) { var BtcCryptocurrency = CryptocurrencyFactory.Get(CryptocurrencyType.BTC); int buttonsPresent = 0; StringBuilder sb = new StringBuilder(); foreach (var t in PaymentAccountDetails.PaymentAccountDetailsClasses) { var instance = Activator.CreateInstance(t); var gateway = (PaymentAccountDetails)PaymentAccountDetails.RunStaticMethod(t, "GetFirstIncomeGateway"); if (gateway != null && gateway.AccountType != "MPesaAgent") //MPesaAgent do not support payment buttons { bg.Strategy = gateway.GetStrategy(); sb.Append(bg.Generate()); buttonsPresent++; } } if (BtcCryptocurrency.DepositEnabled && CryptocurrencyApiFactory.Get(BtcCryptocurrency.DepositApiProcessor).AllowToUsePaymentButtons()) { sb.Append(GetBtcButton(bg)); buttonsPresent++; } if (buttonsPresent == 0) { return(U6011.NOACTIVEPAYMENTPROCESSORS); } return(sb.ToString()); }
protected override object GetDataFromSource() { var gateways = PaymentAccountDetails.AllGateways; var availableGateways = new HashSet <PaymentProcessor>(); foreach (var gateway in gateways) { if (gateway.IsActive && (gateway.Cashflow == GatewayCashflowDirection.ToGate || gateway.Cashflow == GatewayCashflowDirection.Both)) { availableGateways.Add(gateway.GetProcessorType()); } } var cryptocurrencies = CryptocurrencyFactory.GetAllAvailable(); foreach (var crypto in cryptocurrencies) { if (crypto.DepositApiProcessor != 0 && CryptocurrencyApiFactory.Get(crypto.DepositApiProcessor).AllowToUsePaymentButtons()) { if (crypto.DepositApiProcessor == CryptocurrencyAPIProvider.CoinPayments) { availableGateways.Add(PaymentProcessor.CoinPayments); } if (crypto.DepositApiProcessor == CryptocurrencyAPIProvider.Coinbase) { availableGateways.Add(PaymentProcessor.Coinbase); } } } return(availableGateways.Distinct().ToList()); }
protected override object GetDataFromSource() { Dictionary <CryptocurrencyAPIProvider, CryptocurrencyApi> data = new Dictionary <CryptocurrencyAPIProvider, CryptocurrencyApi>(); foreach (Type cryptocurrencyApiType in CryptocurrencyApiFactory.GetArrayOfSupportedTypes()) { CryptocurrencyApi cryptocurrencyApi = (CryptocurrencyApi)Activator.CreateInstance(cryptocurrencyApiType); data.Add(cryptocurrencyApi.ApiType, cryptocurrencyApi); } return(data); }
public static string GetPaymentButton(BaseButtonGenerator bg, CryptocurrencyType t) { var cryptocurrency = CryptocurrencyFactory.Get(t); var sb = new StringBuilder(); if (cryptocurrency.DepositEnabled && CryptocurrencyApiFactory.Get(cryptocurrency.DepositApiProcessor).AllowToUsePaymentButtons()) { sb.Append(GetBtcButton(bg)); } return(string.IsNullOrEmpty(sb.ToString()) ? U6011.NOACTIVEPAYMENTPROCESSORS : sb.ToString()); }
public static string GetBtcButton(BaseButtonGenerator bg) { StringBuilder sb = new StringBuilder(); var BtcCryptocurrency = CryptocurrencyFactory.Get(CryptocurrencyType.BTC); if (BtcCryptocurrency.DepositEnabled && CryptocurrencyApiFactory.Get(BtcCryptocurrency.DepositApiProcessor).AllowToUsePaymentButtons()) { bg.Strategy = CryptocurrencyApiFactory.Get(BtcCryptocurrency.DepositApiProcessor).GetStrategy(); sb.Append(bg.Generate()); } return(sb.ToString()); }
protected override object GetDataFromSource() { var gateways = PaymentAccountDetails.AllGateways; foreach (var gateway in gateways) { if (gateway.IsActive && (gateway.Cashflow == GatewayCashflowDirection.ToGate || gateway.Cashflow == GatewayCashflowDirection.Both)) { return(true); } } var BtcCryptocurrency = CryptocurrencyFactory.Get(CryptocurrencyType.BTC); if (BtcCryptocurrency.DepositEnabled && CryptocurrencyApiFactory.Get(BtcCryptocurrency.DepositApiProcessor).AllowToUsePaymentButtons()) { return(true); } return(false); }
protected void Page_Load(object sender, EventArgs e) { AccessManager.RedirectIfDisabled(AppSettings.TitanFeatures.MoneyTransferEnabled); user = Member.Current; AppSettings.Reload(); BtcCryptocurrency = CryptocurrencyFactory.Get <BitcoinCryptocurrency>(); EthCryptocurrency = CryptocurrencyFactory.Get <EthereumCryptocurrency>(); XrpCryptocurrency = CryptocurrencyFactory.Get <RippleCryptocurrency>(); TokenCryptocurrency = CryptocurrencyFactory.Get <RippleCryptocurrency>(); DepositButton.Visible = AppSettings.Representatives.RepresentativesHelpDepositEnabled; if (!Page.IsPostBack) { if (BtcCryptocurrency.DepositEnabled) { BTCButton.Visible = !CryptocurrencyApiFactory.GetDepositApi(BtcCryptocurrency).AllowToUsePaymentButtons(); if (TitanFeatures.IsRofriqueWorkMines) { BTCButton.Text = "BTC Deposits"; } else { BTCButton.Text = "BTC"; } } if (TitanFeatures.IsFlotrading) { BalanceButton.CssClass = ""; BTCButton.CssClass = "ViewSelected"; MenuMultiView.ActiveViewIndex = 1; } if (TitanFeatures.IsTrafficThunder) { UserBalancesPlaceHolder.Visible = false; } AppSettings.Reload(); LangAdder.Add(DepositButton, U6010.DEPOSITVIAREPRESENTATIVE); LangAdder.Add(btnTransfer, L1.TRANSFER); LangAdder.Add(DepositViaRepresentativeButton, U6010.SENDTRANSFERMESSAGE); LangAdder.Add(MPesaConfirmButton, L1.CONFIRM); LangAdder.Add(BTCAmountRequiredFieldValidator, U2502.INVALIDMONEYFORMAT); LangAdder.Add(CalculatePointsValueButton, U6007.CALCULATE); //MPesa? if (Request.QueryString["mpesa"] != null) { StandardTransferPlaceHolder.Visible = false; MPesaTransferPlaceHolder2.Visible = true; var gateway = PaymentAccountDetails.GetFirstIncomeGateway <MPesaSapamaAccountDetails>(); MPesaAmount.Text = String.Format(U6005.TODEPOSITVIAMPESA, gateway.Username, gateway.Username, Money.Parse(Request.QueryString["mpesa"]).ToString()); } //Pre-selected tab if (Request.QueryString["button"] != null) { var button = (Button)MenuButtonPlaceHolder.FindControl("Button" + Request.QueryString["button"]); MenuButton_Click(button, null); } RadioFrom.Items.AddRange(GenerateHTMLButtons.DepositBalanceFromItems); if (TitanFeatures.IsRofriqueWorkMines && !CryptocurrencyApiFactory.GetDepositApi(BtcCryptocurrency).AllowToUsePaymentButtons()) { RadioFrom.Items.Add(new ListItem("", "BTC")); } BTCTo.Items.AddRange(GenerateHTMLButtons.BTCToItems); if (BtcCryptocurrency.DepositEnabled) { BTCValueLabel.Text = ClassicBTCValueLabel.Text = string.Format("<p class='alert alert-info'>{0}: <b>{1}</b></p>", U5003.ESTIMATEDBTCVALUE, BtcCryptocurrency.GetValue().ToString()); BTCValueLabel.Visible = ClassicBTCValueLabel.Visible = AppSettings.Site.CurrencyCode != "BTC"; //We don't want to show 1B = 1B BTCPointsFrom.Items.AddRange(GenerateHTMLButtons.BTCFromItems); BTCPointsFrom.SelectedIndex = 0; if (BTCPointsFrom.SelectedValue == "Wallet") { btnDepositBTC.Visible = true; if (BtcCryptocurrency.DepositTarget == DepositTargetBalance.PurchaseBalance) { BTCTo.SelectedValue = "AdBalance"; } else if (BtcCryptocurrency.DepositTarget == DepositTargetBalance.CashBalance) { BTCTo.SelectedValue = "CashBalance"; } else if (BtcCryptocurrency.DepositTarget == DepositTargetBalance.Wallet) { BTCTo.SelectedValue = "BTCWallet"; } } BTCButtonPanel.Visible = CryptocurrencyApiFactory.GetDepositApi(BtcCryptocurrency).AllowToUsePaymentButtons(); ClassicBTCPanel.Visible = !CryptocurrencyApiFactory.GetDepositApi(BtcCryptocurrency).AllowToUsePaymentButtons(); } if (((AppSettings.Payments.CommissionToMainBalanceEnabled && !TitanFeatures.UserCommissionToMainBalanceEnabled) || (TitanFeatures.UserCommissionToMainBalanceEnabled && user.CommissionToMainBalanceEnabled) || TitanFeatures.IsRevolca) && user.CheckAccessCustomizeTradeOwnSystem) { RadioTo.Items.Add(new ListItem("", "Main balance")); } if (!AppSettings.Payments.CashBalanceEnabled) { ListItem cb = RadioTo.Items.FindByValue("Cash balance"); if (cb != null) { RadioTo.Items.Remove(cb); } } if (!AppSettings.Payments.MarketplaceBalanceEnabled) { ListItem cb = RadioTo.Items.FindByValue("Marketplace balance"); if (cb != null) { RadioTo.Items.Remove(cb); } } SetRadioToValues(); SetProcessorValues(); SetupSpecialTransfersProperties(); if (RadioFrom.Items.Count == 0 || RadioTo.Items.Count == 0) { //No transfers available transferInputRow.Visible = false; TransferSameCommissionToMainLiteral.Visible = true; TransferSameCommissionToMainLiteral.Text = U5006.NOTRANSFEROPTIONS; transfertable.Visible = false; } if (TitanFeatures.IsTradeOwnSystem) { //Checking condition to display appropriate message if (!user.CheckAccessCustomizeTradeOwnSystem && user.CommissionToMainBalanceRequiredViewsMessageInt > 0) { CommissionTransferInfoDiv.Visible = true; CommissionTransferInfo.Text = String.Format(U6010.COMMISSIONBALANCETRANSFERINFO, user.CommissionToMainBalanceRequiredViewsMessageInt, AppSettings.RevShare.AdPack.AdPackName); } else if (!user.CheckAccessCustomizeTradeOwnSystem && user.CommissionToMainBalanceRequiredViewsMessageInt == 0) { CommissionTransferInfoDiv.Visible = true; CommissionTransferInfo.Text = String.Format(U6010.COMMISSIONBALANCETRANSFERNOACTIVEADPACKINFO, AppSettings.RevShare.AdPack.AdPackName); } else { CommissionTransferInfoDiv.Visible = false; } } if (BtcCryptocurrency.DepositEnabled && BtcCryptocurrency.DepositMinimum > 0) { AdditionalInfoPlaceHolder.Visible = true; AdditionalInfoLiteral.Text = String.Format(U6012.WARNINGMINBTCDEPOSIT, CryptocurrencyMoney.Parse(BtcCryptocurrency.DepositMinimum.ToString(), CryptocurrencyType.BTC).ToString()); } } SetRadioItemsValues(RadioFrom); SetRadioItemsValues(RadioTo); SetRadioItemsValues(BTCTo); RemoveDuplicatesFromList(); foreach (ListItem item in BTCPointsFrom.Items) { item.Attributes.Add("data-content", "<img src='../Images/OneSite/TransferMoney/GoCoin.png' /> BTC"); } if (!TitanFeatures.IsRofriqueWorkMines) { LangAdder.Add(BalanceButton, U5009.BALANCE); } else { LangAdder.Add(BalanceButton, "Cash Deposits"); } LangAdder.Add(btnDepositBTC, U4200.DEPOSIT); LangAdder.Add(classicbtcDepositBTC, U4200.DEPOSIT); }
public static Dictionary <string, List <string> > GetAvailableOptions() { Dictionary <string, List <string> > AvailableTransfers = new Dictionary <string, List <string> >(); var TokenCryptocurrency = CryptocurrencyFactory.Get(CryptocurrencyType.ERC20Token); var BtcCryptocurrency = CryptocurrencyFactory.Get(CryptocurrencyType.BTC); if (AppSettings.Payments.TransferMainInAdBalanceEnabled) { TryAdd(AvailableTransfers, "Main balance", "Purchase balance"); } if (((AppSettings.Payments.CommissionToMainBalanceEnabled && !TitanFeatures.UserCommissionToMainBalanceEnabled) || (TitanFeatures.UserCommissionToMainBalanceEnabled && Member.Current.CommissionToMainBalanceEnabled)) && Member.CurrentInCache.CheckAccessCustomizeTradeOwnSystem) { TryAdd(AvailableTransfers, "Commission Balance", "Main balance"); } if (AppSettings.Payments.CommissionToAdBalanceEnabled) { TryAdd(AvailableTransfers, "Commission Balance", "Purchase balance"); } if (TitanFeatures.isAri) { TryAdd(AvailableTransfers, "Main balance", "Cash balance"); TryAdd(AvailableTransfers, "Commission Balance", "Cash balance"); } if (TitanFeatures.IsRevolca) { TryAdd(AvailableTransfers, "Purchase balance", "Main balance"); } foreach (var t in PaymentAccountDetails.PaymentAccountDetailsClasses) { var instance = Activator.CreateInstance(t); if (PaymentAccountDetails.RunStaticMethod(t, "GetFirstIncomeGateway") != null) { string pp = t.GetProperty("AccountType").GetValue(instance, null).ToString(); if (pp == "MPesa") //MPesa only to Cash Balance or Purchase Balance (if Cash Balance disabled) { if (AppSettings.Payments.CashBalanceEnabled) { TryAdd(AvailableTransfers, pp, "Cash balance"); } else { TryAdd(AvailableTransfers, pp, "Purchase balance"); } } else //All other payment processors = no restrictions { if (AppSettings.Payments.TransferFromPaymentProcessorsToAdBalanceEnabled) { TryAdd(AvailableTransfers, pp, "Purchase balance"); } if (AppSettings.TitanFeatures.AdvertTrafficExchangeEnabled) { TryAdd(AvailableTransfers, pp, "Traffic balance"); } if (AppSettings.Payments.CashBalanceEnabled) { TryAdd(AvailableTransfers, pp, "Cash balance"); } if (AppSettings.Payments.MarketplaceBalanceDepositEnabled) { TryAdd(AvailableTransfers, pp, "Marketplace balance"); } if (AppSettings.Points.PointsDepositEnable) { TryAdd(AvailableTransfers, pp, TransferOptionConst.PointsTransfer); } } } } if (AppSettings.TitanFeatures.AdvertTrafficExchangeEnabled) { TryAdd(AvailableTransfers, "Main balance", "Traffic balance"); } if (AppSettings.Payments.CashToAdBalanceEnabled) { TryAdd(AvailableTransfers, "Cash balance", "Purchase balance"); } if (AppSettings.Payments.MainToMarketplaceBalanceEnabled) { TryAdd(AvailableTransfers, "Main balance", "Marketplace balance"); } if (AppSettings.Payments.TransferFromBTCWalletToPurchaseBalanceEnabled) { TryAdd(AvailableTransfers, "BTC Wallet", "Purchase balance"); } if (AppSettings.Payments.TransferFromTokenWalletToPurchaseBalanceEnabled) { TryAdd(AvailableTransfers, TokenCryptocurrency.Code + " Wallet", "Purchase balance"); } if (AppSettings.Payments.TransferFromMainBalanceToTokenWalletEnabled) { TryAdd(AvailableTransfers, "Main balance", TokenCryptocurrency.Code + " Wallet"); } if (BtcCryptocurrency.DepositEnabled && CryptocurrencyApiFactory.Get(BtcCryptocurrency.DepositApiProcessor).AllowToUsePaymentButtons()) { string RadioToName = (BtcCryptocurrency.DepositTarget == DepositTargetBalance.Wallet) ? "BTC Wallet" : BtcCryptocurrency.DepositTarget.ToString(); TryAdd(AvailableTransfers, BtcCryptocurrency.DepositApiProcessor.ToString(), RadioToName); } return(AvailableTransfers); }
protected void Page_Load(object sender, EventArgs e) { AccessManager.RedirectIfDisabled(AppSettings.TitanFeatures.MoneyPayoutEnabled); User = Member.Current; if (CreditLineManager.UserHasUnpaidLoans(User.Id)) { CashoutButton.Enabled = CashoutButtonConfirm.Enabled = WithdrawCryptocurrencyButton.Enabled = WithdrawCryptocurrencyConfirmButton.Enabled = CommissionCashoutButton.Enabled = false; UnpaidCreditLineInfo.Visible = true; } if (!Page.IsPostBack) { AppSettings.Reload(); #region Langs & Texts WithdrawCryptocurrencyButton.Text = L1.CASHOUT; WithdrawCryptocurrencyConfirmButton.Text = L1.CONFIRM; CashoutButtonConfirm.Text = L1.CONFIRM; SendWithdrawViaRepresentativeButton.Text = U6010.SENDTRANSFERMESSAGE; ProportionsGridView.EmptyDataText = U5004.NOPAYOUTHISTORY; MainBalanceButton.Text = L1.MAINBALANCE; MaxWithdrawalsButton.Text = U5004.MAXIMUMWITHDRAWAL; CommissionButton.Text = U5004.COMMISSIONBALANCE; WithdrawHistoryButton.Text = L1.HISTORY; CashoutButton.Text = CommissionCashoutButton.Text = L1.CASHOUT; MainBalanceLiteral.Text = User.MainBalance.ToString(); CommissionBalanceLiteral.Text = User.CommissionBalance.ToString(); WithdrawHistoryGridView.EmptyDataText = L1.NODATA; LangAdder.Add(RegularExpressionValidator3, L1.ER_BADPIN, true); LangAdder.Add(RegularExpressionValidator1, L1.ER_BADPIN, true); LangAdder.Add(RegularExpressionValidator2, L1.ER_BADPIN, true); LangAdder.Add(WithdrawViaRepresentativeButton, U6010.WITHDRAWVIAREPRESENTATIVE); LangAdder.Add(RequiredFieldValidator2, L1.REG_REQ_PIN, true); LangAdder.Add(RequiredFieldValidator4, L1.REG_REQ_PIN, true); LangAdder.Add(RequiredFieldValidator6, L1.REG_REQ_PIN, true); LangAdder.Add(RequiredFieldValidator1, L1.REQ_PP, true); LangAdder.Add(RequiredFieldValidator3, L1.REQ_PP, true); LangAdder.Add(RequiredFieldValidator7, U2502.INVALIDMONEYFORMAT, true); LangAdder.Add(BtcCodeValidator, U6000.INVALIDSECURITYCODE, true); LangAdder.Add(FiatCodeValidator, U6000.INVALIDSECURITYCODE, true); LangAdder.Add(REValidator, U3500.ILLEGALCHARS); #endregion PINDiv1.Visible = PINDiv2.Visible = BtcPinDiv.Visible = AppSettings.Registration.IsPINEnabled; var BtcCryptocurrency = CryptocurrencyFactory.Get <BitcoinCryptocurrency>(); var XrpCryptocurrency = CryptocurrencyFactory.Get <RippleCryptocurrency>(); var TokenCryptocurrency = CryptocurrencyFactory.Get <ERC20TokenCryptocurrency>(); //Check if user has some manual payouts waiting var UnpaidRequests = User.GetUnpaidPayoutRequests(); WarningPanel.Visible = UnpaidRequests.exists; WarningLiteral.Text = UnpaidRequests.text; //Generate proper Cashout options RadioFrom.Items.AddRange(GenerateHTMLButtons.CashoutFromItems); if (TitanFeatures.IsRofriqueWorkMines && !CryptocurrencyApiFactory.GetDepositApi(BtcCryptocurrency).AllowToUsePaymentButtons()) { RadioFrom.Items.Add(new ListItem("", "BTC")); } CommissionRadioFrom.Items.AddRange(GenerateHTMLButtons.CashoutFromItems); if (RadioFrom.Items.Count < 1) { PayoutPlaceHolder.Visible = false; WarningPanel.Visible = true; WarningLiteral.Text = U5006.PAYOUTUNAVAILABLE; } if (CommissionRadioFrom.Items.Count < 1) { CommissionPayoutPlaceHolder.Visible = false; CommissionWarningPanel.Visible = true; CommissionWarningLiteral.Text = U5006.PAYOUTUNAVAILABLE; } CommissionButton.Visible = AppSettings.Payments.CommissionBalanceWithdrawalEnabled; WithdrawViaRepresentativeButton.Visible = AppSettings.Representatives.RepresentativesHelpWithdrawalEnabled; //Lang CashoutButton.Text = CommissionCashoutButton.Text = L1.CASHOUT; LangAdder.Add(RegularExpressionValidator3, L1.ER_BADPIN, true); LangAdder.Add(RegularExpressionValidator1, L1.ER_BADPIN, true); LangAdder.Add(RegularExpressionValidator2, L1.ER_BADPIN, true); LangAdder.Add(WithdrawViaRepresentativeButton, U6010.WITHDRAWVIAREPRESENTATIVE); LangAdder.Add(RequiredFieldValidator2, L1.REG_REQ_PIN, true); LangAdder.Add(RequiredFieldValidator4, L1.REG_REQ_PIN, true); LangAdder.Add(RequiredFieldValidator6, L1.REG_REQ_PIN, true); LangAdder.Add(RequiredFieldValidator1, L1.REQ_PP, true); LangAdder.Add(RequiredFieldValidator3, L1.REQ_PP, true); LangAdder.Add(RequiredFieldValidator7, U2502.INVALIDMONEYFORMAT, true); LangAdder.Add(BtcCodeValidator, U6000.INVALIDSECURITYCODE, true); LangAdder.Add(FiatCodeValidator, U6000.INVALIDSECURITYCODE, true); //Pre-selected tab if (Request.QueryString["b"] != null) { var button = (Button)MenuButtonPlaceHolder.FindControl(Request.QueryString["b"] + "Button"); MenuButton_Click(button, null); } bool PercentOfInvestmentWIthdrawalEnabled = User.Membership.MaxWithdrawalAllowedPerInvestmentPercent < 1000000000; MaxWithdrawalsButton.Visible = AppSettings.Payments.ProportionalPayoutLimitsEnabled || PercentOfInvestmentWIthdrawalEnabled; if (PercentOfInvestmentWIthdrawalEnabled) { MaxWithdrawalAllowedPerInvestmentPercentPlaceHolder.Visible = true; PaymentProportionsManager ppm = new PaymentProportionsManager(User); Money invested = ppm.TotalPaidIn; Money withdrawn = ppm.TotalPaidOut; Money canwithdraw = Money.MultiplyPercent(invested, User.Membership.MaxWithdrawalAllowedPerInvestmentPercent); TotalPaidInLiteral.Text = invested.ToString(); TotalCashoutLiteral.Text = withdrawn.ToString(); HowmuchMoreCanBeWithdrawnLiteral.Text = String.Format(U6005.YOUCANWITHDRAWOFINVESTED, NumberUtils.FormatPercents(User.Membership.MaxWithdrawalAllowedPerInvestmentPercent), canwithdraw.ToString(), "<b>" + (canwithdraw - withdrawn).ToString() + "</b>"); } //Pre-selected tab if (Request.QueryString["b"] != null) { var button = (Button)MenuButtonPlaceHolder.FindControl(Request.QueryString["b"] + "Button"); MenuButton_Click(button, null); } BTCWithdrawalButton.Visible = BtcCryptocurrency.WithdrawalEnabled; XRPWithdrawalButton.Visible = XrpCryptocurrency.WithdrawalEnabled; ERC20TokenButton.Visible = TokenCryptocurrency.WithdrawalEnabled; BTCWithdrawalButton.Text = "BTC"; ERC20TokenButton.Text = String.Format("{0} ({1})", TokenCryptocurrency.Name, TokenCryptocurrency.Code); XRPWithdrawalButton.Text = "XRP"; if (RadioFrom.Items.Count < 1)//No payment processors, let's move to BTC/XRP/ETH tab on start { MainBalanceButton.Visible = false; if (BtcCryptocurrency.WithdrawalEnabled) { MenuButton_Click(BTCWithdrawalButton, null); } else if (XrpCryptocurrency.WithdrawalEnabled) { MenuButton_Click(XRPWithdrawalButton, null); } else if (TokenCryptocurrency.WithdrawalEnabled) { MenuButton_Click(ERC20TokenButton, null); } else { MainBalanceButton.Visible = true; } if (TitanFeatures.IsClickmyad) { MenuButton_Click(XRPWithdrawalButton, null); } } RadioFrom.SelectedIndex = 0; SetProcessorValues(); } SetDropdownItemsValues(RadioFrom); if (TitanFeatures.IsClickmyad) { BTCWithdrawalButton.Visible = false; } if (TitanFeatures.IsTrafficThunder) { MainBalanceButton.Visible = false; MaxWithdrawalsButton.Visible = false; } }