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)); }
public ActionResult New() { var glAccounts = _glAccountContext.GetAll(); var viewModel = new GlPostViewModel { GlAccounts = glAccounts }; return(View("GlPostForm", viewModel)); }