Exemplo n.º 1
0
        public ActionResult Subscribe(int subscribeTaxonId)
        {
            SubscriptionViewManager subscriptionViewManager = new SubscriptionViewManager(GetCurrentUser());

            subscriptionViewManager.Subscribe(subscribeTaxonId);
            return(RedirectToAction("Subscriptions"));
        }
Exemplo n.º 2
0
        public ActionResult Subscriptions(string taxonId)
        {
            if (taxonId.IsNull())
            {
                taxonId = this.TaxonIdentifier.Id.ToString();
            }

            TaxonSearchResult searchResult = this.TaxonSearchManager.GetTaxon(taxonId);

            if (searchResult.NumberOfMatches != 1)
            {
                return(RedirectToSearch(taxonId));
            }

            TaxonIdentifier = TaxonIdTuple.Create(taxonId, searchResult.Taxon.Id);
            ITaxon taxon = searchResult.Taxon;

            ViewBag.Taxon = taxon;
            SubscriptionViewManager subscriptionViewManager = new SubscriptionViewManager(GetCurrentUser());
            SubscriptionsViewModel  model = subscriptionViewManager.CreateSubscriptionsViewModel(taxon);

            return(View(model));
        }