예제 #1
0
    protected void CurrentUserSellOfferGridView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        var commands = new[] { "start", "stop", "remove" };

        if (commands.Contains(e.CommandName))
        {
            var index   = e.GetSelectedRowIndex() % CurrentUserSellOfferGridView.PageSize;
            var row     = CurrentUserSellOfferGridView.Rows[index];
            var OfferId = (row.Cells[0].Text.Trim());
            var Offer   = new CryptocurrencyTradeOffer(Convert.ToInt32(OfferId));

            switch (e.CommandName)
            {
            case "start":
                if (Offer.Status == CryptocurrencyOfferStatus.Paused)
                {
                    Offer.Activate();
                }
                break;

            case "stop":
                if (Offer.Status == CryptocurrencyOfferStatus.Active)
                {
                    Offer.Pause();
                }
                break;

            case "remove":
                Offer.Delete();
                break;
            }

            CurrentUserSellOfferGridView.DataBind();
        }
    }
예제 #2
0
    private void ManageTabDataBind()
    {
        CurrentUserTransactionsGridView.DataBind();

        if (CurrentUserTransactionsGridView.Rows.Count != 0)
        {
            CurrentUserTransactionsPlaceHolder.Visible = true;
        }

        CurrentUserSellOfferGridView.DataBind();
    }