Ejemplo n.º 1
0
        private void ReturnButton_Click(object sender, RoutedEventArgs e)
        {
            MainWindow dashboard = new MainWindow();

            dashboard.Show();
            user.Update_Database();
            this.Close();
        }
Ejemplo n.º 2
0
        public void Update_DatabaseTest()
        {
            User test = new MoneyTransfer657.User("Erik Lomas");

            test.Update_Database();
            Assert.IsNotNull(test);
        }
Ejemplo n.º 3
0
        private void TransfertoAppButton_Click(object sender, RoutedEventArgs e)
        {
            decimal transfer_amount;
            bool    isNumeric = decimal.TryParse(transferamount.Text, out transfer_amount);

            if (isNumeric == false)
            {
                MessageBox.Show("Only enter numbers for amount to transfer");
                return;
            }
            Thread transfer = new Thread(() =>
            {
                user.Usd = user.Usd + transfer_amount;
                user.Update_Database();
            });

            transfer.Start();
            transfer.Join();
            UpdateBankingAccounts();
        }
Ejemplo n.º 4
0
        private void SendButton_Click(object sender, RoutedEventArgs e)
        {
            decimal amount_to_send;
            bool    isNumeric = decimal.TryParse(AmountBox.Text, out amount_to_send);

            if (isNumeric == false)
            {
                MessageBox.Show("Only enter numbers for amount of currency to send");
                return;
            }
            if (CoinBox.SelectedIndex == 0)
            {
                user.Usd = user.Usd - amount_to_send;
                user.Add_Transaction(user.Username, RecipientText.Text, "USD", amount_to_send.ToString(), descrip_box.Text);
            }
            else if (CoinBox.SelectedIndex == 1)
            {
                user.Btc = user.Btc - amount_to_send;
                user.Add_Transaction(user.Username, RecipientText.Text, "BTC", amount_to_send.ToString(), descrip_box.Text);
            }
            else if (CoinBox.SelectedIndex == 2)
            {
                user.Eth = user.Eth - amount_to_send;
                user.Add_Transaction(user.Username, RecipientText.Text, "ETH", amount_to_send.ToString(), descrip_box.Text);
            }
            else if (CoinBox.SelectedIndex == 3)
            {
                user.Xrp = user.Xrp - amount_to_send;
                user.Add_Transaction(user.Username, RecipientText.Text, "XRP", amount_to_send.ToString(), descrip_box.Text);
            }
            else
            {
                MessageBox.Show("Please select a currency before sending.");
                return;
            }
            UpdatePage();
            user.Update_Database();
        }