public ActionResult SendReminder(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CandidateInterview interview = db.CandidateInterviews.Find(id); if (interview == null) { return(HttpNotFound()); } if (interview.IsRecruiter(User) == false) { return(View("Unauthorized")); } interview.Candidate = db.Candidates.Find(interview.CandidateID); InterviewNotice pastDueNotice = new InterviewNotice(interview, "PastDue"); if (pastDueNotice != null) { Mailer mailer = new Mailer(MessageTemplate.Default, true); mailer.AddRecipient(interview.InterviewersEmail); mailer.SendMessage("InterviewNotice", pastDueNotice, pastDueNotice.Subject); return(Content(String.Format("Reminder has been sent to {0}", interview.InterviewersName))); } return(Content("Failed to send reminder")); }
public ActionResult CancelReminder(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CandidateInterview interview = db.CandidateInterviews.Find(id); if (interview == null) { return(HttpNotFound()); } if (interview.IsRecruiter(User) == false && interview.IsOrganizer(User) == false) { return(View("Unauthorized")); } try { interview.Complete = true; db.Entry(interview).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("PastDue")); } catch (Exception) { return(Content("Failed to cancel reminders")); } }
public ActionResult Schedule(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CandidateInterview interview = db.CandidateInterviews.Find(id); if (interview == null) { return(HttpNotFound()); } if (interview.IsRecruiter(User) == false && UserRole.IsEvalutionAdmin(User) == false) { return(View("Unauthorized")); } ViewBag.InterviewTypes = CandidateInterview.InterviewTypes(); return(View(interview)); }