Example #1
0
        public AviationMedicineResponse GetAviationMedicineList(string name, int pageIndex, int pageSize)
        {
            IPagedList <AviationMedicine> aviationMedicines = aviationMedicineRepository.GetAviationMedicineList(name, pageIndex, pageSize);

            return(new AviationMedicineResponse
            {
                TotalCount = aviationMedicines.Count(),
                AviationMedicineList = aviationMedicines.ToList()
            });
        }
Example #2
0
        public void ThenDesitinationObjectWillBeMapped()
        {
            Assert.IsTrue(PageIndex == _destination.PageIndex);
            Assert.IsTrue(PagedSize == _destination.PageSize);
            Assert.IsTrue(2 == _destination.PageCount);
            Assert.IsTrue(PagedSize == _destination.Count());

            CollectionAssert.IsNotEmpty(_destination);
            CollectionAssert.AllItemsAreInstancesOfType(_destination, typeof(DestinationClass));
        }
Example #3
0
        public ActionResult SearchResults([Bind(Include = "SearchTerm,SearchMunicipality,SelectedCounties,ItemsPerPage,Page")] SearchQuery sQuery)
        {
            //sQuery.Page = sQuery.ItemsPerPage > 5 && sQuery.Page > 1 ? 1 : sQuery.Page;
            var list = ListBuilder(sQuery.SelectedCounties, sQuery.SearchTerm, sQuery.SearchMunicipality);
            IPagedList <Stiftelse> pagedList = list.ToPagedList(sQuery.Page, sQuery.ItemsPerPage);

            if (pagedList.Count() == 0)
            {
                pagedList   = list.ToPagedList(1, sQuery.ItemsPerPage);
                sQuery.Page = 1;
            }

            sQuery.SearchResults = pagedList;

            return(View(sQuery));
        }