Esempio n. 1
0
        public async Task <IActionResult> ModifyResourcePouch(ResourcePouchModifyInputModel inputModel)
        {
            await this.userService.CheckIfUserExists(inputModel.Name);

            await this.resourcePouchService.UpdateResourcePouch(inputModel);

            return(this.RedirectToAction("ModifyHero", new { inputModel.Name }));
        }
Esempio n. 2
0
        public async Task <IActionResult> ModifyResourcePouch(string name)
        {
            await this.userService.CheckIfUserExists(name);

            ResourcePouchModifyInputModel inputModel = await this.heroService.GetHeroViewModelByName <ResourcePouchModifyInputModel>(name);

            return(this.View(inputModel));
        }
        public async Task UpdateResourcePouch(ResourcePouchModifyInputModel inputModel)
        {
            Hero hero = await this.heroService.GetHeroByName(inputModel.Name);

            hero.ResourcePouch.Gold     = inputModel.ResourcePouchGold;
            hero.ResourcePouch.Crystals = inputModel.ResourcePouchCrystals;

            await this.context.SaveChangesAsync();
        }