private void fakeDataSaveObservations(FiftyMeterPointSurvey survey)
 {
     foreach (FiftyMeterPointObservation observation in survey.Observations)
     {
         ObservationMapper.Insert(observation);
     }
 }
Example #2
0
        public void t_PointCountLess50_Save_Insert()
        {
            //loadSiteVisit(TestHelper.TestGuid1);
            PointCountWithin50 supplemental = new PointCountWithin50()
            {
                Comments    = "asdfasdf asdf adsfa dsfads fasdf adsfasd fadsf awefr34fr34r34 ",
                SpeciesCode = TestHelper.SPECIES_1_CODE,
                EventId     = TestHelper.TestGuid1
            };

            ObservationMapper.Insert(supplemental);

            using (IbaUnitTestEntities iba = new IbaUnitTestEntities())
            {
                var PointCountLess50Query = from PointCountLess50s in iba.Observation_ado select PointCountLess50s;
                Assert.IsNotNull(PointCountLess50Query, "Query result is null");
                Assert.AreEqual(1, PointCountLess50Query.Count(), "Wrong number of results in query");
                Observation_ado adoPointCountLess50 = PointCountLess50Query.First();
                validateObjectEquality(supplemental, adoPointCountLess50, iba);
            }
        }
Example #3
0
        public void t_SupplementalObservation_Save_Insert()
        {
            //loadSiteVisit(TestHelper.TestGuid1);
            SupplementalObservation supplemental = new SupplementalObservation()
            {
                Comments    = "asdfasdf asdf adsfa dsfads fasdf adsfasd fadsf awefr34fr34r34 ",
                SpeciesCode = TestHelper.SPECIES_1_CODE,
                EventId     = TestHelper.TestGuid1
            };

            ObservationMapper.Insert(supplemental);

            using (IbaUnitTestEntities iba = new IbaUnitTestEntities())
            {
                var SupplementalObservationQuery = from SupplementalObservations in iba.Observation_ado select SupplementalObservations;
                Assert.IsNotNull(SupplementalObservationQuery, "Query result is null");
                Assert.AreEqual(1, SupplementalObservationQuery.Count(), "Wrong number of results in query");
                Observation_ado adoSupplementalObservation = SupplementalObservationQuery.First();
                validateObjectEquality(supplemental, adoSupplementalObservation, iba);
            }
        }
        public void Insert(FiftyMeterDataEntry entry)
        {
            if (entry == null)
            {
                throw new ArgumentNullException("entry");
            }

            entry.SpeciesCode = entry.SpeciesCode.ToUpper();
            List <PointCountBeyond50> beyond50 = entry.GetListBeyond50();
            List <PointCountWithin50> within50 = entry.GetListWithin50();

            beyond50.FindAll(y => !y.MarkForDeletion).ForEach(x =>
            {
                ObservationMapper.Insert(x);
                _state.PointSurvey.Observations.Add(x);
            });
            within50.FindAll(y => !y.MarkForDeletion).ForEach(x =>
            {
                ObservationMapper.Insert(x);
                _state.PointSurvey.Observations.Add(x);
            });
        }
Example #5
0
 public void Insert(SupplementalObservation observation)
 {
     observation.SpeciesCode = observation.SpeciesCode.ToUpper();
     ObservationMapper.Insert(observation);
     _state.SiteVisit.SupplementalObservations.Add(observation);
 }