Esempio n. 1
0
        private void DisplayHotels(int currentPage)
        {
            int nrOfHotels;
            int nrOfPages;

            var countyId = (int)countyComboBox.SelectedValue;
            var cityId   = (int)cityComboBox.SelectedValue;

            FilterType filterType = new FilterType(countyId, cityId);

            double       offset       = PageAction.CalculateOffset(currentPage, PAGE_LIMIT);
            List <Hotel> listOfHotels = HotelService.GetListByOffsetAndFilterType(PAGE_LIMIT, offset, filterType);

            if (listOfHotels.Count > 0)
            {
                InitializeDataGridView(listOfHotels);
                nrOfHotels = HotelService.GetTotalNrOfHotels(filterType);
                nrOfPages  = Convert.ToInt32(PageAction.GetNrOfPages(nrOfHotels, PAGE_LIMIT));

                SetPageNr(currentPage);
                //si butoanele disabled unde le faci? care butoane?
                SetEnabledButtons(currentPage, nrOfPages);
            }
        }