public ActionResult EditResponseStatus(int?applicantId, ApplicationFormResponseStatus status)
        {
            if (applicantId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var formResponse = _formResponsesDataAccess.GetResponseByApplicantId(applicantId);

            if (formResponse == null)
            {
                return(HttpNotFound());
            }

            _formResponsesDataAccess.EditResponseStatus(formResponse, status);

            var applicant = _applicantsDataAccess.GetApplicantById(applicantId);

            if (status == ApplicationFormResponseStatus.Passed)
            {
                _applicantsDataAccess.EditApplicantStatus(applicant, ApplicantStatus.ScreeningPassed);
            }
            else if (status == ApplicationFormResponseStatus.NotPassed)
            {
                _applicantsDataAccess.EditApplicantStatus(applicant, ApplicantStatus.ScreeningRejected);
            }
            else
            {
                _applicantsDataAccess.EditApplicantStatus(applicant, ApplicantStatus.ApplicationSubmitted);
            }

            return(RedirectToAction("Index", "Applicants"));
        }
Beispiel #2
0
 public void EditResponseStatus(FormResponse formResponse, ApplicationFormResponseStatus responseStatus)
 {
     formResponse.Status = responseStatus;
     _db.SaveChanges();
 }