public IActionResult Get_Specific_Interview(int?id) { _interviewScheme = new InterviewScheme(); _nationality = new Nationality(); _studyField = new StudyField(); InterviewSchemeVM vm = new InterviewSchemeVM(); var model = _interviewScheme.GetInterviewSchemeAndQuestions(id); vm = model; var nationalities = _nationality.GetAllNationalities(); var studyfields = _studyField.GetAllStudyFields(); foreach (var country in nationalities) { vm.Countries.Add(new SelectListItem() { Text = country.Name, Value = country.Id.ToString() }); } foreach (var study in studyfields) { vm.Studyfields.Add(new SelectListItem() { Text = study.FieldName, Value = study.Id.ToString() }); } foreach (var quest in model.Questions) { vm.Questions.Add(new QuestionVM() { Id = quest.Id, Order = quest.Order, InterviewSchemeId = quest.InterviewSchemeId, Quest = quest.Quest }); } vm.Questions = vm.Questions.OrderBy(x => x.Order).ToList(); return(View("../Administration/Specific_Interview_And_Questions", vm)); }
public IActionResult Get_Interview_Modal(string id) { Models.ApplicantVM app = new Models.ApplicantVM(); Applicant temp = new Applicant(); app = temp.GetApplicant(id); InterviewScheme _interviewScheme = new InterviewScheme(); var quest = _interviewScheme.GetInterviewSchemeAndQuestions(app.InterviewScheme.Id); foreach (var item in quest.Questions) { app.InterviewScheme.Questions.Add(new Models.QuestionVM() { Id = item.Id, Order = item.Order, Answer = item.Answer, InterviewSchemeId = item.InterviewSchemeId, Quest = item.Quest }); } app.InterviewScheme.Questions.OrderBy(x => x.Order).ToList(); return(PartialView("../Interviewer/Partials/DoInterview", app)); }