public async Task <IActionResult> Edit(int id, [Bind("Id,Nom")] Poste poste)
        {
            if (id != poste.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(poste);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PosteExists(poste.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(poste));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,TournoiId,JeuxId,Nom")] Championnat championnat)
        {
            if (id != championnat.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(championnat);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ChampionnatExists(championnat.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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> Edit(int id, [Bind("Id,Nom,Description,Lieux")] Tournoi tournoi)
        {
            if (id != tournoi.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tournoi);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TournoiExists(tournoi.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tournoi));
        }
示例#4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,TournoiId,PersonneId,PosteId")] Organisation organisation)
        {
            if (id != organisation.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(organisation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrganisationExists(organisation.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,ChampionnatId,PersonneId,Equipe")] Participant participant)
        {
            if (id != participant.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(participant);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ParticipantExists(participant.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
示例#6
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ChampionnatId,Personne1Id,Personne2Id,Score1,Score2,DateDebut")] Resultat resultat)
        {
            if (id != resultat.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(resultat);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ResultatExists(resultat.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Prenom,Nom,Pseudo,Email,DateNaissance,Sexe")] Personne personne)
        {
            if (id != personne.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(personne);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonneExists(personne.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(personne));
        }