public async Task <IActionResult> AddReward(int id)
        {
            var user = await _authorizerService.Authorize(HttpContext);

            if (user == null)
            {
                return(Redirect(GlobalConstants.Default_Login_Page));
            }

            var achievement = _achievementsService.ById(id);

            if (achievement == null)
            {
                return(Redirect(Achievements_Root_Path));
            }

            var model = new AddItemToAchievementInputModel
            {
                AchievementId   = id,
                AchievementName = achievement.Name,
                Items           = _itemsService.All()
            };

            return(View(model));
        }
        public async Task <IActionResult> AddReward(int id)
        {
            var user = await _authorizerService.Authorize(HttpContext);

            if (user == null)
            {
                return(Redirect(GlobalConstants.Default_Login_Page));
            }

            var dungeon = _dungeonsService.ById(id);

            if (dungeon == null)
            {
                return(Redirect(Dungeons_Root_Path));
            }

            var model = new AddItemToDungeonInputModel
            {
                DungeonId   = id,
                DungeonName = dungeon.Name,
                Items       = _itemsService.All()
            };

            return(View(model));
        }
Beispiel #3
0
        public async Task <IActionResult> AddItem(int id)
        {
            var user = await _authorizerService.Authorize(HttpContext);

            if (user == null)
            {
                return(Redirect(GlobalConstants.Default_Login_Page));
            }

            var npc = _NPCsService.ById(id);

            if (npc == null)
            {
                return(Redirect(NPCs_Root_Path));
            }

            var model = new AddItemToNPCInputModel
            {
                NPCId   = id,
                NPCName = npc.Name,
                Items   = _itemsService.All()
            };

            return(View(model));
        }
Beispiel #4
0
        public IActionResult Index()
        {
            var model = _itemsService.All()?.ToList();

            return(View(model));
        }
Beispiel #5
0
        // GET api/items
        public ActionResult <List <Item> > Get()
        {
            var items = _service.All();

            return(Ok(items));
        }