// GET: Dashboard/Debts
        public ActionResult Index(string searchTerm, int?kindsOfDebtsID, int?page)
        {
            int recordSize = 5;

            page = page ?? 1;

            DebtsListingModel model = new DebtsListingModel();

            model.SearchTerm    = searchTerm;
            model.KindOfDebtsID = kindsOfDebtsID;

            model.KindOfDebts = kindsOfDebtsServices.GetAllKindsOfDebts();

            model.Debts = debtsServices.SearchDebts(searchTerm, kindsOfDebtsID, page.Value, recordSize);
            var totalRecords = debtsServices.SearchDebtsCount(searchTerm, kindsOfDebtsID);

            model.Pager = new Pager(totalRecords, page, recordSize);

            return(View(model));
        }
        // GET: Dashboard/Dashboard
        public ActionResult Index(string searchTerm, int?kindsOfDebtsID, int?page)
        {
            ScheduledTransactionsListingModel model = new ScheduledTransactionsListingModel();

            model.SearchTerm            = "";
            model.ScheduledTransactions = scheduledTransactionsServices.SearchScheduledTransactions("");

            int recordSize = 5;

            page = page ?? 1;

            DebtsListingModel modelDebts = new DebtsListingModel();

            modelDebts.SearchTerm    = searchTerm;
            modelDebts.KindOfDebtsID = kindsOfDebtsID;

            modelDebts.KindOfDebts = kindsOfDebtsServices.GetAllKindsOfDebts();

            modelDebts.Debts = debtsServices.SearchDebts(searchTerm, kindsOfDebtsID, page.Value, recordSize);
            var totalRecords = debtsServices.SearchDebtsCount(searchTerm, kindsOfDebtsID);

            modelDebts.Pager = new Pager(totalRecords, page, recordSize);

            SavingsListingModel savingModel = new SavingsListingModel();

            savingModel.SearchTerm = "";
            savingModel.Savings    = savingsServices.SearchSavings("", page.Value, recordSize);
            savingModel.AllSavings = savingsController.GetAllOfSavingsMoney();

            IndexViewModel indexViewModel = new IndexViewModel();

            indexViewModel.DebtsListingModel = modelDebts;
            indexViewModel.ScheduledTransactionsListingModel = model;
            indexViewModel.SavingsListingModel = savingModel;
            indexViewModel.BalanceListingModel = balanceServices.GetBalances();
            return(View(indexViewModel));
        }