示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("PlayerID,PlayerFname,PlayerLname,DoB,Address")] 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)));
            }
            return(View(player));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("EventID,Eventname,StartDate,EndDate,EventDuration")] Event @event)
        {
            if (id != @event.EventID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(@event);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EventExists(@event.EventID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(@event));
        }
示例#3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,PlayerID,EventID")] Ranking ranking)
        {
            if (id != ranking.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ranking);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RankingExists(ranking.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EventID"]  = new SelectList(_context.Event, "EventID", "EventID", ranking.EventID);
            ViewData["PlayerID"] = new SelectList(_context.Player, "PlayerID", "PlayerID", ranking.PlayerID);
            return(View(ranking));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Fixture_Id,vs_Team,Country,Date,Ground_Name")] Fixture fixture)
        {
            if (id != fixture.Fixture_Id)
            {
                return(NotFound());
            }

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