Exemple #1
0
        public async Task <DataTransaction> GetDataTransactiontTrans()
        {
            DataTransactiontTrans = new DataTransaction();
            DataTransactiontTrans = await ViewTransaction.GetTransactionData();

            return(DataTransactiontTrans);
        }
Exemple #2
0
        /// <summary>
        /// Method for get List all transaction max. 50 records
        /// </summary>
        /// <returns>Result is list transaction</returns>
        private async Task <List <TransRow> > GetListTranstion()
        {
            DataTransaction dataTransaction = new DataTransaction();
            List <TransRow> listTrans       = new List <TransRow>();

            dataTransaction = await ViewTransaction.GetTransactionData(); //update data

            if (dataTransaction.ListTransactions.Count > 0)               // test for count
            {
                BalanceHelper.DataTransactiontTrans = dataTransaction;
            }
            else // from chace data
            {
                if (BalanceHelper.DataTransactiontTrans.ListTransactions.Count > 0)
                {
                    dataTransaction = BalanceHelper.DataTransactiontTrans;
                }
            }

            if (dataTransaction.ListTransactions.Count > 0) // test for count
            {
                foreach (var transaction in dataTransaction.ListTransactions)
                {
                    TransRow item;

                    if (string.Compare(transaction.ListInputs[0].PrevOut.Address,
                                       transaction.TupleOuts.Item2.Address) == 0) // is True = Send Transaction
                    {
                        item = new TransRow
                        {
                            BitcoinAddress = transaction.TupleOuts.Item1.Address, // where send is here
                            Type           = TypeTrans.Send,                      // or TypeTrans.Send
                            Value          = transaction.TupleOuts.Item1.Value,
                            Date           = transaction.Time
                        };
                    }
                    else // is False = Recieve Transaction
                    {
                        item = new TransRow
                        {
                            BitcoinAddress = transaction.TupleOuts.Item1.Address, // where recieve is here
                            Type           = TypeTrans.Recieve,                   // or TypeTrans.Send
                            Value          = transaction.TupleOuts.Item1.Value,
                            Date           = transaction.Time
                        };
                    }

                    //Debug.WriteLine($"zapis hodnoty: {item.Value}");
                    listTrans.Add(item);
                }
            }

            return(listTrans);
        }
Exemple #3
0
        /// <summary>
        /// Method for get List all transaction max. 50 records
        /// </summary>
        /// <returns>Result is list transaction</returns>
        private async void GetListTranstion()
        {
            DataTransactiontTrans = new DataTransaction();
            DataTransactiontTrans = await ViewTransaction.GetTransactionData();

            if (DataTransactiontTrans.ListTransactions.Count > 0) // test for count
            {
                foreach (var transaction in DataTransactiontTrans.ListTransactions)
                {
                    TransRow item;

                    if (string.Compare(transaction.ListInputs[0].PrevOut.Address,
                                       transaction.TupleOuts.Item2.Address) == 0) // is True = Send Transaction
                    {
                        item = new TransRow
                        {
                            BitcoinAddress = transaction.TupleOuts.Item1.Address, // where send is here
                            Type           = TypeTrans.Send,                      // or TypeTrans.Send
                            Value          = transaction.TupleOuts.Item1.Value,
                            Date           = transaction.Time
                        };
                    }
                    else // is False = Recieve Transaction
                    {
                        item = new TransRow
                        {
                            BitcoinAddress = transaction.TupleOuts.Item1.Address, // where recieve is here
                            Type           = TypeTrans.Recieve,                   // or TypeTrans.Send
                            Value          = transaction.TupleOuts.Item1.Value,
                            Date           = transaction.Time
                        };
                    }

                    //Debug.WriteLine($"zapis hodnoty: {item.Value}");
                    ListTrans.Add(item);
                }
            }
        }