Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Lección1,ComentarioHtml,Modulo,HayEjercicios,Pos")] Lección lección)
        {
            if (id != lección.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(lección);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LecciónExists(lección.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Modulo"] = new SelectList(_context.Modulo, "Id", "Id", lección.Modulo);
            return(View(lección));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,IdCurso,IdCliente,Fecha,Audio,Nota")] CursoImpartido cursoImpartido)
        {
            if (id != cursoImpartido.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cursoImpartido);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CursoImpartidoExists(cursoImpartido.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCliente"] = new SelectList(_context.Cliente, "Id", "Id", cursoImpartido.IdCliente);
            ViewData["IdCurso"]   = new SelectList(_context.Curso, "Id", "Id", cursoImpartido.IdCurso);
            return(View(cursoImpartido));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Categoria1,ComentarioHtml,ImagenMiniatura,ImagenGrande,Color")] Categoria categoria)
        {
            if (id != categoria.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(categoria);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CategoriaExists(categoria.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(categoria));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,SubCategoria1,Categoria,ComentarioHtml,ImagenMiniatura,ImagenGrande")] SubCategoria subCategoria)
        {
            if (id != subCategoria.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(subCategoria);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SubCategoriaExists(subCategoria.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Categoria"] = new SelectList(_context.Categoria, "Id", "Id", subCategoria.Categoria);
            return(View(subCategoria));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,IdCursoAmedida,IdModuloAmedida,IdProfesor")] ModulosCursoAmedida modulosCursoAmedida)
        {
            if (id != modulosCursoAmedida.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(modulosCursoAmedida);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ModulosCursoAmedidaExists(modulosCursoAmedida.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCursoAmedida"]  = new SelectList(_context.CursoAmedida, "Id", "Id", modulosCursoAmedida.IdCursoAmedida);
            ViewData["IdModuloAmedida"] = new SelectList(_context.Modulo, "Id", "Id", modulosCursoAmedida.IdModuloAmedida);
            ViewData["IdProfesor"]      = new SelectList(_context.Profesor, "Id", "Id", modulosCursoAmedida.IdProfesor);
            return(View(modulosCursoAmedida));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,FechaCreación")] CursoAmedida cursoAmedida)
        {
            if (id != cursoAmedida.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cursoAmedida);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CursoAmedidaExists(cursoAmedida.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cursoAmedida));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,RazonSocial,PosicionGeodesica,Correo,Telefono")] Cliente cliente)
        {
            if (id != cliente.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cliente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClienteExists(cliente.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Imagen,Correo,Telefono")] 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(int id, [Bind("Id,Modulo1,ComentarioHtml,Curso,DuracionEnMinutos,HayEjercicios,Pos,IdProfesor")] Modulo modulo)
        {
            if (id != modulo.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(modulo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ModuloExists(modulo.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Curso"]      = new SelectList(_context.Curso, "Id", "Id", modulo.Curso);
            ViewData["IdProfesor"] = new SelectList(_context.Profesor, "Id", "Id", modulo.IdProfesor);
            return(View(modulo));
        }