Example #1
0
        public ActionResult Index(PassbookVM vm)
        {
            BankingServices bankService = new BankingServices(_dbContext);

            vm.AccountNo = Convert.ToInt32(Session["acntno"]);
            vm.accountTransactionsList = bankService.GetSingleAccountTransaction(vm.AccountNo);
            bankService.DownloadeStatement(vm.accountTransactionsList);
            return(View(vm));
        }
        public ActionResult Index(TransactionVM vm)
        {
            vm.AccountHolderId = Convert.ToInt32(Session["account"]);
            BankingServices    bankingService = new BankingServices(_dbContext);
            AccountTransaction transaction    = new AccountTransaction {
                TransactionType = vm.SelectedType, TransactionAmount = vm.Amount, TransactionDate = DateTime.Now
            };

            bankingService.DoTransaction(transaction, vm.AccountHolderId);
            return(View(vm));
        }
        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));
        }
Example #4
0
 public ActionResult Index(RegistrationVM vm)
 {
     if (ModelState.IsValid)
     {
         BankingServices bankingService = new BankingServices(_dbContext);
         bankingService.RegisterAccount(new Account {
             AccountHolderName = vm.AccountHolderName, AccountNo = vm.AccountNo, AccountBalance = vm.AccountBalance, AccountPassword = vm.AccountPassword, AccountCreatedDate = DateTime.Now
         });
         return(RedirectToAction("Index", "Login"));
     }
     return(View(vm));
 }
Example #5
0
        // GET: Passbook
        public ActionResult Index()
        {
            BankingServices bankServices = new BankingServices(_bankDBContext);
            PassbookVM      passbookVM   = new PassbookVM();

            if (!CheckSession())
            {
                return(RedirectToAction("Index", "Login"));
            }
            passbookVM.AccountNo           = Convert.ToInt32(Session["account"]);
            TempData["transactions"]       = bankServices.GetSingleAccountTransaction(passbookVM.AccountNo);
            passbookVM.accountTransactions = TempData["transactions"] as List <AccountTransaction>;
            return(View(passbookVM));
        }
Example #6
0
        // GET: Passbook
        public ActionResult Index()
        {
            if (Session["acntno"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            PassbookVM      vm          = new PassbookVM();
            BankingServices bankService = new BankingServices(_dbContext);

            vm.AccountNo = Convert.ToInt32(Session["acntno"]);
            vm.accountTransactionsList = bankService.GetSingleAccountTransaction(vm.AccountNo);
            return(View(vm));
        }
Example #7
0
 public ActionResult Index(LoginVM vm)
 {
     if (ModelState.IsValid)
     {
         BankingServices bankingService = new BankingServices(_dbContext);
         if (bankingService.AuthenticateUser(vm.AcntNo, vm.AccountPassword))
         {
             Session["account"] = bankingService._currentAcntHolder.AccountNo;
             Session.Timeout    = 1;
             return(RedirectToAction("Index", "Home"));
         }
         return(View(vm));
     }
     return(View(vm));
 }
        // 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));
        }
Example #9
0
 public TransactionsController(BankingServices banking, ApplicationDbContext db, UserManager <IdentityUser> users)
 {
     this.banking = banking;
     this.db      = db;
     this.users   = users;
 }
	//instead, consider a public setter or parameterize constructor
    public void setBankStatements(BankingServices services,
    				int id,Money startBalance, Money endBalance) {