getASpeciesbyGenus() public method

public getASpeciesbyGenus ( int genusID ) : IList
genusID int
return IList
Ejemplo n.º 1
0
        // GET: /AddReview/GetSpecies
        public ActionResult GetSpecies(bool ajax, string genusID, string kingdom)
        {
            IGenericRepository gen = new GenericRepository();
            ITaxonRepository taxon = new TaxonRepository();

            IList<AGeneralTaxon> lists = null;

            int _genusID = int.Parse(genusID);

            if (kingdom.Equals("animal"))
                lists = taxon.getASpeciesbyGenus(_genusID);
            else
            {
                lists = taxon.getPSpeciesbyGenus(_genusID);
            }

            // return Json(taxons.getCountries(3, UpdateUtils.PHYLUM, UpdateUtils.ANIMALS).ToList());
            return Json(lists);
        }
Ejemplo n.º 2
0
        public ActionResult EditReview(int id)
        {
            IReviewRepository reviews = new ReviewRepository();
            IGenericRepository generics = new GenericRepository();
            ITaxonRepository taxons = new TaxonRepository();

            TblReview review = reviews.getSingleReviewEdit(id);
            ViewData["addphase"] = new SelectList(generics.getAllPhase(), "ID", "PhaseDesc",review.PhaseID);
            ViewData["committee"] = new SelectList(generics.getAllCommittees(), "ID", "Description", review.CommitteeID);

            int animal = generics.getExternalRef(UpdateUtils.ANIMALS, UpdateUtils.TYPE_KINGDOM);
            int kingdom = (int) review.KingdomID;
            IList<AGeneralTaxon> lists_countries, lists_genus, lists_species = null;
            int SpeciesID = review.TaxonID.GetValueOrDefault();
            Taxons genus = taxons.getTaxonbySpecies(SpeciesID, (int) review.KingdomID);

            if (review.KingdomID == animal)
            {
                lists_countries = taxons.getCountries(SpeciesID, UpdateUtils.SPECIES, UpdateUtils.ANIMALS);
                lists_genus = taxons.getAGenus();
                lists_species= taxons.getASpeciesbyGenus(genus.genrecid);
            }
            else
            {
                lists_countries = taxons.getCountries(SpeciesID, UpdateUtils.SPECIES, UpdateUtils.PLANTS);
                lists_genus = taxons.getPGenus();
                lists_species= taxons.getPSpeciesbyGenus(genus.genrecid);
            }

            ViewData["animal"] = animal;
            ViewData["kingdom"] = kingdom;
            ViewData["countries"] = new SelectList(lists_countries, "RecID", "TaxonName", review.CountryID);
            ViewData["genus"] = new SelectList(lists_genus, "RecID", "TaxonName", genus.genrecid);
            ViewData["species"] = new SelectList(lists_species, "RecID", "TaxonName", SpeciesID);

            return View();
        }