// GET: LeaveRequest/Create public ActionResult Create() { var leaveTypes = _leaverepo.FindAll(); var leaveTypeItems = leaveTypes.Select(q => new SelectListItem { Text = q.Name, Value = q.Id.ToString() }); var model = new CreateLeaveRequestVM { LeaveTypes = leaveTypeItems }; return(View(model)); }
// GET: LeaveTypes public ActionResult Index() { List <LeaveType> leaveTypes = _repo.FindAll().ToList(); List <DetailLeaveTypeVM> DeatilsOfLeaveTypes_VM = _mapper.Map <List <LeaveType>, List <DetailLeaveTypeVM> >(leaveTypes); return(View(DeatilsOfLeaveTypes_VM)); }
// GET: LeaveAllocation public ActionResult Index() { var leavetypes = _leaverepo.FindAll().ToList(); var mappedLeaveTypes = _mapper.Map <List <LeaveType>, List <DetailLeaveTypeVM> >(leavetypes); var model = new CreateLeaveAllocationVM { LeaveTypes = mappedLeaveTypes, NumberUpdated = 0 }; return(View(model)); }