Пример #1
0
        public async Task <IActionResult> PutVille(int id, Ville ville)
        {
            if (id != ville.VilleId)
            {
                return(BadRequest());
            }

            _context.Entry(ville).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VilleExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutDetailArchitectural(int id, DetailArchitectural detailArchitectural)
        {
            if (id != detailArchitectural.DetailId)
            {
                return(BadRequest());
            }

            _context.Entry(detailArchitectural).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DetailArchitecturalExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> Create([Bind("CategorieId,NomCategorie")] Categorie categorie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(categorie);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(categorie));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("VilleId,NomVille,NomRegion,NumDepartement,NomDepartement")] Ville ville)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ville);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ville));
        }
        public async Task <IActionResult> Create([Bind("DetailId,NomDetail,DescriptionDetail,BatimentId")] DetailArchitectural detailArchitectural)
        {
            if (ModelState.IsValid)
            {
                _context.Add(detailArchitectural);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BatimentId"] = new SelectList(_context.Batiments, "BatimentId", "NomBatiment", detailArchitectural.BatimentId);
            return(View(detailArchitectural));
        }
        public async Task <IActionResult> Create([Bind("BatimentId,NomBatiment,URLPhoto,TypeBatiment,DescriptionBatiment,Longitude,Latitude,MonumentHistorique,DateConstruction,VilleId")] Batiment batiment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(batiment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["VilleId"] = new SelectList(_context.Villes, "VilleId", "NomVille", batiment.VilleId);
            return(View(batiment));
        }
Пример #7
0
        public async Task <IActionResult> Create([Bind("IdListe,TitreListe,VilleId,URLBlason,UtilisateurId")] ListeDeVoyage listeDeVoyage)
        {
            if (ModelState.IsValid)
            {
                _context.Add(listeDeVoyage);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["VilleId"] = new SelectList(_context.Villes, "VilleId", "NomVille", listeDeVoyage.VilleId);

            return(View(listeDeVoyage));
        }