public async Task <ActionResult <SheriffAwayLocationDto> > AddSheriffAwayLocation(SheriffAwayLocationDto sheriffAwayLocationDto)
        {
            var sheriffAwayLocation        = sheriffAwayLocationDto.Adapt <SheriffAwayLocation>();
            var createdSheriffAwayLocation = await _service.AddSheriffAwayLocation(sheriffAwayLocation);

            return(Ok(createdSheriffAwayLocation));
        }
示例#2
0
        public async Task <ActionResult <SheriffAwayLocationDto> > AddSheriffAwayLocation(SheriffAwayLocationDto sheriffAwayLocationDto)
        {
            await CheckForAccessToSheriffByLocation(sheriffAwayLocationDto.SheriffId);

            var sheriffAwayLocation        = sheriffAwayLocationDto.Adapt <SheriffAwayLocation>();
            var createdSheriffAwayLocation = await SheriffService.AddSheriffAwayLocation(sheriffAwayLocation);

            return(Ok(createdSheriffAwayLocation.Adapt <SheriffAwayLocationDto>()));
        }
示例#3
0
        public async Task <ActionResult <SheriffAwayLocationDto> > AddSheriffAwayLocation(SheriffAwayLocationDto sheriffAwayLocationDto, bool overrideConflicts = false)
        {
            await CheckForAccessToSheriffByLocation(sheriffAwayLocationDto.SheriffId);

            var sheriffAwayLocation        = sheriffAwayLocationDto.Adapt <SheriffAwayLocation>();
            var createdSheriffAwayLocation = await SheriffService.AddSheriffAwayLocation(DutyRosterService, ShiftService, sheriffAwayLocation, overrideConflicts);

            return(Ok(createdSheriffAwayLocation.Adapt <SheriffAwayLocationDto>()));
        }