예제 #1
0
        public async Task <IActionResult> PutHeroLol(int id, HeroLol heroLol)
        {
            if (id != heroLol.HeroID)
            {
                return(BadRequest());
            }

            _context.Entry(heroLol).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!HeroLolExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #2
0
        public async Task <IActionResult> PutSkillHero(int id, SkillHero skillHero)
        {
            if (id != skillHero.SkillHeroId)
            {
                return(BadRequest());
            }

            _context.Entry(skillHero).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SkillHeroExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("RoleSkinID,NameRoleSkin")] RoleSkin roleSkin)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roleSkin);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(roleSkin));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("HitRangeHeroID,NameHitRangeHero")] HitRangeHero hitRangeHero)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hitRangeHero);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(hitRangeHero));
        }
예제 #5
0
        public async Task <IActionResult> Create([Bind("SkinHeroID,NameSkinHero,DescriptionSkinHero,HeroID")] SkinHero skinHero)
        {
            if (ModelState.IsValid)
            {
                _context.Add(skinHero);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HeroID"] = new SelectList(_context.HeroLols, "HeroID", "HeroID", skinHero.HeroID);
            return(View(skinHero));
        }
예제 #6
0
        public async Task <IActionResult> Create([Bind("HeroID,NameHero,HitRangeHeroID")] HeroLol heroLol)
        {
            if (ModelState.IsValid)
            {
                _context.Add(heroLol);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HitRangeHeroID"] = new SelectList(_context.HitRangeHeros, "HitRangeHeroID", "HitRangeHeroID", heroLol.HitRangeHeroID);
            return(View(heroLol));
        }
예제 #7
0
        public async Task <IActionResult> Create([Bind("PropertyID,NamePoperty,RateProperty,HeroID")] PropertyHero propertyHero)
        {
            if (ModelState.IsValid)
            {
                _context.Add(propertyHero);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HeroID"] = new SelectList(_context.HeroLols, "HeroID", "HeroID", propertyHero.HeroID);
            return(View(propertyHero));
        }
        public async Task <IActionResult> Create([Bind("HeroID,RoleSkinID")] RoleSkinHero roleSkinHero)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roleSkinHero);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HeroID"]     = new SelectList(_context.HeroLols, "HeroID", "HeroID", roleSkinHero.HeroID);
            ViewData["RoleSkinID"] = new SelectList(_context.RoleSkins, "RoleSkinID", "RoleSkinID", roleSkinHero.RoleSkinID);
            return(View(roleSkinHero));
        }
        public async Task <IActionResult> AddOrEdit([Bind("DescriptionHeroID,NameDescriptionHero,DescriptionOfHero,HeroID")] DescriptionHero descriptionHero)
        {
            if (ModelState.IsValid)
            {
                if (descriptionHero.DescriptionHeroID == 0)
                {
                    _context.Add(descriptionHero);
                }
                else
                {
                    _context.Update(descriptionHero);
                }
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HeroID"] = new SelectList(_context.HeroLols, "HeroID", "HeroID", descriptionHero.HeroID);
            return(View(descriptionHero));
        }