public RecepciosIdopontSzerkesztoWindow(RecepciosViewModel recepciosViewModel, Idopontok idopont)
        {
            InitializeComponent();
            this.recepciosViewModel = recepciosViewModel;
            mungoSystem             = recepciosViewModel.MungoSystem;
            this.idopont            = idopont;

            var orvosnev = mungoSystem.People.Where(x => x.PeopleID == idopont.OrvosID).Select(x => x.Name).First();

            orvosLbl.Content = orvosnev;
            datumLbl.Content = idopont.Datum.Value.ToShortDateString() + " " + idopont.Datum.Value.ToShortTimeString();
            this.DataContext = recepciosViewModel;



            mungoSystem.Betegek.Load();

            var betegek = from b in mungoSystem.Betegek
                          join p in mungoSystem.People on b.PeopleID equals p.PeopleID
                          where b.Deleted == 0 && p.Deleted == 0
                          select new { TAJ = b.TAJ, Nev = p.Name, BetegID = b.BetegID, PeopleID = b.PeopleID };

            recepciosViewModel.Betegek.Clear();
            foreach (var b in betegek)
            {
                recepciosViewModel.Betegek.Add(new BetegAdatai {
                    TAJ = b.TAJ, Nev = b.Nev, BetegID = b.BetegID, PeopleID = (int)b.PeopleID
                });
            }
        }
        public IdopontSzerkeszto(RecepciosViewModel recepciosViewModel, Idopontok idopont, StMungoServiceClient smc)
        {
            InitializeComponent();
            this.smc = smc;
            this.recepciosViewModel = recepciosViewModel;
            //smc.mungoSystem() = recepciosViewModel.MungoSystem;
            this.idopont = idopont;

            var orvosnev = smc.mungoSystem().People.Where(x => x.PeopleID == idopont.OrvosID).Select(x => x.Name).First();

            orvosLbl.Content = orvosnev;
            datumLbl.Content = idopont.Datum.Value.ToShortDateString() + " " + idopont.Datum.Value.ToShortTimeString();
            this.DataContext = recepciosViewModel;

            smc.Betegek_getLoad();

            var betegek = from b in smc.mungoSystem().Betegek
                          join p in smc.mungoSystem().People on b.PeopleID equals p.PeopleID
                          where b.Deleted == 0 && p.Deleted == 0
                          select new { TAJ = b.TAJ, Nev = p.Name, BetegID = b.BetegID, PeopleID = b.PeopleID };

            foreach (var b in betegek)
            {
                recepciosViewModel.Betegek.Add(new BetegTajIDNev {
                    TAJ = b.TAJ, Nev = b.Nev, BetegID = b.BetegID, PeopleID = (int)b.PeopleID
                });
            }
        }
        public IdopontSzerkeszto(RecepciosViewModel recepciosViewModel, Idopontok idopont, StMungoServiceClient smc)
        {
            InitializeComponent();
            this.smc = smc;
            this.recepciosViewModel = recepciosViewModel;
            //smc.mungoSystem() = recepciosViewModel.MungoSystem;
            this.idopont = idopont;
            
            var orvosnev = smc.mungoSystem().People.Where(x => x.PeopleID == idopont.OrvosID).Select(x => x.Name).First();
            orvosLbl.Content = orvosnev;
            datumLbl.Content = idopont.Datum.Value.ToShortDateString() +" " + idopont.Datum.Value.ToShortTimeString();
            this.DataContext = recepciosViewModel;

            smc.Betegek_getLoad();

            var betegek = from b in smc.mungoSystem().Betegek
                          join p in smc.mungoSystem().People on b.PeopleID equals p.PeopleID
                          where b.Deleted == 0 && p.Deleted==0
                          select new { TAJ = b.TAJ, Nev = p.Name, BetegID = b.BetegID, PeopleID = b.PeopleID };
           
            foreach(var b in betegek)
            {
                recepciosViewModel.Betegek.Add(new BetegTajIDNev { TAJ = b.TAJ, Nev = b.Nev, BetegID = b.BetegID, PeopleID = (int)b.PeopleID });
            }

            
 
        }
        public RecepciosIdopontSzerkesztoWindow(RecepciosViewModel recepciosViewModel, Idopontok idopont )
        {
            InitializeComponent();
            this.recepciosViewModel = recepciosViewModel;
            mungoSystem = recepciosViewModel.MungoSystem;
            this.idopont = idopont;
            
            var orvosnev = mungoSystem.People.Where(x => x.PeopleID == idopont.OrvosID).Select(x => x.Name).First();
            orvosLbl.Content = orvosnev;
            datumLbl.Content = idopont.Datum.Value.ToShortDateString() +" " + idopont.Datum.Value.ToShortTimeString();
            this.DataContext = recepciosViewModel;

           

            mungoSystem.Betegek.Load();

            var betegek = from b in mungoSystem.Betegek
                          join p in mungoSystem.People on b.PeopleID equals p.PeopleID
                          where b.Deleted == 0 && p.Deleted==0
                          select new { TAJ = b.TAJ, Nev = p.Name, BetegID = b.BetegID, PeopleID = b.PeopleID };
            recepciosViewModel.Betegek.Clear();
            foreach (var b in betegek)
            {
                recepciosViewModel.Betegek.Add(new BetegAdatai { TAJ = b.TAJ, Nev = b.Nev, BetegID = b.BetegID, PeopleID = (int)b.PeopleID });
            }

            
 
        }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Console.WriteLine(listBox.SelectedItem);
            IdopontIDBeteg    selected = (listBox.SelectedItem) as IdopontIDBeteg;
            Idopontok         ip       = smc.mungoSystem().Idopontok.Where(x => x.IdopontID == selected.IdopontID).First();
            IdopontSzerkeszto isz      = new IdopontSzerkeszto(recepciosViewModel, ip, smc);

            isz.ShowDialog();
        }