public async Task <IActionResult> Create([Bind("Id,Bezeichnung")] Klasse klasse) { if (ModelState.IsValid) { _context.Add(klasse); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(klasse)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Lehrer lehrer) { if (ModelState.IsValid) { _context.Add(lehrer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(lehrer)); }
public async Task <IActionResult> Create([Bind("Id,Name,KlasseId")] Schueler schueler) { if (ModelState.IsValid) { _context.Add(schueler); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["KlasseId"] = new SelectList(_context.Klasse, "Id", "Id", schueler.KlasseId); return(View(schueler)); }
public async Task <IActionResult> Create([Bind("Id,Wochentag,Stunde,Fach,KlasseId")] Stunden stunden) { if (ModelState.IsValid) { _context.Add(stunden); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["KlasseId"] = new SelectList(_context.Klasse, "Id", "Id", stunden.KlasseId); return(View(stunden)); }