示例#1
0
        // GET: LeaveAllocationController/Details/5
        public async Task <ActionResult> Details(string id)
        {
            var employeeData = _mapper.Map <EmployeeVM>(await _userManager.FindByIdAsync(id));
            var allocation   = _mapper.Map <List <LeaveAllocationVM> >(await _leaveAllocationRepo.getLeaveAllocationDetail(id));
            var model        = new viewLeaveAllocationVM
            {
                employee = employeeData,
                // employeeId = id,
                leaveAllocation = allocation
            };

            return(View(model));
        }
示例#2
0
        public async Task <ActionResult> MyLeave(int id)
        {
            var emp = await _userManager.GetUserAsync(User);

            var empId      = emp.Id;
            var allocation = await _leavaAllocRepo.getLeaveAllocationDetail(empId);

            var leaveRequests = await _leaveRequestrepo.GetAllrequestforEmployeeId(empId);

            var allocationModel   = _mapper.Map <List <LeaveAllocationVM> >(allocation);
            var leaveRequestModel = _mapper.Map <List <LeaveRequestVM> >(leaveRequests);

            var model = new employeeLreaveRequestVM
            {
                LeaveAllocation = allocationModel,
                LeaveType       = leaveRequestModel
            };

            return(View(model));
        }