Exemplo n.º 1
0
        public OutputBase DeleteLeaveRequest(DeleteLeaveRequestInput input)
        {
            var request = _leaveRequestRepository.Get(input.LeaveRequestId);

            if (request.EmployeeId != GetCurrentUserId() &&
                !IsGranted(AppPermissions.Pages_Leave_LeaveRequest_DeleteAny))
            {
                return(new OutputBase {
                    Message = "You cannot delete a request that is not yours", Success = false
                });
            }
            _leaveRequestRepository.Delete(request);
            return(new OutputBase {
                Message = "Request deleted", Success = true
            });
        }
Exemplo n.º 2
0
 public List <LeaveRequest> Get()
 {
     return(iLeaveRequestRepository.Get());
 }