public async Task <IActionResult> Edit(int id, [Bind("DetailId,NomDetail,DescriptionDetail,BatimentId")] DetailArchitectural detailArchitectural) { if (id != detailArchitectural.DetailId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(detailArchitectural); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DetailArchitecturalExists(detailArchitectural.DetailId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BatimentId"] = new SelectList(_context.Batiments, "BatimentId", "NomBatiment", detailArchitectural.BatimentId); return(View(detailArchitectural)); }
public async Task <IActionResult> Edit(int id, [Bind("BatimentId,NomBatiment,URLPhoto,TypeBatiment,DescriptionBatiment,Longitude,Latitude,MonumentHistorique,DateConstruction,VilleId")] Batiment batiment) { if (id != batiment.BatimentId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(batiment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BatimentExists(batiment.BatimentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["VilleId"] = new SelectList(_context.Villes, "VilleId", "NomVille", batiment.VilleId); return(View(batiment)); }
public async Task <IActionResult> Edit(int id, [Bind("CategorieId,NomCategorie")] Categorie categorie) { if (id != categorie.CategorieId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(categorie); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategorieExists(categorie.CategorieId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(categorie)); }
public async Task <IActionResult> Edit(int id, [Bind("IdListe,TitreListe")] ListeDeVoyage listeDeVoyage) { if (id != listeDeVoyage.IdListe) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(listeDeVoyage); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ListeDeVoyageExists(listeDeVoyage.IdListe)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(listeDeVoyage)); }
public async Task <IActionResult> Edit(int id, [Bind("VilleId,NomVille,NomRegion,NumDepartement,NomDepartement")] Ville ville) { if (id != ville.VilleId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ville); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VilleExists(ville.VilleId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ville)); }