Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("TeamId,TeamName,CoachId,TeamRate,LeagueId")] Team team)
        {
            if (id != team.TeamId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(team);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TeamExists(team.TeamId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LeagueId"] = new SelectList(_context.League, "LeagueId", "LeagueId", team.LeagueId);
            return(View(team));
        }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("CoachId,CoachName,Rate")] Coach coach)
        {
            if (id != coach.CoachId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(coach);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CoachExists(coach.CoachId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CoachId"] = new SelectList(_context.Team, "TeamId", "TeamId", coach.CoachId);
            return(View(coach));
        }
Пример #3
0
        public async Task <IActionResult> Edit(int id, [Bind("LeagueId,LeaugueName")] League league)
        {
            if (id != league.LeagueId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(league);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LeagueExists(league.LeagueId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(league));
        }
Пример #4
0
        public async Task <IActionResult> Edit(int id, [Bind("MatchId,Team_homeId,Team_guestId")] Match match)
        {
            if (id != match.MatchId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(match);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MatchExists(match.MatchId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Team_guestId"] = new SelectList(_context.Team, "TeamId", "TeamId", match.Team_guestId);
            ViewData["Team_homeId"]  = new SelectList(_context.Team, "TeamId", "TeamId", match.Team_homeId);
            return(View(match));
        }
Пример #5
0
 public async Task <IActionResult> Edit([Bind("UserMatchId,MatchId,UserId")] UserMatch userMatch)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(userMatch);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!UserMatchExists(userMatch.MatchId))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["MatchId"] = new SelectList(_context.Match, "MatchId", "MatchId", userMatch.MatchId);
     ViewData["UserId"]  = new SelectList(_context.User, "UserId", "UserId", userMatch.UserId);
     return(View(userMatch));
 }
Пример #6
0
        public async Task <IActionResult> Edit(int id, [Bind("ScoreStatisticId,Score,Numberofpenalty,NumberofyellowCard,Numberofredcard,MatchId")] ScoreStatistic scoreStatistic)
        {
            if (id != scoreStatistic.ScoreStatisticId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(scoreStatistic);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ScoreStatisticExists(scoreStatistic.ScoreStatisticId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MatchId"] = new SelectList(_context.Match, "MatchId", "MatchId", scoreStatistic.MatchId);
            return(View(scoreStatistic));
        }
Пример #7
0
        public async Task <IActionResult> Edit(int id, [Bind("PlayerId,PlayerName,Offence,Deffence,TeamId")] Player player)
        {
            if (id != player.PlayerId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(player);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlayerExists(player.PlayerId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TeamId"] = new SelectList(_context.Team, "TeamId", "TeamId", player.TeamId);
            return(View(player));
        }
Пример #8
0
 public void Edit(League League)
 {
     _context.Update(League);
 }
Пример #9
0
 public void Edit(Coach Coach)
 {
     _context.Update(Coach);
 }
Пример #10
0
 public void Edit(Match Match)
 {
     _context.Update(Match);
 }
Пример #11
0
 public void Edit(Team player)
 {
     _context.Update(player);
 }
Пример #12
0
 public void Edit(User User)
 {
     _context.Update(User);
 }
Пример #13
0
 public void Edit(Player player)
 {
     _context.Update(player);
 }
Пример #14
0
 public void Edit(ScoreStatistic ScoreStatistic)
 {
     _context.Update(ScoreStatistic);
 }