public async Task <IActionResult> Create([Bind("Id,Nom")] Poste poste)
        {
            if (ModelState.IsValid)
            {
                _context.Add(poste);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(poste));
        }
        public async Task <IActionResult> Create([Bind("Id,Nom,Description,Lieux")] Tournoi tournoi)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tournoi);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tournoi));
        }
        public async Task <IActionResult> Create([Bind("Id,Prenom,Nom,Pseudo,Email,DateNaissance,Sexe")] Personne personne)
        {
            if (ModelState.IsValid)
            {
                _context.Add(personne);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(personne));
        }
Example #4
0
        public async Task <IActionResult> Create([Bind("Id,TournoiId,JeuxId,Nom")] Championnat championnat)
        {
            if (ModelState.IsValid)
            {
                _context.Add(championnat);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["JeuxId"]    = new SelectList(_context.Set <Jeux>(), "Id", "Nom", championnat.JeuxId);
            ViewData["TournoiId"] = new SelectList(_context.Set <Tournoi>(), "Id", "Description", championnat.TournoiId);
            return(View(championnat));
        }
        public async Task <IActionResult> Create([Bind("Id,ChampionnatId,PersonneId,Equipe")] Participant participant)
        {
            if (ModelState.IsValid)
            {
                _context.Add(participant);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ChampionnatId"] = new SelectList(_context.Championnat, "Id", "Nom", participant.ChampionnatId);
            ViewData["PersonneId"]    = new SelectList(_context.Set <Personne>(), "Id", "PrenomNom", participant.PersonneId);
            return(View(participant));
        }
Example #6
0
        public async Task <IActionResult> Create([Bind("Id,TournoiId,PersonneId,PosteId")] Organisation organisation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(organisation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PersonneId"] = new SelectList(_context.Set <Personne>(), "Id", "PrenomNom", organisation.PersonneId);
            ViewData["PosteId"]    = new SelectList(_context.Set <Poste>(), "Id", "Nom", organisation.PosteId);
            ViewData["TournoiId"]  = new SelectList(_context.Set <Tournoi>(), "Id", "Description", organisation.TournoiId);
            return(View(organisation));
        }
Example #7
0
        public async Task <IActionResult> Create([Bind("Id,ChampionnatId,Personne1Id,Personne2Id,Score1,Score2,DateDebut")] Resultat resultat)
        {
            if (ModelState.IsValid)
            {
                _context.Add(resultat);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ChampionnatId"] = new SelectList(_context.Championnat, "Id", "Nom", resultat.ChampionnatId);
            ViewData["Personne1Id"]   = new SelectList(_context.Personne, "Id", "PrenomNom", resultat.Personne1Id);
            ViewData["Personne2Id"]   = new SelectList(_context.Personne, "Id", "PrenomNom", resultat.Personne2Id);
            return(View(resultat));
        }