Exemple #1
0
        public ActionResult AdminDashboard()
        {
            var     numberOfCustomerAccounts = 0;
            var     numberOfGlAccounts       = 0;
            var     numberOfLoans            = 0;
            decimal profit = 0;

            if (_customerAccContext.GetAllCustomersAccounts() != null)
            {
                numberOfCustomerAccounts = _customerAccContext.GetAllCustomersAccounts().Count();
            }

            if (_glAccountContext.GetAll() != null)
            {
                numberOfGlAccounts = _glAccountContext.GetAll().Count();
            }
            if (_loanContext.GetAllLoans() != null)
            {
                numberOfLoans = _loanContext.GetAllLoans().Count();
            }

            if (_transactionReportContext.GetProfitOrLoss() != 0)
            {
                profit = _transactionReportContext.GetProfitOrLoss();
            }
            var viewModel = new AdminDashboardViewModel
            {
                NumberOfCustomerAccounts = numberOfCustomerAccounts,
                Profit             = profit,
                NumberOfGlAccounts = numberOfGlAccounts,
                NumberOfLoans      = numberOfLoans,
            };

            return(View("AdminDashboard", viewModel));
        }
Exemple #2
0
        public ActionResult New()
        {
            var glAccounts = _glAccountContext.GetAll();
            var viewModel  = new GlPostViewModel
            {
                GlAccounts = glAccounts
            };

            return(View("GlPostForm", viewModel));
        }