コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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));
        }