コード例 #1
0
        /// <summary>
        /// GET: Retrieving the leave allocations for an employee by id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(string id)
        {
            var employee    = _mapper.Map <EmployeeViewModel>(_userManager.FindByIdAsync(id).Result);
            var allocations = _mapper.Map <List <LeaveAllocationViewModel> >(_leaveAllocationRepo.GetLeaveAllocations(id));

            var model = new ViewAllocationsViewModel
            {
                Employee         = employee,
                LeaveAllocations = allocations
            };

            return(View(model));
        }
コード例 #2
0
        // GET: LeaveAllocation/Details/5
        public ActionResult Details(string id)
        {
            var employee    = _mapper.Map <EmployeeVM>(_userManager.FindByIdAsync(id).Result);
            var period      = DateTime.Now.Year;
            var allocations = _mapper.Map <List <LeaveAllocationVM> >(_repo.GetLeaveAllocations(id));
            var model       = new ViewAllocationVM
            {
                Employee         = employee,
                LeaveAllocations = allocations
            };

            return(View(model));
        }