public IActionResult Put(Guid id, [FromBody] RecursoTarefaViewModel obj) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != obj.Id) { return(BadRequest()); } try { _recursoTarefaAppService.Alterar(obj); } catch (DbUpdateConcurrencyException) { if (!ObjExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public override async Task <BaseReply> Alterar(RecursoTarefaModel request, ServerCallContext context) { return(await Task.FromResult(new BaseReply { Sucesso = _recursoTarefaAppService.Alterar(_mapper.Map <RecursoTarefaViewModel>(request)) })); }
public IActionResult OnPost() { if (!ModelState.IsValid) { Tarefa = _tarefaAppService.Consultar(RecursoTarefa.IdTarefa); SelectRecursos = new SelectList(_recursoProjetoAppService.ListarPorProjeto(Tarefa.IdProjeto), "Recurso.Id", "Recurso.Nome"); return(Page()); } _recursoTarefaAppService.Alterar(RecursoTarefa); return(RedirectToPage("Listar", new { idTarefa = RecursoTarefa.IdTarefa })); }