コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,GroupName,Speaker,MatchClock,MatchProtocol,BoothDoor1,BoothDoor2,ShotStatistics,DiscJockey,Referee1,Referee2,LinesMan1,LinesMan2,Supervisor")] OfficialsGroup officialsGroup)
        {
            if (id != officialsGroup.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(officialsGroup);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OfficialsGroupExists(officialsGroup.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(officialsGroup));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Id,GroupName,Speaker,MatchClock,MatchProtocol,BoothDoor1,BoothDoor2,ShotStatistics,DiscJockey,Referee1,Referee2,LinesMan1,LinesMan2,Supervisor")] OfficialsGroup officialsGroup)
        {
            if (ModelState.IsValid)
            {
                _context.Add(officialsGroup);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(officialsGroup));
        }