示例#1
0
        /// <summary>
        /// Creates the view model for SpeciesObservationMap.
        /// </summary>
        /// <returns>A view model for SpeciesObservationMap.</returns>
        public ResultSpeciesObservationMapViewModel CreateResultSpeciesObservationMapViewModel()
        {
            ResultSpeciesObservationMapViewModel    model            = new ResultSpeciesObservationMapViewModel();
            PagedSpeciesObservationResultCalculator resultCalculator = new PagedSpeciesObservationResultCalculator(UserContext, MySettings);

            model.ComplexityEstimate = resultCalculator.GetQueryComplexityEstimate();

            if (MySettings.Filter.Taxa.TaxonIds.Count > 1)
            {
                TaxonTreeViewManager taxonTreeViewManager = new TaxonTreeViewManager(UserContext, MySettings);
                model.CategoryTaxaList = taxonTreeViewManager.GetCategoryTaxaList(MySettings.Filter.Taxa.TaxonIds.ToList());
            }
            else if (MySettings.Filter.Taxa.TaxonIds.Count == 0)
            {
                model.SelectedTaxaDescription = Resource.MySettingsAllTaxaSelected;
            }
            else if (MySettings.Filter.Taxa.TaxonIds.Count == 1)
            {
                // TaxonList taxa = CoreData.TaxonManager.GetTaxa(UserContext, MySettings.Filter.Taxa.TaxonIds.ToList());
                ITaxon         taxon          = CoreData.TaxonManager.GetTaxon(UserContext, MySettings.Filter.Taxa.TaxonIds.First());
                TaxonViewModel taxonViewModel = TaxonViewModel.CreateFromTaxon(taxon);
                model.SelectedTaxaDescription = taxonViewModel.FullName;

                // List<TaxonViewModel> taxonList = taxa.GetGenericList().ToTaxonViewModelList();

                // List<string> strTaxa = taxonList.Select(taxon => taxon.FullName).ToList();

                // model.SelectedTaxaDescription = String.Join(", ", strTaxa).Substring(0, 100) + "...";
            }

            model.AddSpartialFilterLayer = MySettings.Filter.Spatial.HasSettings && MySettings.Filter.Spatial.IsActive;
            return(model);
        }
        public void GetTaxonTree_CarnivoraTaxon_GetTree()
        {
            const int CarnivoraTaxonId = 3000303;

            LoginApplicationUser();
            TaxonTreeViewManager viewManager = new TaxonTreeViewManager(SessionHandler.UserContext, SessionHandler.MySettings);

            viewManager.GetTaxonTree(CarnivoraTaxonId);
        }
示例#3
0
        public ActionResult TaxonTree()
        {
            const int            CarnivoraTaxonId = 3000303;
            TaxonTreeViewManager viewManager      = new TaxonTreeViewManager(GetCurrentUser(), SessionHandler.MySettings);

            List <ITaxon> allSpecies = viewManager.GetAllSpecies(CarnivoraTaxonId);

            viewManager.GetTaxonTree(CarnivoraTaxonId);

            return(Content("Hej"));
        }