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());
        }
Beispiel #2
0
 public override async Task <BaseReply> Alterar(ImpedimentoTarefaModel request, ServerCallContext context)
 {
     return(await Task.FromResult(new BaseReply
     {
         Sucesso = _impedimentoTarefaAppService.Alterar(_mapper.Map <ImpedimentoTarefaViewModel>(request))
     }));
 }
Beispiel #3
0
        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 }));
        }