Пример #1
0
        private void btnDeposit_Click(object sender, EventArgs e)
        {
            decimal debit          = decimal.Parse(txtDebAmount.Text);
            decimal principal      = decimal.Parse(txtBal.Text);
            decimal updatedBalance = debit + principal;

            txtBal.Text = updatedBalance.ToString();

            //record transaction
            AddData ad = new AddData();//to make transaction

            //gather deposit variables
            string   type    = "Deposit";
            decimal  amount  = decimal.Parse(txtDebAmount.Text);
            int      accNum  = int.Parse(txtAccountNumber.Text);
            decimal  balance = decimal.Parse(txtBal.Text);
            DateTime date    = DateTime.Now;

            ad.AddDepTransaction(type, amount, accNum, balance, date);
            MessageBox.Show("Success, Make Another Deposit or Update Database");
        }