// GET: Recruitment public ActionResult Index() { RecruitmentService userService = new RecruitmentService(); UserService uService = new UserService(); var recruiters = userService.GetRecruiterList(); List <RecruitmentListViewModel> recruiterlist = new List <RecruitmentListViewModel>(); if (TempData["error"] != null) { ViewBag.error = TempData["error"]; } if (TempData["status"] != null) { ViewBag.status = TempData["status"]; } foreach (Recruitment u in recruiters) { RecruitmentListViewModel rcvm = new RecruitmentListViewModel(); rcvm.RecruitmentId = u.RecruitmentId; rcvm.ModifiedDate = u.ModifiedDate; rcvm.FirstName = u.FirstName; rcvm.LastName = u.LastName; rcvm.PhoneNumber = u.PhoneNumber; rcvm.PrimarySkillSet = u.PrimarySkillSet; rcvm.RecruiterName = User.Identity.Name; rcvm.AvailableDate = u.AvailableDate; rcvm.CreatedUser = uService.GetUserWithId(u.CreatedUserId).Firstname + ' ' + uService.GetUserWithId(u.CreatedUserId).LastName; rcvm.ModifiedUser = uService.GetUserWithId(u.ModifiedUserId).Firstname + ' ' + uService.GetUserWithId(u.ModifiedUserId).LastName; recruiterlist.Add(rcvm); } return(View(recruiterlist)); }