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));
        }
Пример #2
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));
        }
Пример #5
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));
        }