示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Email,Password")] UserType user)
        {
            if (id != user.Id)
            {
                return(NotFound());
            }

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

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(mapModel);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MapModelExists(mapModel.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(mapModel));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PlayerId,PlayerName,Email,JersyNo,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.teams, "TeamId", "TeamId", player.TeamId);
            return(View(player));
        }
示例#4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Sourname,Position,NationalId,ClubId,GoalsNumber,AssistsNumber,DateOfBirth,MatchesNumber")] Footboller footboller)
        {
            if (id != footboller.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(footboller);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FootbollerExists(footboller.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClubId"]     = new SelectList(_context.Clubs, "Id", "DateOfBirth", footboller.ClubId);
            ViewData["NationalId"] = new SelectList(_context.Nationals, "Id", "Name", footboller.NationalId);
            return(View(footboller));
        }
示例#5
0
        public async Task <IActionResult> Edit(int id, [Bind("ChampionshipCommandID,ChampionshipID,CommandID")] ChampionshipCommand championshipCommand)
        {
            if (id != championshipCommand.ChampionshipCommandID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(championshipCommand);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ChampionshipCommandExists(championshipCommand.ChampionshipCommandID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ChampionshipID"] = new SelectList(_context.Championships, "ID", "ID", championshipCommand.ChampionshipID);
            ViewData["CommandID"]      = new SelectList(_context.Commands, "CommandID", "CommandID", championshipCommand.CommandID);
            return(View(championshipCommand));
        }
示例#6
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,ClubsNumber")] Cup cup)
        {
            if (id != cup.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cup);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CupExists(cup.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cup));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,PlayersNumber,DateOfBirth,TrophiesNumber,NationalId,PositionInLeague,CupId,LeagueId,EuroCupId")] Club club)
        {
            if (id != club.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(club);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClubExists(club.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CupId"]      = new SelectList(_context.Cups, "Id", "Name", club.CupId);
            ViewData["EuroCupId"]  = new SelectList(_context.EuroCups, "Id", "Name", club.EuroCupId);
            ViewData["LeagueId"]   = new SelectList(_context.Leagues, "Id", "Name", club.LeagueId);
            ViewData["NationalId"] = new SelectList(_context.Nationals, "Id", "Name", club.NationalId);
            return(View(club));
        }
示例#8
0
        public async Task <IActionResult> Edit(int id, [Bind("CommandID,PlayerID,Country,Name")] Command command)
        {
            if (id != command.CommandID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(command);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CommandExists(command.CommandID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(command));
        }
示例#9
0
        public async Task <IActionResult> Edit(int id, [Bind("SponsorId,Name")] Sponsor sponsor)
        {
            if (id != sponsor.SponsorId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sponsor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SponsorExists(sponsor.SponsorId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sponsor));
        }
示例#10
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Age,LastName,FirstName,Command")] Player player)
        {
            if (id != player.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(player);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlayerExists(player.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(player));
        }
        public async Task <IActionResult> Edit(int id, [Bind("TeamId,TeamName,FoundationDate")] 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)));
            }
            return(View(team));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Rank,Player,Team,Position,Age,Gamesplayed,Passescompleted,Fantasypoints,Pprscoring,Posrank,Week1,Week2,Week3,Week4,Week5,Week6,Week7,Week8,Week9,Week10,Week11,Week12,Week13,Week14,Week15,Week16,Week17")] Playersstatistics playersstatistics)
        {
            if (id != playersstatistics.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(playersstatistics);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlayersstatisticsExists(playersstatistics.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(playersstatistics));
        }
示例#13
0
        public async Task <IActionResult> Edit(int id, [Bind("DataProvedeniya,Result,CommandID,MatchID")] 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)));
            }
            return(View(match));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,TrophiesNumber,NationalCupId")] National national)
        {
            if (id != national.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(national);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!NationalExists(national.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["NationalCupId"] = new SelectList(_context.NationalCups, "Id", "Name", national.NationalCupId);
            return(View(national));
        }