예제 #1
0
 public override async Task <BaseReply> Alterar(TarefaModel request, ServerCallContext context)
 {
     return(await Task.FromResult(new BaseReply
     {
         Sucesso = _tarefaAppService.Alterar(_mapper.Map <TarefaViewModel>(request))
     }));
 }
예제 #2
0
        public IActionResult Put(Guid id, [FromBody] TarefaViewModel obj)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != obj.Id)
            {
                return(BadRequest());
            }

            try
            {
                _tarefaAppService.Alterar(obj);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ObjExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #3
0
        public IActionResult OnPost()
        {
            if (!ModelState.IsValid)
            {
                SelectProjetos    = new SelectList(_projetoAppService.Listar(), "Id", "Nome");
                SelectSistemas    = new SelectList(_sistemaAppService.Listar(), "Id", "Descricao");
                SelectWorkflows   = new SelectList(_workflowAppService.Listar(), "Id", "Nome");
                SelectTipoTarefas = new SelectList(_tipoTarefaAppService.Listar(), "Id", "Nome");

                return(Page());
            }

            _tarefaAppService.Alterar(Tarefa);

            return(RedirectToPage("Listar"));
        }