public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Apellido,Email,Contacto,Direccion")] Cliente cliente) { if (id != cliente.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cliente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteExists(cliente.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cliente)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Apellido,Contacto,IdCasoSelect")] Caso caso) { if (id != caso.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(caso); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CasoExists(caso.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdCasoSelect"] = new SelectList(_context.Casoselect, "Id", "Nombre", caso.IdCasoSelect); return(View(caso)); }