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

            List <Hulpvraag> lijst = hvr.GetHulpvragenByVrijwilligerId(4);
        }
Пример #2
0
        // GET: Vrijwilliger
        public ActionResult Index()
        {
            if (!AuthRepository.CheckIfUserCanAcces(GebruikerType.Vrijwilliger, (Gebruiker)Session["LoggedInUser"]))
            {
                return(View("~/Views/Error/AuthError.cshtml"));
            }

            HulpvraagSqlContext hvsc = new HulpvraagSqlContext();
            HulpvraagRepository hvr  = new HulpvraagRepository(hvsc);

            var vrijwilliger = (Vrijwilliger)Session["LoggedInUser"];

            try
            {
                //Haal mijn opdrachten op
                List <Hulpvraag> hulpvragen = hvr.GetHulpvragenByVrijwilligerId(vrijwilliger.Id);
                ViewBag.hulpvragen = hulpvragen;


                return(View("~/Views/Vrijwilliger/Hoofdscherm.cshtml"));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", "Error"));
            }
        }