// GET: VacationRequestController/Create public async Task <ActionResult> Create() { var vacationtypes = await _typerepo.FindAll(); var vacationtypeItems = vacationtypes.Select(q => new SelectListItem { Text = q.Name, Value = q.Id.ToString() }); var model = new CreateVacationRequestVM { VacationTypes = vacationtypeItems }; return(View(model)); }
// GET: VacationTypesController public async Task <ActionResult> Index() { var vacationtypes = await _repo.FindAll(); var model = _mapper.Map <List <VacationType>, List <VacationTypeVM> >(vacationtypes.ToList()); return(View(model)); }
// GET: VacationAllocationController public async Task <ActionResult> Index() { var vacationtypes = await _typerepo.FindAll(); var mappedvacationtypes = _mapper.Map <List <VacationType>, List <VacationTypeVM> >(vacationtypes.ToList()); var model = new CreateVacationAllocationVM { VacationTypes = mappedvacationtypes, NumberUpdated = 0 }; return(View(model)); }