Exemplo n.º 1
0
        public async Task <ActionResult <SheriffTrainingDto> > AddSheriffTraining(SheriffTrainingDto sheriffTrainingDto)
        {
            await CheckForAccessToSheriffByLocation(sheriffTrainingDto.SheriffId);

            var sheriffTraining        = sheriffTrainingDto.Adapt <SheriffTraining>();
            var createdSheriffTraining = await SheriffService.AddSheriffTraining(sheriffTraining);

            return(Ok(createdSheriffTraining.Adapt <SheriffTrainingDto>()));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <SheriffTrainingDto> > AddSheriffTraining(SheriffTrainingDto sheriffTrainingDto, bool overrideConflicts = false)
        {
            await CheckForAccessToSheriffByLocation(sheriffTrainingDto.SheriffId);

            var sheriffTraining        = sheriffTrainingDto.Adapt <SheriffTraining>();
            var createdSheriffTraining = await SheriffService.AddSheriffTraining(DutyRosterService, ShiftService, sheriffTraining, overrideConflicts);

            return(Ok(createdSheriffTraining.Adapt <SheriffTrainingDto>()));
        }