public AwardScholarshipGenderHandler(AwardScholarshipHandler successor) : base(successor) { }
public ActionResult Awarded() { if (Award.Awarded(null, null)) { return RedirectToAction("Closed", "Admin"); } Boolean showVoteButton = false; List<Applicant> applicants = new List<Applicant>(ApplicantList.GetList(a => a.IsVerified.GetValueOrDefault(false) && a.IsEligible.GetValueOrDefault(false))); ViewBag.HasUserVoted = false; ViewBag.MostVotes = 0; if (applicants.Count > 0) { //Set up chain AwardScholarshipAgeHandler ageHandler = new AwardScholarshipAgeHandler(null); AwardScholarshipGenderHandler genderHandler = new AwardScholarshipGenderHandler(ageHandler); AwardScholarshipStatusHandler statusHandler = new AwardScholarshipStatusHandler(genderHandler); AwardScholarshipCurrentGPAHandler currentHandler = new AwardScholarshipCurrentGPAHandler(statusHandler); AwardScholarshipCumulativeGPAHandler cumulativeHandler = new AwardScholarshipCumulativeGPAHandler(currentHandler); AwardScholarshipHandler handler = new AwardScholarshipHandler(cumulativeHandler); applicants = handler.AwardScholarship(applicants); ViewBag.MostVotes = applicants.Max(a => a.Votes.Count); if (applicants.Count > 1) { using (ISmartScholarshipContext sdx = SmartScholarshipContext.Current) { if (sdx.Votes.Count(v => v.UserId.Equals(this.User.Identity.Name, StringComparison.OrdinalIgnoreCase)) == 0) { showVoteButton = true; } } if (applicants.Count(a => a.Votes.Count == ViewBag.MostVotes) == 1) { ViewBag.AwardTo = applicants.First(a => a.Votes.Count == ViewBag.MostVotes).StudentNumber; } } else { ViewBag.AwardTo = applicants.First().StudentNumber; } ViewBag.HasUserVoted = Vote.HasVoted(this.User.Identity.Name); } ViewBag.ShowVoteButton = showVoteButton; return View(applicants); }
public AwardScholarshipStatusHandler(AwardScholarshipHandler successor) : base(successor) { }
public AwardScholarshipCurrentGPAHandler(AwardScholarshipHandler successor) : base(successor) { }
public AwardScholarshipCumulativeGPAHandler(AwardScholarshipHandler successor) : base(successor) { }
public AwardScholarshipHandler(AwardScholarshipHandler successor) { _successor = successor; }
public AwardScholarshipAgeHandler(AwardScholarshipHandler successor) : base(successor) { }