using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using TravelAgencyWindow.Data;
using TravelAgencyWindow.Model.ListModel;

namespace TravelAgencyWindow.Pages
{
    /// <summary>
    /// Логика взаимодействия для ListOfHotelPage.xaml
    /// </summary>
    public partial class ListOfHotelPage : Page
    {
        private ListHotel HotelTour = new ListHotel();
        private int countHotel = GlobalData.ConnectionDB.Hotel.Count();
        public ListOfHotelPage()
        {
            InitializeComponent();
            DataContext = HotelTour;
        }

        private void NUDButtonUP_Click(object sender, RoutedEventArgs e)
        {
            HotelTour.CountOnPage++;
        }

        private void NUDButtonDown_Click(object sender, RoutedEventArgs e)
        {
            if (HotelTour.CountOnPage > 1)
            {
                HotelTour.CountOnPage--;
            }
        }

        private void PageButtonPrew_Click(object sender, RoutedEventArgs e)
        {
            if (HotelTour.PageNumber > 1)
            {
                HotelTour.PageNumber--;
            }
        }

        private void PageButtonNext_Click(object sender, RoutedEventArgs e)
        {
            if (countHotel - HotelTour.PageNumber * HotelTour.CountOnPage > 0)
                HotelTour.PageNumber++;
        }
    }
}
