コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string name   = this.displayNameLable.Text;
            string amount = this.transactionAmountTextBox.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(LoginForm.loggedUser);
                MessageBox.Show("Transaction successfull");
                UserForm userForm = new UserForm();
                userForm.currentBalanceLabel.Text = Convert.ToString(tMaster.Balance);
                this.Region = userForm.Region;
                this.Hide();
                userForm.Show();
            }
        }
コード例 #2
0
        public UserForm()
        {
            BankLib.Model.BankMaster bankMaster;
            InitializeComponent();
            BankLib.Repository.UserRepo userRepo = new BankLib.Repository.UserRepo();
            bankMaster = userRepo.GetUserDetails(BankApp.loggedUser);

            usernammeLabel.Text      = bankMaster.Name;
            usernameLabel2.Text      = bankMaster.Name;
            currentBalanceLabel.Text = Convert.ToString(bankMaster.Balance);
        }