public ActionResult Purchase(int id, VerifyPurchaseShopViewModel requestedViewModel)
        {
            var album = ProductService.GetById(id);

            try
            {
                ProfileService.BuyAlbum(User.Identity.AdminId, album.AlbumId, album.Price);

                TempData["Success"] = true;
                TempData["Message"] = album.Name + " er blevet købt";

                ProfileService.AddActivity(ProfileService.GetById(User.Identity.AdminId).ProfileId, "BoughtAAlbum");

                return(RedirectToAction("Details", new { id = id }));
            }
            catch (NotEnoughFundsException e)
            {
                TempData["Error"]   = true;
                TempData["Message"] = string.Format("Du har ikke nok grunker på din konto. Du har {0}, men du skal bruge {1}", e.Funds, e.NeededFunds);

                return(RedirectToAction("VerifyPurchase", new { id = id }));
            }
            catch (AlreadyPurchasedException)
            {
                TempData["Error"]   = true;
                TempData["Message"] = string.Format("Du har allerede købt {0} af {1}, så du kan ikke købe albummet igen", album.Name, album.Artist.Name);

                return(RedirectToAction("VerifyPurchase", new { id = id }));
            }
        }
        public ActionResult UpdateDescription(int id, UpdateDescriptionProfileViewModel requestedViewModel)
        {
            if (ModelState.IsValid)
            {
                ProfileService.UpdateDescription(id, requestedViewModel.Description);

                ProfileService.AddActivity(id, "UpdatedDescription");
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult Create(CreateReviewsViewModel requestedViewModel)
        {
            if (ModelState.IsValid)
            {
                var profile = ProfileService.GetById(User.Identity.AdminId);

                ReviewService.Create(profile.ProfileId, requestedViewModel.Description, requestedViewModel.Title, requestedViewModel.Url, requestedViewModel.Picture);
                ProfileService.AddActivity(profile.ProfileId, "CreatedAReview");
                return(View("Created", new CreatedReviewsViewModel {
                    MenuKey = "reviews"
                }));
            }

            requestedViewModel.MenuKey = "reviews";
            return(View(requestedViewModel));
        }