using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
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;

namespace StoreServer
{
    /// <summary>
    /// Interaction logic for StartWorkPage.xaml
    /// </summary>
    public partial class StartWorkPage : Page
    {
        public StartWorkPage()
        {
            InitializeComponent();
        }


        private void BtnFind_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(TxtIDStore.Text) || TxtIDStore.Text.All(char.IsDigit) == false) 
            {
                Helper.ErrorMessage("Не корректный ID");
                return;
            }
            var FindStore = DB.db.Store.Find(Convert.ToInt32(TxtIDStore.Text));
            if (FindStore == null)
            {
                Helper.ErrorMessage("Магазин не найден");
                return;
            }
            Helper.FindStore = FindStore;
            ManagerFrame.MainFrame.Navigate(new MonitoringCashierPage());
        }
    }
}
