public ActionResult Country(string country) // the parameter needed to use string interpolation in CountryUtil { RegionInfo myRI = new RegionInfo(country); CountryUtil cu = new CountryUtil(); IndividualSpecies ind = new IndividualSpecies(); var countryspecies = cu.Country(country); //var endangeredSpecies = cu.Country(country).Where(c => c.Category == "EN"); //var extinctSpecies = cu.Country(country).Where(c => c.Category == "EX"); //var extinctWildSpecies = cu.Country(country).Where(c => c.Category == "EW"); //var criticallyEndangeredSpecies = cu.Country(country).Where(c => c.Category == "CR"); //var vulnerableSpecies = cu.Country(country).Where(c => c.Category == "VU"); var allThreatenedSpecies = cu.Country(country).Where(c => c.Category == "EN" || c.Category == "EX" || c.Category == "EW" || c.Category == "CR" || c.Category == "VU"); ViewBag.C = myRI.EnglishName; // Annukka is PROUD of this bit :) ViewBag.RI = myRI; ViewBag.Categories = string.Join("", ind.Category); RestUtil ru = new RestUtil(); //foreach (var item in allThreatenedSpecies) //{ // //string name = ru.SingleSpecies(item.ScientificName).FirstOrDefault()?.MainCommonName; // string name = ru.SingleSpecies(item.ScientificName).FirstOrDefault()?.MainCommonName; // item.CommonName = name; //} return(View(allThreatenedSpecies)); // check what we actually want here!! //return View(countryspecies); }
public ActionResult VUSpecies(string country) { RegionInfo myRI = new RegionInfo(country); CountryUtil cu = new CountryUtil(); var vulnerableSpecies = cu.Country(country).Where(c => c.Category == "VU"); ViewBag.C = myRI.EnglishName; return(View(vulnerableSpecies)); }
public ActionResult CRSpecies(string country) { RegionInfo myRI = new RegionInfo(country); CountryUtil cu = new CountryUtil(); var criticallyEndangeredSpecies = cu.Country(country).Where(c => c.Category == "CR"); ViewBag.C = myRI.EnglishName; return(View(criticallyEndangeredSpecies)); }
public ActionResult EWSpecies(string country) { RegionInfo myRI = new RegionInfo(country); CountryUtil cu = new CountryUtil(); var extinctWildSpecies = cu.Country(country).Where(c => c.Category == "EW"); ViewBag.C = myRI.EnglishName; return(View(extinctWildSpecies)); }
public ActionResult ENSpecies(string country) { RegionInfo myRI = new RegionInfo(country); CountryUtil cu = new CountryUtil(); var endangeredSpecies = cu.Country(country).Where(c => c.Category == "EN"); ViewBag.C = myRI.EnglishName; ViewBag.EN = endangeredSpecies; return(View(endangeredSpecies)); }
public ActionResult Country(string country) { RegionInfo myRI = new RegionInfo(country); CountryUtil cu = new CountryUtil(); IndividualSpecies ind = new IndividualSpecies(); var countryspecies = cu.Country(country); var allThreatenedSpecies = cu.Country(country).Where(c => c.Category == "EN" || c.Category == "EX" || c.Category == "EW" || c.Category == "CR" || c.Category == "VU"); ViewBag.C = myRI.EnglishName; ViewBag.RI = myRI; ViewBag.Categories = string.Join("", ind.Category); RestUtil ru = new RestUtil(); //TODO: Upload common names to a json from which to query //foreach (var item in allThreatenedSpecies) //{ // //string name = ru.SingleSpecies(item.ScientificName).FirstOrDefault()?.MainCommonName; // string name = ru.SingleSpecies(item.ScientificName).FirstOrDefault()?.MainCommonName; // item.CommonName = name; //} return(View(allThreatenedSpecies)); // check what we actually want here!! }