public async Task <IActionResult> Edit(int id, [Bind("Id,Nome,DataNascimento,CPF,Telefone,Email")] Usuario usuario) { if (id != usuario.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(usuario); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioExists(usuario.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(usuario)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nota,Comentário")] FeedBack feedBack) { if (id != feedBack.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(feedBack); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FeedBackExists(feedBack.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(feedBack)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Usuario,Tecnico,Descricao")] Denunciar denunciar) { if (id != denunciar.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(denunciar); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DenunciarExists(denunciar.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(denunciar)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Endereco,TipoServico,CategoriaServico,DescricaoProblema,Status,DataSolicitacao")] OrdemDeServico ordemDeServico) { if (id != ordemDeServico.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ordemDeServico); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrdemDeServicoExists(ordemDeServico.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ordemDeServico)); }