public ActionResult Index(IndexViewModel indexViewModel)
        {
            var pageIndex = indexViewModel.Page.HasValue ? (int)indexViewModel.Page : FirstPage;
            //missing filtering
            var results = _customersManagement.GetCustomers();

            indexViewModel.PagedItems = results.ToPagedList(pageIndex, PageSize);

            return(View(indexViewModel));
        }
        public ActionResult Create()
        {
            var usersToShow     = GenerateUsersToShowList(GetAvailableUsersList());
            var customersToShow = GenerateCustomersToShowList(_customersManagement.GetCustomers());
            var editViewModel   = new EditViewModel
            {
                CreditProcessId        = 0,
                Customer               = new Customer(),
                CustomersList          = customersToShow,
                Salesman               = new User(),
                SalesmenList           = usersToShow,
                CreditStatus           = new CreditStatus(),
                CreditStatusesList     = _creditStatusesManagement.GetCreditStatuses(),
                FinantialCompany       = new Company(),
                FinantialCompaniesList = _companiesManagement.GetFinantialCompaniesList(),
                PagedItems             = new List <CreditProcessXCompany>().ToPagedList(1, PageSize),
            };

            return(View("Edit", editViewModel));
        }