public void getTaxonLevelID() { ITaxonRepository taxon = new TaxonRepository(); int i = taxon.getTaxonLevelID("SPECIES"); Assert.AreEqual(i, 10); }
private void saveSpeciesForReview() { ITaxonRepository Taxon = new TaxonRepository(); IGenericRepository gen = new GenericRepository(); IReviewRepository rr = new ReviewRepository(); if (TempData["CurrentData"] != null) { DataTable dt = (DataTable)TempData["CurrentData"]; int rowcount = dt.Rows.Count; ITaxonRepository taxon = new TaxonRepository(); for (int i = 0; i < rowcount; i++) { DataRow dr = dt.Rows[i]; TblReview r = new TblReview(); r.PhaseID = int.Parse(dr[1].ToString()); r.KingdomID = taxon.getTaxonLevelID(dr[7].ToString()); r.TaxonLevel = taxon.getTaxonLevelID(dr[2].ToString()); r.TaxonID = int.Parse(dr[4].ToString()); r.DateAdded = DateTime.Now; r.CountryID = int.Parse(dr[6].ToString()); int ID = taxon.SaveReview(r); ReviewStatus rs = new ReviewStatus(); rs.Status = gen.getExternalRef(UpdateUtils.SELECTION, UpdateUtils.REVIEWSTATUS); rs.DateAdded = DateTime.Now; rs.ReviewID = ID; rr.saveReviewStatus(rs); } } }