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