public async Task <IActionResult> Edit(int id, [Bind("IdClient,Nume,Adresa,Contact")] Clienti clienti) { if (id != clienti.IdClient) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(clienti); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientiExists(clienti.IdClient)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(clienti)); }
public async Task <IActionResult> Edit(string id, [Bind("nombre,disponible,cate")] Libro libro) { if (id != libro.nombre) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(libro); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LibroExists(libro.nombre)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["cate"] = new SelectList(_context.categorias, "cate", "cate", libro.cate); return(View(libro)); }
public async Task <IActionResult> Edit(int id, [Bind("IdAlquiler,Inicio,Fin,nombre,idUser")] Alquiler alquiler) { if (id != alquiler.IdAlquiler) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(alquiler); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AlquilerExists(alquiler.IdAlquiler)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["nombre"] = new SelectList(_context.libros, "nombre", "nombre", alquiler.nombre); ViewData["idUser"] = new SelectList(_context.usuarios, "IdUser", "IdUser", alquiler.idUser); return(View(alquiler)); }
public async Task <IActionResult> Edit(int id, [Bind("IdCarte,Titlu,Cod,Autor,Editura")] Carti carti) { if (id != carti.IdCarte) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(carti); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CartiExists(carti.IdCarte)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(carti)); }