public async Task <IActionResult> Edit(int id, [Bind("Id")] Review review) { if (id != review.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(review); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReviewExists(review.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(review)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Apelido,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("CourseID,Name")] Course course) { if (id != course.CourseID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(course); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CourseExists(course.CourseID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(course)); }
public async Task <IActionResult> Edit(int id, [Bind("StudentID,Name")] Student student) { if (id != student.StudentID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(student); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentExists(student.StudentID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(student)); }
public async Task <IActionResult> Edit(int id, [Bind("EstadoId,Nome,Uf")] Estado estado) { if (id != estado.EstadoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(estado); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EstadoExists(estado.EstadoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(estado)); }
public async Task <IActionResult> Edit(int id, [Bind("EnderecoId,Rua,NumeroDaCasa,Bairro,Cep")] Endereco endereco) { if (id != endereco.EnderecoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(endereco); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EnderecoExists(endereco.EnderecoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(endereco)); }
public async Task <IActionResult> Edit(int id, [Bind("ClienteId,Nome,Cpf,Telefone,Referencia")] Cliente cliente) { if (id != cliente.ClienteId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cliente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteExists(cliente.ClienteId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cliente)); }