Beispiel #1
0
        public void SuggestionDoesNotComply(Student student, Suggestion suggestion)
        {
            suggestion.ToNewState();

            //send for notivication
            UserHelper.NotifyStakeholderSuggestionDeclined(student);
        }
        public ActionResult Create(CreateViewModel model, User user, string btnSaveSend)
        {
            Student student = (Student)user;

            if (ModelState.IsValid)
            {
                try
                {
                    var suggestion = new Suggestion
                    {
                        Title = model.Suggestion.Title,
                        Keywords = model.Suggestion.Keywords,
                        Context = model.Suggestion.Context,
                        Subject = model.Suggestion.Subject,
                        Goal = model.Suggestion.Goal,
                        ResearchQuestion = model.Suggestion.ResearchQuestion,
                        Motivation = model.Suggestion.Motivation,
                        References = model.Suggestion.References,
                        Student = student
                    };

                    var coPromotor = new CoPromotor
                    {
                        FirstName = model.CoPromotor.FirstName,
                        LastName = model.CoPromotor.LastName,
                        Email = model.CoPromotor.Email,
                        Company = model.CoPromotor.Organisation
                    };

                    //researchdomains
                   

                    if (btnSaveSend != null)
                    {
                        student.GiveInSuggestion(student, suggestion);
                        TempData["Success"] = "Uw voorstel werd aangemaakt en ingediend!";
                    }
                    else
                    {
                        TempData["Success"] = "Uw voorstel werd aangemaakt!";
                    }

                    student.CoPromotor = coPromotor;
                    student.Suggestions.Add(suggestion);
                    _userRepository.SaveChanges();
                    _suggestionRepository.SaveChanges();

                    return RedirectToAction("DashBoard", "Home");
                }
                catch (ApplicationException e)
                {
                    ModelState.AddModelError("", e.Message); // shows in summary
                }
            }
            return View();
        }
Beispiel #3
0
        public void AskAdviseBpc(Student student, Suggestion suggestion)
        {
            //Set state 
            suggestion.ToAdviceBpcState();
            var bpc = new BPCoordinator();
            //INSERT NOTIFY STAKEHOLDERS HERE
            UserHelper.NotifyStakeholderAdviceBpcNeeded(bpc);


        }
Beispiel #4
0
        public void GiveFeedback(String feedback, Student student, Suggestion suggestion, String state)
        {
            //Put all other feedbacks to not visable
            foreach (var f in suggestion.Feedbacks)
            {
                f.Visable = false;
            }
            //Add the new feedback
            suggestion.Feedbacks.Add(new Feedback(feedback));

            //Send notification
            UserHelper.NotifyStakeholderFeedbackGiven(student);

            //If state is approved the do this
            if (state == "Approve")
            {
                //To apprived state
                suggestion.ToApprovedWithRemarksState();
                //Send notification
                UserHelper.NotifyStakeholderSuggestionAcceptedWithRemarks(student);
            }

        }
Beispiel #5
0
 public NewState(Suggestion suggestion):base(suggestion)
 {
     
 }
Beispiel #6
0
 public void GiveAdvice(Suggestion suggestion, String advice)
 {
     suggestion.AdviceBPC = advice;
     
     UserHelper.NotifyStakeholdersBpcHasGivenAdvice(suggestion.Student);
 }
Beispiel #7
0
 public void SuggestionAccepted(Student student, Suggestion suggestion)
 {
     suggestion.ToApprovedState();
     UserHelper.NotifyStakeholderSuggestionAccepted(student);
 }
Beispiel #8
0
 protected SuggestionState(Suggestion suggestion)
 {
     Suggestion = suggestion;
 }
Beispiel #9
0
 public void GiveInSuggestion(Student student, Suggestion suggestion)
 {
     suggestion.ToSubmittedState();
     UserHelper.NotifyStudentGivenSuggestion(student.Promotor);
 }
Beispiel #10
0
 public SubmittedState(Suggestion suggestion):base(suggestion)
 {
     
 }