Bitcoin_QR_Popup.Form1.display_history C# (CSharp) Method

display_history() private method

private display_history ( ) : void
return void
        private void display_history()
        {
            JArray transactions = bc.ListTransactions(bitcoin_account, 5);
            string message = "";
            if (transactions.Count > 0)
            {
                foreach (JObject t in transactions)
                {
                    double btc_amount = Convert.ToDouble(t["amount"].ToString());
                    double exchange_rate = calculate_exchange_rate("BTC", label_currency.Text).rate;
                    double local_value = btc_amount * exchange_rate;
                    DateTime transaction_time = new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(Convert.ToDouble(t["time"].ToString())).ToLocalTime();
                    DateTime now = DateTime.Now;
                    bool is_from_today = now.Date == transaction_time.Date;
                    if (is_from_today)
                    {
                        string transaction = transaction_time.ToString("HH:mm:ss") + " - " + btc_amount.ToString("0.00") + " BTC / " + local_value.ToString("0.00") + " " + label_currency.Text + "\n";
                        message = transaction + message;
                    }
                }
                if (message.Length == 0)
                {
                    message = "No transactions to show\n"; //TODO translate
                }

            }
            else
            {
                 message = "No transactions to show\n"; //TODO translate
            }
            message = message + "\n" + "Time now: " + DateTime.Now.ToString("HH:mm:ss");
            TopMostMessageBox.Show(message, "Transaction History"); //TODO translate
        }