// GET: PersonAvail public ActionResult Index() { IList <PersonAvailViewModel> personAvailsVm = new List <PersonAvailViewModel>(); foreach (PersonAvail pa in _repository.GetPersonAvailabilities().ToList()) { personAvailsVm.Add(new ViewModels.PersonAvailViewModel() { PersonAvailDetail = pa, PersonName = _repository.GetPersonById(pa.PersonId) == null ? "" : _repository.GetPersonById(pa.PersonId).Name }); } return(View(personAvailsVm)); }
// GET: Assignment public ActionResult Index() { IList <AssignmentViewModel> assignmentsVm = new List <AssignmentViewModel>(); foreach (Assignment a in _repository.GetAssignments()) { assignmentsVm.Add(new AssignmentViewModel() { AssignmentDetail = a, SlotSelected = _repository.GetSlotById(a.SlotId).Name, TaskTypeSelected = _repository.GetTaskTypeById(a.TaskTypeId).Name, PersonSelected = _repository.GetPersonById(a.PersonId).Name, }); } return(View(assignmentsVm)); }
// GET: Person/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Person person = _repository.GetPersonById(id); if (person == null) { return(HttpNotFound()); } PersonViewModel personViewModel = new PersonViewModel() { PersonDetail = person, RolesSelected = GetRolesSelected(person), RoleNamesSelected = GetRoleNamesSelected(person), Capacities = GetRoles(person) }; return(View(personViewModel)); }