public IActionResult Put(Guid id, [FromBody] ImpedimentoTarefaViewModel obj) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != obj.Id) { return(BadRequest()); } try { _impedimentoTarefaAppService.Alterar(obj); } catch (Exception) { if (!ObjExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public override async Task <BaseReply> Alterar(ImpedimentoTarefaModel request, ServerCallContext context) { return(await Task.FromResult(new BaseReply { Sucesso = _impedimentoTarefaAppService.Alterar(_mapper.Map <ImpedimentoTarefaViewModel>(request)) })); }
public IActionResult OnPost() { if (!ModelState.IsValid) { SelectImpedimentos = new SelectList(_impedimentoAppService.Listar(), "Id", "Nome"); return(Page()); } _impedimentoTarefaAppService.Alterar(ImpedimentoTarefa); return(RedirectToPage("Listar", new { idTarefa = ImpedimentoTarefa.IdTarefa })); }