示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("PfeID,Titre,Mention,Note")] Pfe pfe)
        {
            if (id != pfe.PfeID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pfe);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PfeExists(pfe.PfeID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pfe));
        }
        public async Task <IActionResult> Edit(int id, [Bind("EtudiantID,Nom,Prenom,Email,Tel,DateNaissance")] Etudiant etudiant)
        {
            if (id != etudiant.EtudiantID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(etudiant);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EtudiantExists(etudiant.EtudiantID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(etudiant));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ProfesseurID,NomProf,PrenomProf,HireDate")] Professeur professeur)
        {
            if (id != professeur.ProfesseurID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(professeur);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProfesseurExists(professeur.ProfesseurID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(professeur));
        }
示例#4
0
        public async Task <IActionResult> Edit(int id, [Bind("DepartementID,Name,Budget,StartDate")] Departement departement)
        {
            if (id != departement.DepartementID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(departement);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DepartementExists(departement.DepartementID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(departement));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PlanningID,DateSoutenance,Salle")] Planning planning)
        {
            if (id != planning.PlanningID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(planning);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlanningExists(planning.PlanningID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(planning));
        }