예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,Title,Location,Date,DistanceLength,DistanceMetric,CompetitionCode,TypeCode")] RunEvent runEvent)
        {
            if (ModelState.IsValid)
            {
                _context.Add(runEvent);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(runEvent));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,AmNumber,Active")] ClubMember clubMember)
        {
            if (ModelState.IsValid)
            {
                _context.Add(clubMember);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(clubMember));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,AthleteId,EventId,Result")] RaceMemberResult raceMemberResult)
        {
            if (ModelState.IsValid)
            {
                _context.Add(raceMemberResult);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AthleteId"] = new SelectList(_context.ClubMember, "Id", "Id", raceMemberResult.AthleteId);
            ViewData["EventId"]   = new SelectList(_context.RunEvent, "Id", "CompetitionCode", raceMemberResult.EventId);
            return(View(raceMemberResult));
        }