using nukakto.Models;
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.Shapes;

namespace nukakto
{
    /// <summary>
    /// Логика взаимодействия для OneWindow.xaml
    /// </summary>
    public partial class OneWindow : Window
    {
        public OneWindow()
        {
            InitializeComponent();
            gr606_kusanContext context = new gr606_kusanContext();

            AttractionsView.ItemsSource = context.Attractions.ToList();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            Maps map = new Maps();
            map.Show();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            this.Hide();
            StockWindow sto = new StockWindow();
            sto.Show();
        }

        private void Button_Click_2(object sender, RoutedEventArgs e)
        {

            this.Hide();
            Setting at = new Setting();
            at.Show();

        }

      
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            gr606_kusanContext context = new gr606_kusanContext();
            var attraction = (sender as Button).DataContext as Attraction;
            var stock = context.Stocks.SingleOrDefault(x => x.IdAttractions == attraction.IdAttractions);
            MessageBox.Show("Название: " + attraction.Name + "\n" + "Номер: " + attraction.IdAttractions + "\n" + "Акции на аттракцион " + stock.IdStock);
        }
    }
}
