private void button_Click(object sender, RoutedEventArgs e)
        {
            string username = userName.Text;
            string pw       = PWBox.Password;

            BetegAdat ba = smc.getBetegAdatok(36);

            MungoSystem mungoSystem = smc.mungoSystem();


            if (mungoSystem.People
                .Where(ppl => ppl.Password == pw && ppl.UserName == username && ppl.Deleted == 0)
                .Count() > 0)
            {
                People sessionUser = mungoSystem.People
                                     .Where(ppl => ppl.Password == pw && ppl.UserName == username && ppl.Deleted == 0)
                                     .First();
                smc.People_getLoad();
                //mungoSystem.People.Load();

                Window showWindow = new Window();
                this.Hide();
                switch (sessionUser.Group)
                {
                case 1:
                    //Beteg
                    break;

                case 2:
                    showWindow = new OrvosAsszisztensWindow(sessionUser, smc);
                    break;

                case 3:
                    showWindow             = new ApoloMainWindow(smc.mungoSystem(), sessionUser);
                    showWindow.DataContext = sessionUser;
                    break;

                case 4:
                    showWindow = new GazdAlkMainWindow(sessionUser, smc);
                    break;

                case 5:
                    showWindow = new RecepciosMainWindow(sessionUser, smc);
                    //Recepciós
                    break;

                case 6:
                    showWindow = new AdminWindow(smc.mungoSystem());
                    break;
                }
                showWindow.ShowDialog();
                St_Mungo.App.Current.Shutdown();
            }
            else
            {
                MessageBox.Show("Hibás felhasználónév vagy jelszó!");
            }
        }
        private void button_Click(object sender, RoutedEventArgs e)
        {

            string username = userName.Text;
            string pw = PWBox.Password;

            BetegAdat ba = smc.getBetegAdatok(36);

            MungoSystem mungoSystem = smc.mungoSystem();

            
            if (mungoSystem.People
                .Where(ppl => ppl.Password == pw && ppl.UserName == username && ppl.Deleted == 0)
                .Count() > 0)
            {
                People sessionUser = mungoSystem.People
                .Where(ppl => ppl.Password == pw && ppl.UserName == username && ppl.Deleted == 0)
                .First();
                smc.People_getLoad();
                //mungoSystem.People.Load();

                Window showWindow = new Window();
                this.Hide();
                switch (sessionUser.Group)
                {
                    case 1:
                        //Beteg
                        break;
                    case 2:
                        showWindow = new OrvosAsszisztensWindow(sessionUser,smc);
                        break;
                    case 3:
                        showWindow = new ApoloMainWindow(smc.mungoSystem(), sessionUser);
                        showWindow.DataContext = sessionUser;
                        break;
                    case 4:
                        showWindow = new GazdAlkMainWindow(sessionUser,smc);
                        break;
                    case 5:
                        showWindow = new RecepciosMainWindow(sessionUser,smc);
                        //Recepciós
                        break;
                    case 6:
                        showWindow = new AdminWindow(smc.mungoSystem());
                        break;
                }
                showWindow.ShowDialog();
                St_Mungo.App.Current.Shutdown();
            }
            else
            {
                MessageBox.Show("Hibás felhasználónév vagy jelszó!");
            }
        }
        private void button_Click(object sender, RoutedEventArgs e)
        {
            string username = userName.Text;
            string pw       = PWBox.Password;

            if (mungoSystem.People
                .Where(ppl => ppl.Password == pw && ppl.UserName == username && ppl.Deleted == 0)
                .Count() > 0)
            {
                People sessionUser = mungoSystem.People
                                     .Where(ppl => ppl.Password == pw && ppl.UserName == username && ppl.Deleted == 0)
                                     .First();
                mungoSystem.People.Load();
                Window showWindow = new Window();
                this.Hide();
                switch (sessionUser.Group)
                {
                case 1:
                    showWindow = new BetegWindow(mungoSystem, sessionUser);
                    break;

                case 2:
                    showWindow = new OrvosAsszisztensWindow(mungoSystem, sessionUser);
                    break;

                case 3:
                    showWindow = new ApoloMainWindow(mungoSystem, sessionUser);
                    break;

                case 4:
                    showWindow = new GazdAlkMainWindow(mungoSystem, sessionUser);
                    break;

                case 5:
                    showWindow = new RecepciosMainWindow(mungoSystem, sessionUser);
                    break;

                case 6:
                    showWindow = new AdminWindow(mungoSystem);
                    break;
                }
                showWindow.ShowDialog();
                //               App.Current.Shutdown();
            }
            else
            {
                MessageBox.Show("Hibás felhasználónév vagy jelszó!");
            }
        }
        private void button_Click(object sender, RoutedEventArgs e)
        {
            
            string username = userName.Text;
            string pw = PWBox.Password;
            if (mungoSystem.People
                .Where(ppl => ppl.Password == pw && ppl.UserName == username && ppl.Deleted == 0)
                .Count() > 0)
            {
                People sessionUser = mungoSystem.People
                .Where(ppl => ppl.Password == pw && ppl.UserName == username && ppl.Deleted == 0)
                .First();
                mungoSystem.People.Load();
                Window showWindow=new Window();
                this.Hide();
                switch (sessionUser.Group)
                {
                    case 1:
                        showWindow = new BetegWindow(mungoSystem, sessionUser);
                        break;
                    case 2:
                        showWindow = new OrvosAsszisztensWindow(mungoSystem, sessionUser);
                        break;
                    case 3:
                        showWindow = new ApoloMainWindow(mungoSystem, sessionUser);
                        break;
                    case 4:
                        showWindow = new GazdAlkMainWindow(mungoSystem, sessionUser);
                        break;
                    case 5:
                        showWindow = new RecepciosMainWindow(mungoSystem, sessionUser);
                        break;
                    case 6:
                        showWindow = new AdminWindow(mungoSystem);
                        break;
                }
                showWindow.ShowDialog();
 //               App.Current.Shutdown();
            }
            else
            {
                MessageBox.Show("Hibás felhasználónév vagy jelszó!");
            }
        }