Esempio n. 1
0
        private string Step8_NoticeCandidateToSchoolPrincipal()
        {
            //Arrange

            InterviewNotice interviewNotice = new InterviewNotice()
            {
                Operate     = "Notice Update",
                UserID      = "mif",
                SchoolYear  = _schoolYear,
                PositionID  = _positionId.ToString(),
                NoticeDate  = DateFC.YMD(DateTime.Now),
                PrincipalID = _principalId
            };

            //Act
            string expect = "Successfully";
            string result = SelectCandidateExe.NoticeUpdate(interviewNotice);


            //Assert
            Assert.AreEqual(expect, result, $"Notice position { interviewNotice.PositionID } interview candiates to  School Principal { _principalId } ");


            return("Successfully");
        }
Esempio n. 2
0
        public IHttpActionResult SendEvaluationPastDueNotice(CandidateInterview interview)
        {
            try
            {
                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(StatusCode(HttpStatusCode.NoContent));
                }

                return(BadRequest());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Esempio n. 3
0
        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"));
        }
Esempio n. 4
0
        internal bool CreateAppointment()
        {
            try
            {
                string subject = new InterviewNotice(this, "Appointment").Subject;

                dynamic appointment = PowerShell.RunScript("Create-Appointment", new { ImpersonatedUser = OrganizersEmail, Subject = subject, StartDate = InterviewDate, Location = InterviewType });

                AppointmentID = appointment.ICalUid;
                InterviewDate = appointment.Start;

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 5
0
        public ActionResult Schedule(CandidateInterview interview)
        {
            interview.ValidateSchedule(ModelState, User);

            interview.Candidate = db.Candidates.Find(interview.CandidateID);

            if (ModelState.IsValid)
            {
                if (interview.CreateAppointment())
                {
                    InterviewNotice scheduleNotice = new InterviewNotice(interview, "MeetingRequest");

                    if (TryValidateModel(scheduleNotice))
                    {
                        Mailer mailer = new Mailer(MessageTemplate.Default, true);

                        mailer.AddRecipient(interview.OrganizersEmail);
                        mailer.SendMessage("InterviewNotice", scheduleNotice, scheduleNotice.Subject);
                    }

                    InterviewNotice evaluationNotice = new InterviewNotice(interview, "Evaluation");

                    if (TryValidateModel(evaluationNotice))
                    {
                        Mailer mailer = new Mailer(MessageTemplate.Default, true);

                        mailer.AddRecipient(interview.InterviewersEmail);
                        mailer.SendMessage("InterviewNotice", evaluationNotice, evaluationNotice.Subject);
                    }

                    db.Entry(interview).State = EntityState.Modified;
                    db.SaveChanges();

                    return(RedirectToAction("Details", new { id = interview.CandidateID }));
                }

                ModelState.AddModelError("MeetingRequest", "Meeting Request Error");
            }

            ViewBag.InterviewTypes = CandidateInterview.InterviewTypes();

            return(View(interview));
        }
Esempio n. 6
0
        public ActionResult Evaluation(CandidateInterview interview)
        {
            interview.ValidateEvaluation(ModelState);

            interview.Candidate = db.Candidates.Find(interview.CandidateID);

            if (ModelState.IsValid)
            {
                interview.Complete = true;

                InterviewNotice completionNotice = new InterviewNotice(interview, "Complete");

                if (TryValidateModel(completionNotice))
                {
                    Mailer mailer = new Mailer(MessageTemplate.Evaluation, true);

                    mailer.SetFromAddress(interview.InterviewersEmail);
                    mailer.AddRecipient(interview.OrganizersEmail);
                    mailer.AddRecipient(interview.Candidate.RecruitersEmail);
                    mailer.AddRecipient(interview.Candidate.ManagersEmail);
                    mailer.SendMessage("InterviewNotice", completionNotice, completionNotice.Subject);

                    db.Entry(interview).State = EntityState.Modified;
                    db.SaveChanges();

                    return(RedirectToAction("Details", new { id = interview.CandidateID }));
                }

                ModelState.AddModelError("MailNotice", "Mail Notice Error");
            }

            interview.Candidate = db.Candidates.Find(interview.CandidateID);

            ViewBag.Grades          = CandidateInterview.Grades(false);
            ViewBag.OptionalGrades  = CandidateInterview.Grades(true);
            ViewBag.Recommendations = CandidateInterview.Recommendations();

            return(View(interview));
        }
Esempio n. 7
0
 public ActionResult InterviewNotice(InterviewNotice interviewNotice)
 {
     return(View(interviewNotice));
 }
Esempio n. 8
0
 public static string InterviewNotice(InterviewNotice operation, string action)
 {
     //  return CommonOperationExcute<InterviewNotice>.CommonOperation(operation, action);
     return(Operation(operation, action));
 }