public IdentityManagerRepository(WiskundeContext context)
 {
     _db = context;
     // Swap ApplicationRole for IdentityRole
     _roleManager = new RoleManager<ApplicationRole>(new RoleStore<ApplicationRole>(_db));
     _userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(_db));
 }
Exemplo n.º 2
0
        public List <LeerkrachtSchoolKlas> Toonalleklassen(int schoolID)
        {
            using (WiskundeContext context = new WiskundeContext())
            {
                var query = (from w in context.LeerkrachtSchoolKlas.Include(c => c.klas) where w.SchoolID == schoolID select w);

                return(query.ToList());
            }
        }
Exemplo n.º 3
0
 public List <Klas> getKlasById(int klasId)
 {
     using (WiskundeContext context = new WiskundeContext())
     {
         var query = (from w in context.Klas.Include(c => c.leerlingen)
                      where w.ID == klasId
                      select w);
         return(query.ToList());
     }
 }
Exemplo n.º 4
0
        //public List<ApplicationUser> Toonalleschooladministrators()
        public List <ApplicationUser> Toonalleschooladministrators()
        {
            using (WiskundeContext context = new WiskundeContext())
            {
                var query = (from w in context.Users.Include(c => c.school) where w.Roles.Any(c => c.Role.Name == "Schooladmin")
                             select w);

                return(query.ToList());
            }
        }
Exemplo n.º 5
0
 public void updateLeerkracht(Leerkracht teEditerenLk)
 {
     using (WiskundeContext context = new WiskundeContext())
     {
         Leerkracht leerkracht = context.Leerkracht.First(l => l.ID == teEditerenLk.ID);
         leerkracht.FamilieNaam = teEditerenLk.FamilieNaam;
         leerkracht.VoorNaam    = teEditerenLk.VoorNaam;
         context.SaveChanges();
     }
 }
Exemplo n.º 6
0
 public void updateKlas(Klas klas)
 {
     using (WiskundeContext context = new WiskundeContext())
     {
         Klas k = context.Klas.First(c => c.ID == klas.ID);
         k.KlasNaam = klas.KlasNaam;
         k.MaximumAantalLeerlingen = klas.MaximumAantalLeerlingen;
         context.SaveChanges();
     }
 }
Exemplo n.º 7
0
        public List <Leerling> Haalleerlingenschoolop(int LeerlingschoolID)
        {
            using (WiskundeContext context = new WiskundeContext())
            {
                var query = (from w in context.Leerling.Include(c => c.klas)
                             where w.KlasID == LeerlingschoolID
                             select w);

                return(query.ToList());
            }
        }
Exemplo n.º 8
0
        public void deleteLeerkracht(Leerkracht leerkracht)
        {
            using (WiskundeContext context = new WiskundeContext())
            {
                List <LeerkrachtSchoolKlas> lks = getLKSByLeerkrachtId(leerkracht.ID);
                foreach (LeerkrachtSchoolKlas lk in lks)
                {
                    lk.LeerKrachtID = null;
                    context.SaveChanges();
                }

                Leerkracht teVerwijderenLeerkracht = context.Leerkracht.Find(leerkracht.ID);
                context.Leerkracht.Remove(teVerwijderenLeerkracht);
                context.SaveChanges();
            }
        }
Exemplo n.º 9
0
        public List <LeerkrachtSchoolKlas> Toonalleleerkrachten(int gebruikersschoolID)
        {
            using (WiskundeContext context = new WiskundeContext())
            {
                List <LeerkrachtSchoolKlas> query         = (from w in context.LeerkrachtSchoolKlas.Include(c => c.leerkracht) where w.SchoolID == gebruikersschoolID select w).ToList();
                List <LeerkrachtSchoolKlas> nonDuplicaten = new List <LeerkrachtSchoolKlas>();

                int vorignr = 0;
                foreach (LeerkrachtSchoolKlas lsk in query)
                {
                    if (lsk.LeerKrachtID != vorignr)
                    {
                        nonDuplicaten.Add(lsk);
                        vorignr = (int)lsk.LeerKrachtID;
                    }
                }



                return(nonDuplicaten);
            }
        }
Exemplo n.º 10
0
 public SchoolRepository(WiskundeContext context)
 {
     this.context = context;
 }
Exemplo n.º 11
0
 public Gebruikersrepository(WiskundeContext context)
 {
     this.context = context;
 }
Exemplo n.º 12
0
 public UOW(WiskundeContext context)
 {
     this.context = context;
 }
Exemplo n.º 13
0
 public GenericRepository(WiskundeContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }
Exemplo n.º 14
0
 public Leerlingrepository(WiskundeContext context)
 {
     this.context = context;
 }
Exemplo n.º 15
0
 public UOW(WiskundeContext context)
 {
     this.context = context;
 }
Exemplo n.º 16
0
 //Wijzigen schooladministrator
 public ActionResult Wijzigadministrator(String id)
 {
     WiskundeContext context = new WiskundeContext();
     var user = context.Users.Find(id);
     Gebruikersrepository rep = new Gebruikersrepository();
     user.scholen = rep.GetScholen();
     return View(user);
 }
Exemplo n.º 17
0
 public Klasrepository(WiskundeContext context, IGenericRepository <Leerling> leerlingrespos)
 {
     this.context        = context;
     this.leerlingrespos = leerlingrespos;
 }
Exemplo n.º 18
0
 //Details schooladministrator bekijken
 public ActionResult Detailsadministrator(String id)
 {
     WiskundeContext context = new WiskundeContext();
     var user = context.Users.Find(id);
     return View(user);
 }