public async Task <ActionResult <SheriffAwayLocationDto> > AddSheriffLeave(SheriffLeaveDto sheriffLeaveDto)
        {
            var sheriffLeave        = sheriffLeaveDto.Adapt <SheriffLeave>();
            var createdSheriffLeave = await _service.AddSheriffLeave(sheriffLeave);

            return(Ok(createdSheriffLeave));
        }
Example #2
0
        public async Task <ActionResult <SheriffLeaveDto> > AddSheriffLeave(SheriffLeaveDto sheriffLeaveDto)
        {
            await CheckForAccessToSheriffByLocation(sheriffLeaveDto.SheriffId);

            var sheriffLeave        = sheriffLeaveDto.Adapt <SheriffLeave>();
            var createdSheriffLeave = await SheriffService.AddSheriffLeave(sheriffLeave);

            return(Ok(createdSheriffLeave.Adapt <SheriffLeaveDto>()));
        }
Example #3
0
        public async Task <ActionResult <SheriffLeaveDto> > AddSheriffLeave(SheriffLeaveDto sheriffLeaveDto, bool overrideConflicts = false)
        {
            await CheckForAccessToSheriffByLocation(sheriffLeaveDto.SheriffId);

            var sheriffLeave        = sheriffLeaveDto.Adapt <SheriffLeave>();
            var createdSheriffLeave = await SheriffService.AddSheriffLeave(DutyRosterService, ShiftService, sheriffLeave, overrideConflicts);

            return(Ok(createdSheriffLeave.Adapt <SheriffLeaveDto>()));
        }