Ejemplo n.º 1
0
        public ActionResult Participant()
        {
            //Gets the id from JWT. The id is used to retrieve user from database.
            int partID = IdentityHelper.getUserID(User);


            //Creates a ParticipantHomepageModel
            ParticipantHomepageHelper participantHomepageHelper = new ParticipantHomepageHelper();
            ParticipantHomepageModel  participantHomepageModel  = participantHomepageHelper.CreateParticipantHomepageModel(partID);

            return(View(participantHomepageModel));
        }
Ejemplo n.º 2
0
        public ParticipantHomepageModel CreateParticipantHomepageModel(int partID)
        {
            bachelordbContext        db          = new bachelordbContext();
            Participant              participant = getParticipant(partID);
            IViewStudyHandler        vsh         = new ViewStudyHandler(new bachelordbContext());
            ParticipantHomepageModel participantHomepageModel = new ParticipantHomepageModel();

            //Gets the relevant Study
            participantHomepageModel.relevantStudies = vsh.GetRelevantStudiesDB(participant);

            //Gets the Study that the participant is enrolled in.
            participantHomepageModel.myParticipantStudies = vsh.GetMyParticipantStudiesDB(participant.IdParticipant);

            return(participantHomepageModel);
        }