Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("IdReservacion,Restaurante,Actividad,TipoMesa,Disponibilidad,Cliente,Personas,Fecha,Monto")] Reservas reservas)
        {
            if (id != reservas.IdReservacion)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(reservas);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReservasExists(reservas.IdReservacion))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(reservas));
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, [Bind("IdCurso,Descripcion,Categoria,Horario,Precio")] Cursos cursos)
        {
            if (id != cursos.IdCurso)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cursos);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CursosExists(cursos.IdCurso))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cursos));
        }
Example #3
0
        public async Task <IActionResult> Edit(int id, [Bind("IdUsuario,Nombre,Sal,Clave")] Usuarios usuarios)
        {
            if (id != usuarios.IdUsuario)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(usuarios);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UsuariosExists(usuarios.IdUsuario))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(usuarios));
        }
Example #4
0
        public async Task <IActionResult> Edit(int id, [Bind("IdRestaurante,Nombre,Ubicacion,Mesas")] Restaurantes restaurantes)
        {
            if (id != restaurantes.IdRestaurante)
            {
                return(NotFound());
            }

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