public ActionResult Details(int?applicantId, InterviewType interviewType) { if (applicantId == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (_rolesManager.SetCurrentEmployee(GetCurrentUserEmail())) { if (_rolesManager.IsStaffing() || _rolesManager.IsManager()) { var applicant = new Applicant(); if (!_rolesManager.GetApplicantDetails(_applicantsDataAccess, ref applicant, applicantId)) { ViewBag.ErrorMsg = "You are not authorized to view this page"; return(View("Error")); } if (applicant == null) { return(HttpNotFound()); } var interview = _interviewsDataAccess.GetInterviewByApplicantId(applicantId, interviewType); if (interview == null) { return(HttpNotFound()); } ViewBag.ProfilePic = _rolesManager.LoggedInEmployee.ProfilePic; ViewBag.Staffing = _rolesManager.IsStaffing(); return(View(interview)); } ViewBag.ErrorMsg = "You are not authorized to view this page"; return(View("Error")); } ViewBag.ErrorMsg = "You are not registered on our system. Plz contact the system administrator if u think this is wrong."; return(View("Error")); }
public ActionResult New(int applicantId, InterviewType interviewType) { if (_rolesManager.SetCurrentEmployee(GetCurrentUserEmail())) { if (_rolesManager.IsStaffing()) { var interview = new Interview { ApplicantId = applicantId, InterviewType = interviewType }; ViewBag.ProfilePic = _rolesManager.LoggedInEmployee.ProfilePic; ViewBag.Staffing = _rolesManager.IsStaffing(); return(View("InterviewForm", interview)); } ViewBag.ErrorMsg = "You are not authorized to view this page"; return(View("Error")); } ViewBag.ErrorMsg = "You are not registered on our system. Plz contact the system administrator if u think this is wrong."; return(View("Error")); }
public static bool IsInterviewSubmitted(int applicantId, InterviewType interviewType) { var interview = InterviewsDataAccess.GetInterviewByApplicantId(applicantId, interviewType); return(interview != null); }
public Interview GetInterviewByApplicantId(int?applicantId, InterviewType interviewType) { return(_db.Interviews.FirstOrDefault(m => m.ApplicantId == applicantId && m.InterviewType == interviewType)); }