Beispiel #1
0
        public async Task <IActionResult> Edit(long id, [Bind("IdSeance,Jourseance,Heuredebut,Heurefin,ClasseId,ProfesseurId,IdSalle")] Model.Seance seance)
        {
            if (id != seance.IdSeance)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(seance);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SeanceExists(seance.IdSeance))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(seance));
        }
        public async Task <IActionResult> Create([Bind("Dateseance,Heuredebut,Heurefin,ClasseId,ProfesseurId,SalleId")] Model.Seance Seance)
        {
            if (ModelState.IsValid)
            {
                _context.Add(Seance);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(Seance));
        }