Beispiel #1
0
        private void commitButton_Click(object sender, EventArgs e)
        {
            string name   = this.displayUsernameLabel.Text;
            double amount = Convert.ToDouble(this.amountTextBox.Text);
            string type   = null;

            if (this.depositRadioButton.Checked == true)
            {
                type = this.depositRadioButton.Text;
            }
            if (this.withdrawRadioButton.Checked == true)
            {
                type = this.withdrawRadioButton.Text;
            }
            PerformTransactionRepo transactionRepo = new PerformTransactionRepo();

            if (transactionRepo.DoTransaction(name, amount, type) == true)
            {
                BankLib.Repository.UserRepo userRepo = new BankLib.Repository.UserRepo();
                BankLib.Model.BankMaster    tMaster  = userRepo.GetUserDetails(BankApp.loggedUser);
                MessageBox.Show("Transaction successfull");
                UserForm userForm = new UserForm();
                userForm.currentBalanceLabel.Text = Convert.ToString(tMaster.Balance);
                this.Region = userForm.Region;
                this.Hide();
                userForm.Show();
            }
        }
Beispiel #2
0
        private static void CaseStudy1()
        {
            //RegistrationRepo register = new RegistrationRepo();
            //register.RegisterUser("James", "james123", 5000f);
            //   LoginRepo loginRepo = new LoginRepo();
            // BankLib.Model.BankMaster bankMaster =  loginRepo.LoginUser("James", "james123");
            // Console.WriteLine(bankMaster.Name);

            PerformTransactionRepo transaction = new PerformTransactionRepo();
            //      if (transaction.DoTransaction("James", 500, "Withdraw") == true)
            //    {
            //       Console.WriteLine("Transaction successfull");
            //   }
            //PassbookRepo book = new PassbookRepo();
            //book.DownloadPassbook("akash");
        }