Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,FirstName,LastName,Email,Dateaccountcreated,Displayname,UserAccountId,PhotoPath")] Users users)
        {
            if (id != users.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(users);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UsersExists(users.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(users));
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,UserId,GameId,DatePurchased")] PurchasedGames purchasedGames)
        {
            if (id != purchasedGames.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(purchasedGames);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PurchasedGamesExists(purchasedGames.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GameId"] = new SelectList(_context.Games, "Id", "Description", purchasedGames.GameId);
            ViewData["UserId"] = new SelectList(_context.Users, "Id", "Displayname", purchasedGames.UserId);
            return(View(purchasedGames));
        }
Example #3
0
        public async Task <IActionResult> Edit(int id, [Bind("GametypeId,GameType1")] GameType gameType)
        {
            if (id != gameType.GametypeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(gameType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GameTypeExists(gameType.GametypeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(gameType));
        }
Example #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description,Releasedate,PlatFormId,GametypeId,PhotoCover")] Games games)
        {
            if (id != games.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(games);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GamesExists(games.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GametypeId"] = new SelectList(_context.GameType, "GametypeId", "GameType1", games.GametypeId);
            ViewData["PlatFormId"] = new SelectList(_context.Platforms, "PlatformId", "Title", games.PlatFormId);
            return(View(games));
        }
Example #5
0
        public async Task <IActionResult> Edit(int id, [Bind("PlatformId,Title")] Platforms platforms)
        {
            if (id != platforms.PlatformId)
            {
                return(NotFound());
            }

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