Exemple #1
0
        //
        // GET: /SearchReview/

        public ActionResult Search(bool?NoSearchResults)
        {
            IGenericRepository generics = new GenericRepository();
            ITaxonRepository   taxon    = new TaxonRepository();


            if ((NoSearchResults != null) && (bool)NoSearchResults)
            {
                //ViewData["nosearchresults"] = true;
                TempData["flash"] = "No Search Results found. Please try Again!";
            }

            IList <AGeneralTaxon> initList = new[] { new AGeneralTaxon {
                                                         RecId = 1, TaxonName = "Select"
                                                     } };
            //ViewData["searchcountry"] = new SelectList(generics.getAllCountries(), "CtyRecId", "CtyShort");

            IList <AGeneralTaxon> countriesList = taxon.getCountriesSearch(0, UpdateUtils.SPECIES,
                                                                           UpdateUtils.ALL_KINGDOM);

            int count = countriesList.Count;

            ViewData["searchcountry"] = new SelectList(taxon.getCountriesSearch(0, UpdateUtils.SPECIES, UpdateUtils.ALL_KINGDOM), "RecID", "TaxonName");

            ViewData["phase"]      = new SelectList(generics.getAllPhase(), "ID", "PhaseDesc");
            ViewData["acountries"] = new SelectList(initList, "RecID", "TaxonName");

            ViewData["agenus"]   = new SelectList(taxon.getAGenusSearch(), "RecID", "TaxonName");
            ViewData["aspecies"] = new SelectList(taxon.getASpeciesSearch(), "RecID", "TaxonName");

            return(View());
        }
Exemple #2
0
        // GET: /SearchReview/GetCountries

        public ActionResult GetCountriesSearch(bool ajax, string speciesID, string kingdom)
        {
            IGenericRepository gen = new GenericRepository();

            ITaxonRepository taxon = new TaxonRepository();

            IList <AGeneralTaxon> lists = null;
            int _speciesID = int.Parse((speciesID));

            if (kingdom.Equals("animals") || kingdom.Equals("animal"))
            {
                lists = taxon.getCountriesSearch(_speciesID, UpdateUtils.SPECIES, UpdateUtils.ANIMALS);
            }
            else if (kingdom.Equals("plants") || kingdom.Equals("plant"))
            {
                lists = taxon.getCountriesSearch(_speciesID, UpdateUtils.SPECIES, UpdateUtils.PLANTS);
            }
            else if (kingdom.Equals("all"))
            {
                lists = taxon.getCountriesSearch(_speciesID, UpdateUtils.SPECIES, UpdateUtils.ALL_KINGDOM);
            }

            // return Json(taxons.getCountries(3, UpdateUtils.PHYLUM, UpdateUtils.ANIMALS).ToList());
            return(Json(lists));
        }