コード例 #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();
            }
        }
コード例 #2
0
ファイル: UserRepo.cs プロジェクト: dhruv-99/SwabhavRef
        public BankLib.Model.BankMaster GetUserDetails(string name)
        {
            string        query       = "select * from bank_master where name = '" + name + "';";
            DBTransaction transaction = new DBTransaction();

            tMaster = transaction.GetDetails(query);
            return(tMaster);
        }