Exemple #1
0
        public bool UjIdopontFelvetele(DateTime idopont, Adatbazis.Orvos orvos, Adatbazis.Paciens paciens, string megnevezes)
        {
            ObservableCollection <OrvosRendelesekViewModel> foglaltIdopontok = IdopontLekeres(orvos);

            foreach (OrvosRendelesekViewModel akt in foglaltIdopontok)
            {
                if (akt.FoglaltIdopont == idopont && akt.Orvos == orvos.Nev)
                {
                    return(false);
                }
            }
            try
            {
                Adatbazis.Idopontok.Add(new Adatbazis.Idopont()
                {
                    FoglaltIdopont = idopont, PaciensID = paciens.Id, OrvosID = orvos.Id, Megnevezes = megnevezes
                });
                Adatbazis.SaveChanges();
            }
            catch { return(false); }
            Idopontok.Add(new OrvosRendelesekViewModel()
            {
                FoglaltIdopont = idopont, Paciens = paciens.Nev, Orvos = AktualisOrvos.Nev
            });
            return(true);
        }
 public bool UjIdopontFelvetele(DateTime idopont, Adatbazis.Paciens paciens, string megnevezes)
 {
     try
     {
         Adatbazis.Idopontok.Add(new Adatbazis.Idopont()
         {
             FoglaltIdopont = idopont, PaciensID = paciens.Id, OrvosID = AktualisOrvos.Id, Megnevezes = megnevezes
         });
         Adatbazis.SaveChanges();
     }
     catch { return(false); }
     Idopontok.Add(new OrvosRendelesekViewModel()
     {
         FoglaltIdopont = idopont, Paciens = paciens.Nev, Orvos = AktualisOrvos.Nev
     });
     return(true);
 }
Exemple #3
0
 public bool IdopontTorlese(OrvosRendelesekViewModel kivalasztottIdopont)
 {
     try
     {
         var torlendoIdopont = from x in Adatbazis.Idopontok
                               where x.FoglaltIdopont == kivalasztottIdopont.FoglaltIdopont
                               select x;
         if (torlendoIdopont.Count() > 0)
         {
             Adatbazis.Idopontok.Remove(torlendoIdopont.First());
         }
         Adatbazis.SaveChanges();
         Idopontok.Remove(kivalasztottIdopont);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public Idopont(Idopontok idopontelem)
 {
     IdopontElem = idopontelem;
     o           = BetegMainController.dbController.getOrvosById(IdopontElem.OrvosID.Value);
 }