public async Task <int> Handle(UpdateCanalVendaCommand request, CancellationToken cancellationToken) { var canalVenda = await _context.Ouvidoria_CanaisVenda.FindAsync(request.CanalVenda.Id); _mapper.Map <CanalVendaDTO, CanalVenda>(request.CanalVenda, canalVenda); return(await _context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(UpdateAssuntoCommand request, CancellationToken cancellationToken) { var assunto = await _context.Ouvidoria_Assuntos.FindAsync(request.Assunto.Id); _mapper.Map <AssuntoDTO, Assunto>(request.Assunto, assunto); return(await _context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(DeleteStatus request, CancellationToken cancellationToken) { var status = new Status(); _context.Ouvidoria_Status.Remove(status); return(await _context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(DeleteAssuntoCommand request, CancellationToken cancellationToken) { var assunto = await _context.Ouvidoria_Assuntos.FindAsync(request.Id); _context.Ouvidoria_Assuntos.Remove(assunto); return(await _context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(DeleteCanalVendaCommand request, CancellationToken cancellationToken) { var canalVenda = await _context.Ouvidoria_CanaisVenda.FindAsync(request.Id); _context.Ouvidoria_CanaisVenda.Remove(canalVenda); return(await _context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(UpdateCanalReclamacaoCommand request, CancellationToken cancellationToken) { var canalReclamacao = await _context.Ouvidoria_CanaisReclamacoes.FindAsync(request.CanalReclamacao.Id); _mapper.Map <CanalReclamacaoDTO, CanalReclamacao>(request.CanalReclamacao, canalReclamacao); return(await _context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(UpdateMotivoCommand request, CancellationToken cancellationToken) { var motivo = await context.Ouvidoria_Motivos.FindAsync(request.Motivo.Id); mapper.Map <MotivoDTO, Motivo>(request.Motivo, motivo); return(await context.SaveChangesAsync(cancellationToken)); }
public async Task <Unit> Handle(UpdateStatusCommand request, CancellationToken cancellationToken) { var status = await _context.Ouvidoria_Status.FindAsync(request.Status.Id); _mapper.Map <StatusDTO, Status>(request.Status, status); await _context.SaveChangesAsync(cancellationToken); return(Unit.Value); }
public async Task <Unit> Handle(DeleteMotivoCommand request, CancellationToken cancellationToken) { var motivo = await _context.Ouvidoria_Motivos.FindAsync(request.Id); _context.Ouvidoria_Motivos.Remove(motivo); await _context.SaveChangesAsync(cancellationToken); return(Unit.Value); }
public async Task <Unit> Handle(DeleteCanalReclamacaoCommand request, CancellationToken cancellationToken) { var canalReclamacao = await _context.Ouvidoria_CanaisReclamacoes.FindAsync(request.Id); _context.Ouvidoria_CanaisReclamacoes.Remove(canalReclamacao); await _context.SaveChangesAsync(cancellationToken); return(Unit.Value); }
public async Task <Unit> Handle(ResetPasswordCommand request, CancellationToken cancellationToken) { var user = await _context.Usuarios.FindAsync(request.Username); user.Password = Hash.hashPassword("AtlasOmint"); await _context.SaveChangesAsync(cancellationToken); return(Unit.Value); }
public async Task <string> Handle(RegisterUserCommand request, CancellationToken cancellationToken) { var entity = new User { Username = request.Username.ToUpper(), Password = Hash.hashPassword(request.Password), Email = request.Email, Ativo = 'A' }; _context.Usuarios.Add(entity); await _context.SaveChangesAsync(cancellationToken); return(entity.Username); }
public async Task <int> Handle(CreateCanalVendaCommand request, CancellationToken cancellationToken) { _context.Ouvidoria_CanaisVenda.Add(_mapper.Map <CanalVenda>(request.CanalVenda)); return(await _context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(PostCanalReclamacaoCommand request, CancellationToken cancellationToken) { _context.Ouvidoria_CanaisReclamacoes.Add(_mapper.Map <CanalReclamacao>(request.CanalReclamacao)); return(await _context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(CreateAssuntoCommand request, CancellationToken cancellationToken) { _context.Ouvidoria_Assuntos.Add(_mapper.Map <Assunto>(request.Assunto)); return(await _context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(CreateMotivoCommand request, CancellationToken cancellationToken) { context.Ouvidoria_Motivos.Add(mapper.Map <Motivo>(request.Motivo)); return(await context.SaveChangesAsync(cancellationToken)); }
public async Task <int> Handle(CreateStatus request, CancellationToken cancellationToken) { _context.Ouvidoria_Status.Add(_mapper.Map <Status>(request.Status)); return(await _context.SaveChangesAsync(cancellationToken)); }