Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,FirstName,LastName,DisplayName,DateCreated,UserTypeId,UserAccountId")] UserProfiles userProfiles)
        {
            if (id != userProfiles.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(userProfiles);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserProfilesExists(userProfiles.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserTypeId"] = new SelectList(_context.UserType, "Id", "TypeName", userProfiles.UserTypeId);
            return(View(userProfiles));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,GameTitle,PlatformsId,CategoryId,RatingId,Synopsis,CompanyId")] Games games,
                                               IFormFile FilePhoto)
        {
            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["CategoryId"]  = new SelectList(_context.Categories, "Id", "Category", games.CategoryId);
            ViewData["CompanyId"]   = new SelectList(_context.Company, "Id", "CompanyName", games.CompanyId);
            ViewData["PlatformsId"] = new SelectList(_context.Platforms, "Id", "PlatformName", games.PlatformsId);
            ViewData["RatingId"]    = new SelectList(_context.Rating, "Id", "RatingNum", games.RatingId);
            return(View(games));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("GuideTitle,GuideContent,DateSubmitted,LastUpdated,UserProfilesId,GameId")] Guides guides)
        {
            if (id != guides.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(guides);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GuidesExists(guides.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GameId"] = new SelectList(_context.Games, "Id", "GameTitle", guides.GameId);
            //ViewData["UserProfilesId"] = new SelectList(_context.UserProfiles, "Id", "DisplayName", guides.UserProfilesId);
            return(View(guides));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("Comment,DatePosted,UserProfilesId,GuideId")] Comments comments)
        {
            if (id != comments.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(comments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CommentsExists(comments.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ViewComments)));
            }
            //ViewData["UserProfilesId"] = new SelectList(_context.UserProfiles, "Id", "DisplayName", comments.UserProfilesId);
            return(View(comments));
        }