using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace Hotel_Course_Project
{
    /// <summary>
    /// Логика взаимодействия для RoomAddOnOrderWindow.xaml
    /// </summary>
    public partial class RoomAddOnOrderWindow : Window
    {
        public RoomAddOnOrderWindow()
        {
            InitializeComponent();
            RoomList.ItemsSource = DataBase.db.Room.Where(item => item.Id_RoomStatus == 1).ToList();
        }

        private void BackBtn_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
        }

        private void SelectRoomBtn_Click(object sender, RoutedEventArgs e)
        {
            Room room = (sender as Button).DataContext as Room;
            Helper.SelectedRoomOnOrder = room;
            DialogResult = true;
        }
    }
}
