public async Task <IActionResult> Create([Bind("ID,name,phone,Group")] KarateKid karateKid) { if (ModelState.IsValid) { _context.Add(karateKid); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(karateKid)); }
public async Task <IActionResult> Create([Bind("ID,ActualDate,ChildName,GroupName,TrainingDay")] DateModel dateModel) { if (ModelState.IsValid) { _context.Add(dateModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dateModel)); }
public async Task <IActionResult> Create([Bind("ID,groupName,TrainingDay,TrainingTime")] Groups groups) { if (ModelState.IsValid) { _context.Add(groups); await _context.SaveChangesAsync(); groups.AddNewGroupToList(groups.groupName); return(RedirectToAction(nameof(Index))); } return(View(groups)); }