public ActionResult RejectApplicant(String sn) { Applicant.RejectApplicant(sn); EmailUtility email = new EmailUtility(new EmailService()); email.SendIneligibleEmail(sn); return RedirectToAction("PendingReview", "Admin"); }
public ActionResult AwardApplicant(String sn) { List<Applicant> applicants = new List<Applicant>(ApplicantList.GetList(a => a.IsVerified.GetValueOrDefault(false) && a.IsEligible.GetValueOrDefault(false))); IEmailService emailService = new EmailService(); EmailUtility email = new EmailUtility(emailService); Applicant applicant = applicants.FirstOrDefault(a => a.StudentNumber.Equals(sn, StringComparison.OrdinalIgnoreCase)); //Notify other applicants that they did not win. foreach (String studentNumber in applicants.Where(a=> !a.StudentNumber.Equals(sn, StringComparison.OrdinalIgnoreCase)).Select(a => a.StudentNumber)) { email.SendNotAwardedEmail(studentNumber); } ///Prepare the request for the registrar. TuitionAmountRequest request = new TuitionAmountRequest(applicant.StudentNumber); XmlSchemaProvider provider = new XmlSchemaProvider(); XmlDocument requestDocument = (new BSTSmartScholarshipSerializer<TuitionAmountRequest>()).Serialize(request); Registrar registrar = new Registrar(); XmlDocument responseDocument = registrar.RequestTuitionAmount(requestDocument); TuitionAmountResponse response = (new BSTSmartScholarshipSerializer<TuitionAmountResponse>()).Deserialize(responseDocument); //Award the scholarship Award.AddAward(applicant.StudentNumber, applicant.FirstName, applicant.LastName, response.TuitionAmount); //Notify Accounting of the reimbursement amount. Award.NotifyAccounting(response.StudentNumber, response.TuitionAmount); //Send award emails. email.SendAwardedEmail(sn, response.TuitionAmount); return RedirectToAction("Awarded", "Admin"); }
public ActionResult DeclineApplicant(String sn) { Applicant.DeclineApplicant(sn); EmailUtility email = new EmailUtility(new EmailService()); email.SendDeclinedEmail(sn); return RedirectToAction("Index", "Admin"); }