Exemplo n.º 1
0
        public IActionResult AcceptLeaveOfAbsenceFromList(ListOfAbsencesViewModel viewModel)
        {
            var leaveOfAbsenceId = viewModel.LeaveOfAbsenceId;
            var userId           = Convert.ToInt32(Convert.ToString(User.Claims.Where(claim => claim.Type == "Id").Select(claim => claim.Value).SingleOrDefault()));;

            _shiftLogic.AcceptLeaveOfAbsence(leaveOfAbsenceId, userId);
            return(RedirectToAction("Index", "Home"));
        }
Exemplo n.º 2
0
        public IActionResult ListOfAbsences()
        {
            var viewModel = new ListOfAbsencesViewModel();
            var userId    = Convert.ToInt32(Convert.ToString(User.Claims.Where(claim => claim.Type == "Id").Select(claim => claim.Value).SingleOrDefault()));

            viewModel.LeaveOfAbsences = _shiftLogic.GetLeaveOfAbsences(userId);
            foreach (var item in viewModel.LeaveOfAbsences)
            {
                item.Shift            = _shiftLogic.GetShiftById(item.ShiftId);
                item.Shift.Department = _departmentLogic.GetDepartmentById(item.Shift.DepartmentId);
                item.Shift.Account    = _accountLogic.GetAccountByUserId(item.Shift.UserId);
            }
            return(PartialView(viewModel));
        }