Пример #1
0
 /// <summary>
 /// Deposit
 /// </summary>
 private void depositBtn_Click(object sender, EventArgs e)
 {
     try
     {
         var account = Datalog.loggedAcct[0];
         var deposit = Decimal.Parse(depositAmount.Text);
         var m       = _accountRepository.Deposit(account, deposit);
         MessageBox.Show(m);
         DashBoard s = new DashBoard(_authRepository, _userRepository, _accountRepository, _context);
         s.accountBalance.Text = "N" + _accountRepository.GetBalance(account).ToString();
         depositAmount.Text    = "";
     }
     catch (Exception er)
     {
         MessageBox.Show(er.Message);
     }
 }
Пример #2
0
 /// <summary>
 /// Logs In newly created account
 /// </summary>
 private void registerBtn_Click(object sender, EventArgs e)
 {
     try
     {
         Datalog.loggedAcct.Clear();
         Datalog.loggedUser.Clear();
         var details  = Registration();
         var customer = _userRepository.GetCustomerById(details[0]);
         var account  = _accountRepository.GetAccountById(details[1]);
         Datalog.loggedUser.Add(customer);
         Datalog.loggedAcct.Add(account);
         this.Hide();
         DashBoard lg = new DashBoard(_authRepository, _userRepository, _accountRepository, _context);
         lg.Show();
     }
     catch (Exception er)
     {
         MessageBox.Show(er.Message);
     }
 }