예제 #1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Nombre,Anio,Cuatrimestre,ProfesorId")] Materia materia)
        {
            if (id != materia.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(materia);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MateriaExists(materia.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProfesorId"] = new SelectList(_context.Profesores, "Id", "Apellido", materia.ProfesorId);
            return(View(materia));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Numero,TipoTelefonoId,AlumnoId")] Telefono telefono)
        {
            if (id != telefono.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(telefono);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TelefonoExists(telefono.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AlumnoId"]       = new SelectList(_context.Alumnos, "Id", "Apellido", telefono.AlumnoId);
            ViewData["TipoTelefonoId"] = new SelectList(_context.TipoTelefonos, "Id", "Descripcion", telefono.TipoTelefonoId);
            return(View(telefono));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Email,LinkedIn,Twitter,Instagram,Facebook,AlumnoId")] Contacto contacto)
        {
            if (id != contacto.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(contacto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ContactoExists(contacto.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AlumnoId"] = new SelectList(_context.Alumnos, "Id", "Apellido", contacto.AlumnoId);
            return(View(contacto));
        }
예제 #4
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Nombre,Apellido,FechaNacimiento")] Profesor profesor)
        {
            if (id != profesor.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(profesor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProfesorExists(profesor.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(profesor));
        }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,MateriaId,AlumnoId")] MateriaAlumno materiaAlumno)
        {
            if (id != materiaAlumno.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(materiaAlumno);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MateriaAlumnoExists(materiaAlumno.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AlumnoId"]  = new SelectList(_context.Alumnos, "Id", "Apellido", materiaAlumno.AlumnoId);
            ViewData["MateriaId"] = new SelectList(_context.Materias, "Id", "Nombre", materiaAlumno.MateriaId);
            return(View(materiaAlumno));
        }
예제 #6
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Descripcion")] TipoTelefono tipoTelefono)
        {
            if (id != tipoTelefono.Id)
            {
                return(NotFound());
            }

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