Example #1
0
        // GET: /AddReview/GetGenus
        public ActionResult GetGenus(bool ajax, string value)
        {
            IGenericRepository gen   = new GenericRepository();
            ITaxonRepository   taxon = new TaxonRepository();

            IList <AGeneralTaxon> lists = null;

            if (value.Equals("animal"))
            {
                lists = taxon.getAGenus();
            }
            else if (value.Equals("plant"))
            {
                lists = taxon.getPGenus();
            }

            // return Json(taxons.getCountries(3, UpdateUtils.PHYLUM, UpdateUtils.ANIMALS).ToList());
            return(Json(lists));
        }
Example #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());
        }