public getTaxonbySpecies ( int SpeciesID, int Kingdom ) : |
||
SpeciesID | int | |
Kingdom | int | |
Результат |
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(); }