Ejemplo n.º 1
0
 private void DepositBtn_Click(object sender, EventArgs e)
 {
     try
     {
         //if (AccountComBo.SelectedValue.ToString() == "Select Account")
         //throw new Exception("You have not Selected an Account");
         Validation.ValueNotEmpty(AmountBox.Text);
         Validation.ValueNotEmpty(AccountComBo.SelectedItem.ToString());
         Validation.ValueNotEmpty(NoteBox.Text);
         var amount  = decimal.Parse(AmountBox.Text);
         var note    = NoteBox.Text;
         var account = AccountComBo.SelectedItem.ToString();
         var arrStr  = Seperators.TwoStringByDash(account);
         _acct.Deposit(arrStr[1], amount);
         List <string> details = new List <string>()
         {
             arrStr[1], amount.ToString(), note, "deposit"
         };
         _transact.AddTranHistory(details);
         MessageBox.Show("Deposit Transaction Succcessful", "Success Message");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Input Error");
     }
 }
Ejemplo n.º 2
0
        private void ViewStsBtn_Click(object sender, EventArgs e)
        {
            Validation.ValueNotEmpty(AccountComBo.SelectedItem.ToString());
            var account  = AccountComBo.SelectedItem.ToString();
            var arrStr   = Seperators.TwoStringByDash(account);
            var transact = _transact.GetTranHistory(arrStr[1]);
            var list     = new List <string[]>();

            foreach (var item in transact)
            {
                list.Add(new string[] { item.TransactDate.ToString(), item.TransactionType, item.Amount.ToString(), item.Note });
            }
            foreach (var item in list)
            {
                var acct = new ListViewItem(item);
                StatementListView.Items.Add(acct);
            }
        }
Ejemplo n.º 3
0
        private void TransferBtn_Click(object sender, EventArgs e)
        {
            try
            {
                //if (AccountComBo.SelectedValue.ToString() == "Select Account")
                //throw new Exception("You have not Selected an Account");
                Validation.ValueNotEmpty(AmountBox.Text);
                Validation.ValueNotEmpty(BenAcctBox.Text);
                Validation.ValueNotEmpty(AccountComBo.SelectedItem.ToString());
                Validation.ValueNotEmpty(NoteBox.Text);
                var amount   = decimal.Parse(AmountBox.Text);
                var note     = NoteBox.Text;
                var account  = AccountComBo.SelectedItem.ToString();
                var benAacct = BenAcctBox.Text;
                var arrStr   = Seperators.TwoStringByDash(account);
                if (arrStr[0] == "Savings")
                {
                    _savings.Transfer(arrStr[1], benAacct, amount);
                }
                else
                {
                    _current.Transfer(arrStr[1], benAacct, amount);
                }

                List <string> details = new List <string>()
                {
                    arrStr[1], amount.ToString(), note, "transfer"
                };
                _transact.AddTranHistory(details);
                MessageBox.Show("Transfer Transaction Succcessful", "Success Message");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Input Error");
            }
        }