public void InitControls()
    {
        currentStage = ICOStage.GetCurrentStage();
        var TokenCryptocurrency = CryptocurrencyFactory.Get(CryptocurrencyType.ERC20Token);

        if (currentStage == null)
        {
            StagePlaceHolder.Visible = false;
            NoStageLiteral.Text      = U6012.NOSTAGEINFO;

            var nextStage = ICOStage.GetNextStage();

            if (nextStage == null)
            {
                NextStageLiteral.Visible = false;
            }
            else
            {
                NextStageLiteral.Text = string.Format(U6012.NEXTSTAGEINFO, "<b>" + nextStage.StartDate + "</b>");
            }
        }
        else
        {
            decimal ProgressBarValue = ((decimal)currentStage.GetAvailableTokens() / (decimal)currentStage.TotalAvailableTokens) * 100;
            int     availableTokens  = currentStage.GetAvailableTokens();

            NoStagePlaceHolder.Visible = false;
            ProgressBarLiteral.Text    = string.Format("<div class='progress-bar' style='width: {0}%'>{1}: <b>{2}</b> {3} ({0}%)</div>", ProgressBarValue.ToString("#.#"),
                                                       U6012.TOKENSLEFT, availableTokens, TokenCryptocurrency.Code);
            NameTextBox.Text = string.Format(U6012.ISLIVE, currentStage.Name);
        }
    }
Esempio n. 2
0
    public void InitControls()
    {
        currentStage = new ICOStage(ObjectID);

        int     TotalPurchasedTokens = currentStage.GetAvailableTokens();
        int     AvailableTokens      = currentStage.TotalAvailableTokens - TotalPurchasedTokens;
        Decimal PercentOfTokens      = ((Decimal)TotalPurchasedTokens / (Decimal)currentStage.TotalAvailableTokens) * 100;

        ICOStageName.Text         = currentStage.Name;
        ICOStagePriceLiteral.Text = currentStage.TokenPrice.ToString();
        ICOStageAvailableTokensPercentLiteral.Text = string.Format("<input type='text' class='knob' value='{0}' data-width='125' data-height='125' data-thickness='0.25' data-fgColor='#65a858'>", Math.Round(PercentOfTokens, 0).ToString());
        ICOStageAvailableTokensLiteral.Text        = (currentStage.TotalAvailableTokens - AvailableTokens).ToString();

        TokenImage.ImageUrl = AppSettings.Ethereum.ERC20TokenImageUrl;

        StageStart = currentStage.StartDate;
        StageEnd   = currentStage.EndDate;

        if (StageEnd < AppSettings.ServerTime)
        {
            ICOStageEventLiteral.Text = L1.FINISHED;
            ICOStageItem.Attributes.Add("class", "ICOStage finished");
        }
        else if (StageStart > AppSettings.ServerTime)
        {
            ICOStageTimestamp.Attributes.Add("data-timestamp", StageStart.ToString());
            ICOStageEventLiteral.Text = String.Format("{0} <span class='countdown-placeholder'></span>", U6012.STARTSIN);
            ICOStageItem.Attributes.Add("class", "ICOStage finished ICOtimer");
        }
        else
        {
            ICOStageTimestamp.Attributes.Add("data-timestamp", StageEnd.ToString());
            ICOStageEventLiteral.Text = String.Format("{0} <span class='countdown-placeholder'></span>", U6012.ENDSIN);
            ICOStageItem.Attributes.Add("class", "ICOStage ICOtimer");
        }
    }