Example #1
0
    private void showStoredData(Data_AppUserWallet wal)
    {
        PriceAndText price = wal.CalucateCost();

        TitleId.Text  = wal.Title;
        userName.Text = sd.LoggedOnUserName;
        InfoText.Text = wal.DisplayLinesAsHTML();
        CalcInfo.Text = price.Explained;

        commitTextDiv.Visible = true;
        CalcInfoDiv.Visible   = true;

        alterStep1DivVisibility(false, null, 0, 0, 0, 0);
        CalcInfoDiv.Visible        = true;
        CommitDiv.Visible          = false;
        PaymentInstruction.Visible = true;
        paypalAmount.Text          = String.Format("{0:0.00} USD", price.FinalPrice);
        paypalLink.HRef            = String.Format("https://PayPal.me/NiceAPI/{0:0.00}usd", price.FinalPrice);

        try
        {
            BitcoinPrice.BitcoinPriceInfos currentPrice = BitcoinPrice.PriceFromGecko();
            btcAmount.Text = String.Format("{0:0.00000} BTC", price.FinalPrice / currentPrice.btc.PriceInUSD);
            bchAmount.Text = String.Format("{0:0.00000} BCH", price.FinalPrice / currentPrice.bch.PriceInUSD);
        }
        catch
        { }
    }
Example #2
0
        public static string GetEmailBody(this Data_AppUserWallet appUserWallet, string userName, string userEmail)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("<p>Hi {0}</p>\n", userName);
            sb.AppendLine("You have committed yourself to the following account upgrade:<br>");
            sb.AppendFormat("Please visit <a href=\"{0}\">{0}</a> for payment instructions.<br>\n", "https://niceapi.net/Upgrade");
            sb.AppendFormat("Your email is {0}\n", userEmail);
            sb.AppendLine("<br>");
            sb.AppendLine(new UpgradeTextList(appUserWallet.DisplayLines).GetAsEmialText);
            sb.AppendLine("<br>\n");
            sb.AppendLine("<pre>" + appUserWallet.CalucateCost().Explained + "</pre>");
            sb.AppendLine("<br>\n");
            sb.AppendLine("<p>Your NiceApi.net team.</p>");
            return(sb.ToString());
        }
Example #3
0
    protected void Calculate_Click(object sender, EventArgs e)
    {
        IMyLog logUpgrade = MyLog.GetLogger("Upgrade");

        try
        {
            UpdateInfo priceInfo = getHardcodedPriceInfoOrGoBackToPricePage();

            int howManyNumbers = 0;
            int.TryParse(HowManyNumbers.SelectedItem.Value, out howManyNumbers);

            int howManyMessages = 0;
            int.TryParse(HowManyMessages.SelectedItem.Value, out howManyMessages);

            int howManyTopups = 0;
            int.TryParse(HowManyTopups.SelectedItem.Value, out howManyTopups);

            int fullpayment = 0;
            int.TryParse(FullPayment.SelectedItem.Value, out fullpayment);

            Data_AppUserWallet wal = new Data_AppUserWallet(
                priceInfo.Type,
                new AmountAndPrice(howManyNumbers, GetPrice(priceInfo.Number)),
                new AmountAndPrice(howManyMessages, GetPrice(priceInfo.Message)),
                new AmountAndPrice(howManyTopups, GetPrice(priceInfo.Month)),
                new AmountAndPrice(1, GetPrice(priceInfo.OneTimeSetup)),
                new AmountAndPrice(fullpayment, GetPrice(priceInfo.FullPayment)));
            CalcInfo.Text = wal.CalucateCost().Explained;
            alterStep1DivVisibility(false, priceInfo,
                                    HowManyNumbers.SelectedIndex,
                                    HowManyMessages.SelectedIndex,
                                    HowManyTopups.SelectedIndex,
                                    FullPayment.SelectedIndex
                                    );
            CalcInfoDiv.Visible = true;
            CommitDiv.Visible   = true;
            CommitButton.Focus();
        }
        catch (Exception Ex)
        {
            logUpgrade.Debug(Ex.Message);
        }
    }