public async Task <bool> SetViolation(ViolationDto violationDto, ClaimsPrincipal user) { Violation violation = _mapper.Map <ViolationDto, Violation>(violationDto); User policeman = await _userManager.FindByEmailFromClaimsPrincipals(user); return(await _policeService.SetViolation(violation, policeman)); }
public async Task <PopularResult <string> > UpdateAsync(ViolationDto dto) { var result = new PopularResult <string>(); dto.Vehicle = null; var violation = ObjectMapper.Map <ViolationDto, ViolationEntity>(dto); await _violationRepository.UpdateAsync(violation); result.Success("更新成功"); return(result); }
public async Task <PopularResult <string> > InsertAsync(ViolationDto dto) { var result = new PopularResult <string>(); var entity = ObjectMapper.Map <ViolationDto, ViolationEntity>(dto); var violation = await _violationRepository.InsertAsync(entity); if (violation == null) { result.Failed("添加失败"); return(result); } result.Success("添加成功"); return(result); }
public async Task <ActionResult <bool> > SetViolation(ViolationDto violationDto) { return(await _policePresentation.SetViolation(violationDto, HttpContext.User)); }
public async Task <PopularResult <string> > UpdateAsync([FromBody] ViolationDto dto) { return(await _violationService.UpdateAsync(dto)); }
public async Task <PopularResult <string> > InsertAsync([FromBody] ViolationDto dto) { dto.Creator = LoginUser.Id; dto.CreateTime = LoginUser.SysteDate; return(await _violationService.InsertAsync(dto)); }