예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Email,PhoneNumber")] Person person)
        {
            if (id != person.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(person);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonExists(person.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(person));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,TeamName")] Team team)
        {
            if (id != team.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(team);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TeamExists(team.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(team));
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,SeriesName,MatchLength,RefFee,LMFee")] Series series)
        {
            if (id != series.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(series);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SeriesExists(series.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(series));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,MatchDate,Day,TeamAway,ScoreTeamHome,ScoreTeamAway,PersonId,SeriesId,ArenaId,TeamId")] Matches matches)
        {
            if (id != matches.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(matches);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MatchesExists(matches.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ArenaId"]  = new SelectList(_context.Set <Arena>(), "Id", "Id", matches.ArenaId);
            ViewData["SeriesId"] = new SelectList(_context.Set <Series>(), "Id", "Id", matches.SeriesId);
            ViewData["TeamId"]   = new SelectList(_context.Set <Team>(), "Id", "Id", matches.TeamId);
            return(View(matches));
        }