예제 #1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Name,GuildId,GuildPosition,IsActivated")] Character character)
        {
            if (id != character.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(character);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CharacterExists(character.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GuildId"] = new SelectList(_context.Guilds, "Id", "Id", character.GuildId);
            return(View(character));
        }
예제 #2
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,CharacterId,Date,Ranking")] Rank rank)
        {
            if (id != rank.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rank);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RankExists(rank.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CharacterId"] = new SelectList(_context.Characters, "Id", "Id", rank.CharacterId);
            return(View(rank));
        }
예제 #3
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Name,Alias,Image")] Guild guild)
        {
            if (id != guild.Id)
            {
                return(NotFound());
            }

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