Example #1
0
        public ActionResult Classification(int?p, string search)
        {
            using (UnitOfWorkManager.NewUnitOfWork())
            {
                var pageIndex = p ?? 1;

                var allClassifications = string.IsNullOrEmpty(search) ? _classificationService.GetAll(pageIndex, SiteConstants.Instance.AdminListPageSize) :
                                         _classificationService.Search(search, pageIndex, SiteConstants.Instance.AdminListPageSize);

                var allBusinesses = _businessService.GetAllBusiness();
                ClassificationListViewModel viewModel = new ClassificationListViewModel
                {
                    AllClassifications = allClassifications,
                    AllBusinesses      = allBusinesses.ToList(),
                    PageIndex          = pageIndex,
                    TotalCount         = allClassifications.TotalCount,
                    Search             = search,
                    TotalPages         = allClassifications.TotalPages
                };
                return(View(viewModel));
            }
        }