protected void CurrentUserTransactionsGridView_RowCommand(object sender, GridViewCommandEventArgs e) { var commands = new[] { "Confirm", "ConfirmReceived" }; if (commands.Contains(e.CommandName)) { var index = e.GetSelectedRowIndex() % CurrentUserTransactionsGridView.PageSize; var row = CurrentUserTransactionsGridView.Rows[index]; var TransactionId = (row.Cells[0].Text.Trim()); var Transaction = new CryptocurrencyTradeTransaction(Convert.ToInt32(TransactionId)); switch (e.CommandName) { case "Confirm": Transaction.PaymentStatus = CryptocurrencyTransactionStatus.AwaitingPaymentConfirmation; Transaction.Save(); break; case "ConfirmReceived": break; } CurrentUserTransactionsGridView.DataBind(); } }
private void ManageTabDataBind() { CurrentUserTransactionsGridView.DataBind(); if (CurrentUserTransactionsGridView.Rows.Count != 0) { CurrentUserTransactionsPlaceHolder.Visible = true; } CurrentUserBuyOfferGridView.DataBind(); }
protected void OfferHistoryGridView_RowCommand(object sender, GridViewCommandEventArgs e) { var commands = new[] { "AddComment" }; if (commands.Contains(e.CommandName)) { var index = e.GetSelectedRowIndex() % CurrentUserTransactionsGridView.PageSize; var row = OfferHistoryGridView.Rows[index]; var FinishedTransactionId = (row.Cells[0].Text.Trim()); switch (e.CommandName) { case "AddComment": HttpContext.Current.Response.Redirect("~/user/cctrading/buy.aspx?foid=" + FinishedTransactionId); break; } CurrentUserTransactionsGridView.DataBind(); } }
protected void CurrentUserTransactionsGridView_RowCommand(object sender, GridViewCommandEventArgs e) { var commands = new[] { "ConfirmReceived" }; if (commands.Contains(e.CommandName)) { var index = e.GetSelectedRowIndex() % CurrentUserTransactionsGridView.PageSize; var row = CurrentUserTransactionsGridView.Rows[index]; var TransactionId = (row.Cells[0].Text.Trim()); var Transaction = new CryptocurrencyTradeTransaction(Convert.ToInt32(TransactionId)); var CurrentTradeOffer = new CryptocurrencyTradeOffer(Transaction.OfferId); switch (e.CommandName) { case "ConfirmReceived": int ClientWithCash = -1; if (Transaction.ClientId != Member.CurrentId) { ClientWithCash = Transaction.ClientId; } else { ClientWithCash = CurrentTradeOffer.CreatorId; } var BuyerWithCash = new Member(ClientWithCash); BuyerWithCash.AddToCryptocurrencyBalance(CryptocurrencyType.BTC, Transaction.CCAmount.ToDecimal(), "Cryptocurrency trade", BalanceLogType.CryptocurrencyTrade); Transaction.PaymentStatus = CryptocurrencyTransactionStatus.Finished; Transaction.Save(); CryptocurrencyFinishedTradeOffer.CreateNewTemplate(Transaction.OfferId, ClientWithCash, Member.CurrentId, Transaction.CCAmount); break; } CurrentUserTransactionsGridView.DataBind(); } }