Exemplo n.º 1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ID,Gym,RecRoom,Computer")] Game game)
        {
            if (id != game.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(game);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GameExists(game.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(game));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ID,LastName,FirstMidName,email,phone,EnrollmentDate")] Camper camper)
        {
            if (id != camper.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(camper);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CamperExists(camper.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(camper));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ID,Breakfast,Lunch,Type")] Meal meal)
        {
            if (id != meal.ID)
            {
                return(NotFound());
            }

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