public async Task <IActionResult> Edit(int id, [Bind("Id_curso,nombre,lenguaje_programacion")] Cursos cursos)
        {
            if (id != cursos.Id_curso)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cursos);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CursosExists(cursos.Id_curso))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cursos));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id_etapa,nivel")] Etapas etapas)
        {
            if (id != etapas.Id_etapa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(etapas);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EtapasExists(etapas.Id_etapa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(etapas));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id_alumno,nombre,correo_electronico")] Alumnos alumnos)
        {
            if (id != alumnos.Id_alumno)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(alumnos);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AlumnosExists(alumnos.Id_alumno))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(alumnos));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id_profesor,nombre,especialidad")] Profesores profesores)
        {
            if (id != profesores.Id_profesor)
            {
                return(NotFound());
            }

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