Exemple #1
0
        // GET: LeaveTypesController
        public ActionResult Index()
        {
            var leavetypes = _repo.Findall().ToList();
            var model      = _mapper.Map <List <LeaveType>, List <LeaveTypeVM> >(leavetypes);

            return(View(model));
        }
        // GET: LeaveRequestController1/Create
        public ActionResult Create()
        {
            var leavetypes     = _LeaveTypeRepo.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: LeaveAllocationController
        public ActionResult Index()
        {
            var leavetypes = _Typerepo.Findall().ToList();

            var mappedLeaveType = _mapper.Map <List <LeaveType>, List <LeaveTypeVM> >(leavetypes);

            var model = new CreateLeaveAllocationVM
            {
                LeaveTypes    = mappedLeaveType,
                NumberUpdated = 0
            };

            return(View(model));
        }