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>()));
        }