コード例 #1
0
        // GET: Home
        public ActionResult Index()
        {
            HomeVM vm = new HomeVM();

            if (Session["acntno"] != null)
            {
                BankingServices bankService = new BankingServices(_dbcontext);

                int     acntno = Convert.ToInt32(Session["acntno"]);
                Account acnt   = bankService.GetLoggedInAccount(acntno);
                vm.currentUSer = acnt.AccountHolderName;
                return(View(vm));
            }
            return(View(vm));
        }
コード例 #2
0
        public ActionResult Index(TransactionVM vm)
        {
            vm.LoggedInAccountNo = Convert.ToInt32(Session["acntno"]);
            BankingServices    bankService     = new BankingServices(_dbContext);
            AccountTransaction acntTransaction = new AccountTransaction {
                TransactionType = vm.SeletedTransactionType, TransactionAmount = vm.TransactionAmount, TransactionDate = DateTime.Now, acnt = bankService.GetLoggedInAccount(vm.LoggedInAccountNo)
            };

            bankService.DoTransaction(acntTransaction, vm.LoggedInAccountNo);

            return(View(vm));
        }