public async Task <IActionResult> Create([Bind("GradeId,GradeName,AgeGrade")] Grade grade) { if (ModelState.IsValid) { _context.Add(grade); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(grade)); }
public async Task <IActionResult> Create([Bind("TeamId,TeamName,Age,Phone")] Teams teams) { if (ModelState.IsValid) { _context.Add(teams); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(teams)); }
public async Task <IActionResult> Create([Bind("EnrolId,TeamId,GradeId")] Enrolment enrolment) { if (ModelState.IsValid) { _context.Add(enrolment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GradeId"] = new SelectList(_context.Grade, "GradeId", "GradeId", enrolment.GradeId); ViewData["TeamId"] = new SelectList(_context.Teams, "TeamId", "TeamId", enrolment.TeamId); return(View(enrolment)); }