コード例 #1
0
        // GET: PhoneInterview
        public ActionResult Index(int?applicantId)
        {
            if (applicantId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            if (_rolesManager.SetCurrentEmployee(GetCurrentUserEmail()))
            {
                if (_rolesManager.IsStaffing())
                {
                    ViewBag.ApplicantName = _applicantsDataAccess.GetApplicantById(applicantId).Name;

                    var formQuestions = from d in _formQuestionsDataAccess.GetAllQuestions(FormType.PhoneInterview)
                                        orderby d.OrderInForm
                                        select d;

                    var phoneInterview = new PhoneInterview
                    {
                        ApplicantId = (int)applicantId
                    };

                    var viewModel = new PhoneInterviewViewModel
                    {
                        FormQuestions  = formQuestions.ToList(),
                        PhoneInterview = phoneInterview
                    };

                    ViewBag.ProfilePic = _rolesManager.LoggedInEmployee.ProfilePic;
                    ViewBag.Staffing   = _rolesManager.IsStaffing();
                    return(View(viewModel));
                }

                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"));
        }
コード例 #2
0
 public void CreatePhoneInterview(PhoneInterview phoneInterview)
 {
     _db.PhoneInterviews.Add(phoneInterview);
     _db.SaveChanges();
 }