public async Task <IActionResult> Edit(AddAmiiboToCollectionInputModel model)
        {
            var user = await this.userManager.GetUserAsync(this.User);

            await this.service.EditAmiiboInCollection(model.AmiiboId, user.Id, model.PricePaid, model.IsItNewAndSealed);

            return(this.RedirectToAction("Details", new { amiiboId = model.AmiiboId }));
        }
        public IActionResult AddToCollection(int amiiboId)
        {
            var amiibo = this.service.GetAmiiboDetails(amiiboId);

            var viewModel = new AddAmiiboToCollectionInputModel {
                AmiiboId = amiiboId, AmiiboImgUrl = amiibo.ImgUrl, AmiiboName = amiibo.Name,
            };

            return(this.View(viewModel));
        }
Esempio n. 3
0
        public async Task <IActionResult> Delete(int amiiboId)
        {
            var user = await this.userManager.GetUserAsync(this.User);

            var amiibo = this.service.GetAmiiboCollectionInputDetails(user.Id, amiiboId);

            var viewModel = new AddAmiiboToCollectionInputModel
            {
                AmiiboId     = amiibo.AmiiboId,
                AmiiboImgUrl = amiibo.AmiiboImgUrl,
                AmiiboName   = amiibo.AmiiboName,
            };

            return(this.View(viewModel));
        }
        public IActionResult Delete(int amiiboId)
        {
            var userId = this.userManager.GetUserId(this.User);

            var amiibo = this.service.GetAmiiboCollectionInputDetails(userId, amiiboId);

            var viewModel = new AddAmiiboToCollectionInputModel
            {
                AmiiboName       = amiibo.AmiiboName,
                AmiiboImgUrl     = amiibo.AmiiboImgUrl,
                AmiiboId         = amiibo.AmiiboId,
                IsItNewAndSealed = amiibo.IsItNewAndSealed,
                PricePaid        = amiibo.PricePaid,
            };

            return(this.View(viewModel));
        }