예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }