Пример #1
0
        public void GetAll()
        {
            HulpvraagSqlContext hvsc = new HulpvraagSqlContext();
            HulpvraagRepository hvr  = new HulpvraagRepository(hvsc);

            var Lijst = hvr.GetAll();
        }
        // GET: Beheerder
        public ActionResult Index()
        {
            if (!AuthRepository.CheckIfUserCanAcces(GebruikerType.Beheerder, (Gebruiker)Session["LoggedInUser"]))
            {
                return(View("~/Views/Error/AuthError.cshtml"));
            }

            try
            {
                BeheerderViewModel model = new BeheerderViewModel();

                HulpvraagSqlContext hsc = new HulpvraagSqlContext();
                HulpvraagRepository hr  = new HulpvraagRepository(hsc);

                GebruikerSqlContext gsc = new GebruikerSqlContext();
                GebruikerRepository gr  = new GebruikerRepository(gsc);

                model.LstGebruiker = gr.GetUserWithType();
                model.LstHulpvraag = hr.GetAll();

                return(View(model));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", "Error"));
            }
        }