예제 #1
0
        //\"Id\", \"EventSystemId\", \"EventId\", \"SiteSystemId\", \"SiteId\", \"When\",
        //\"PointLocation\", \"Method\", \"Strata\", \"Depth\", \"pH\", \"Temp\", \"DO\", \"Salinity\", \"Velocity\", \"Description\", \"IsPrivate\"
        public CatchEffort Build(DbDataReader reader)
        {
            Point2 <double> loc;

            if (DBNull.Value.Equals(reader[6]))
            {
                loc = null;
            }
            else
            {
                loc = Osrs.Numerics.Spatial.Postgres.NpgSpatialUtils.ToGeom((NpgsqlTypes.PostgisGeometry)reader[6]) as Point2 <double>;
            }

            CatchEffort tmp = new CatchEffort(new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 0)), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 1), DbReaderUtils.GetGuid(reader, 2)),
                                              new CompoundIdentity(DbReaderUtils.GetGuid(reader, 3), DbReaderUtils.GetGuid(reader, 4)), Db.FixDate(DbReaderUtils.GetDate(reader, 5)), loc, DbReaderUtils.GetString(reader, 7), DbReaderUtils.GetString(reader, 8),
                                              DbReaderUtils.GetSingle(reader, 9), DbReaderUtils.GetSingle(reader, 10), DbReaderUtils.GetSingle(reader, 11), DbReaderUtils.GetSingle(reader, 12), DbReaderUtils.GetSingle(reader, 13),
                                              DbReaderUtils.GetSingle(reader, 14), DbReaderUtils.GetString(reader, 15), DbReaderUtils.GetBoolean(reader, 16));

            if (tmp.IsPrivate)
            {
                if (prov == null)
                {
                    return(null); //can't verify
                }
                if (!prov.HasAffiliationForSampleEvent(tmp.SampleEventId, false))
                {
                    return(null);
                }
            }

            return(tmp);
        }
예제 #2
0
파일: Db.cs 프로젝트: OSRS/Oncor_Base
        //\"Id\", \"EventSystemId\", \"EventId\", \"SiteSystemId\", \"SiteId\", \"PlotTypeId\", \"PointLocation\", \"Area\", \"ElevMin\", \"ElevMax\", \"Description\", \"IsPrivate\"
        public VegSurvey Build(DbDataReader reader)
        {
            VegSurvey tmp = new VegSurvey(new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 0)), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 1), DbReaderUtils.GetGuid(reader, 2)),
                                          new CompoundIdentity(DbReaderUtils.GetGuid(reader, 3), DbReaderUtils.GetGuid(reader, 4)), new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 5)),
                                          Db.GetLoc(reader, 6), DbReaderUtils.GetSingle(reader, 7), DbReaderUtils.GetSingle(reader, 8), DbReaderUtils.GetSingle(reader, 9), DbReaderUtils.GetString(reader, 10), (bool)reader[11]);

            if (tmp.IsPrivate)
            {
                if (prov == null)
                {
                    return(null); //can't verify
                }
                if (!prov.HasAffiliationForSampleEvent(tmp.SampleEventId, false))
                {
                    return(null);
                }
            }

            return(tmp);
        }
예제 #3
0
        //\"Id\", \"CatchEffortId\", \"NetSystemId\", \"NetId\", \"AreaSampled\", \"VolumeSampled\", \"Description\"
        public NetHaulEvent Build(DbDataReader reader)
        {
            NetHaulEvent tmp = new NetHaulEvent(DbReaderUtils.GetGuid(reader, 0), new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 1)), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 2), DbReaderUtils.GetGuid(reader, 3)),
                                                DbReaderUtils.GetSingle(reader, 4), DbReaderUtils.GetSingle(reader, 5), DbReaderUtils.GetString(reader, 6));

            if (!seen.Contains(tmp.CatchEffortId))
            {
                seen.Add(tmp.CatchEffortId);
                CatchEffort e = this.helperBuilder.Get(tmp.CatchEffortId);
                if (e != null)
                {
                    got.Add(tmp.CatchEffortId);
                }
            }

            if (!got.Contains(tmp.CatchEffortId))
            {
                return(null);
            }

            return(tmp);
        }
예제 #4
0
파일: Db.cs 프로젝트: OSRS/Oncor_Base
        //\"Id\", \"VegSampleId\", \"TaxaUnitSystemId\", \"TaxaUnitId\", \"Dbh\", \"Description\"
        public TreeSample Build(DbDataReader reader)
        {
            TreeSample tmp = new TreeSample((Guid)reader[0], DbReaderUtils.GetGuid(reader, 1), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 2), DbReaderUtils.GetGuid(reader, 3)),
                                            DbReaderUtils.GetSingle(reader, 4), DbReaderUtils.GetString(reader, 5));

            if (!seen.Contains(tmp.VegSampleId))
            {
                seen.Add(tmp.VegSampleId);
                VegSample e = this.helperBuilder.Get(tmp.VegSampleId);
                if (e != null)
                {
                    got.Add(tmp.VegSampleId);
                }
            }

            if (!got.Contains(tmp.VegSampleId))
            {
                return(null);
            }

            return(tmp);
        }
예제 #5
0
        //\"Id\", \"FishId\", \"TaxaSystemId\", \"TaxaId\", \"VialId\", \"GutSampleId\", \"Lifestage\", \"Count\", \"WholeAnimalsWeighed\", \"IndividualMass\", \"SampleMass\", \"Description\"
        public FishDiet Build(DbDataReader reader)
        {
            FishDiet tmp = new FishDiet(DbReaderUtils.GetGuid(reader, 0), DbReaderUtils.GetGuid(reader, 1), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 2), DbReaderUtils.GetGuid(reader, 3)),
                                        DbReaderUtils.GetString(reader, 4), DbReaderUtils.GetString(reader, 5), DbReaderUtils.GetString(reader, 6), (uint?)DbReaderUtils.GetNullableInt32(reader, 7), DbReaderUtils.GetSingle(reader, 9),
                                        DbReaderUtils.GetSingle(reader, 10), (uint?)DbReaderUtils.GetNullableInt32(reader, 8), DbReaderUtils.GetString(reader, 11));

            if (!seen.Contains(tmp.FishId))
            {
                seen.Add(tmp.FishId);
                Fish e = this.helperBuilder.GetFish(tmp.FishId);
                if (e != null)
                {
                    got.Add(tmp.FishId);
                }
            }

            if (!got.Contains(tmp.FishId))
            {
                return(null);
            }

            return(tmp);
        }
예제 #6
0
        //\"Id\", \"CatchEffortId\", \"TaxaSystemId\", \"TaxaId\", \"LengthStandard\", \"LengthFork\", \"LengthTotal\", \"Weight\", \"AdClipped\", \"CWT\", \"Description\"
        public Fish Build(DbDataReader reader)
        {
            Fish tmp = new Fish(DbReaderUtils.GetGuid(reader, 0), new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 1)), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 2), DbReaderUtils.GetGuid(reader, 3)),
                                DbReaderUtils.GetSingle(reader, 4), DbReaderUtils.GetSingle(reader, 5), DbReaderUtils.GetSingle(reader, 6), DbReaderUtils.GetSingle(reader, 7), DbReaderUtils.GetNullableBoolean(reader, 8),
                                DbReaderUtils.GetNullableBoolean(reader, 9), DbReaderUtils.GetString(reader, 10));

            if (!seen.Contains(tmp.CatchEffortId))
            {
                seen.Add(tmp.CatchEffortId);
                CatchEffort e = this.helperBuilder.Get(tmp.CatchEffortId);
                if (e != null)
                {
                    got.Add(tmp.CatchEffortId);
                }
            }

            if (!got.Contains(tmp.CatchEffortId))
            {
                return(null);
            }

            return(tmp);
        }
예제 #7
0
파일: Db.cs 프로젝트: OSRS/Oncor_Base
        //\"Id\", \"VegSurveyId\", \"SiteSystemId\", \"SiteId\", \"When\", \"PointLocation\", \"ElevMin\", \"ElevMax\"
        public VegSample Build(DbDataReader reader)
        {
            VegSample tmp = new VegSample((Guid)reader[0], new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 1)), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 2), DbReaderUtils.GetGuid(reader, 3)),
                                          Db.FixDate(DbReaderUtils.GetDate(reader, 4)), Db.GetLoc(reader, 5), DbReaderUtils.GetSingle(reader, 6), DbReaderUtils.GetSingle(reader, 7));

            if (!seen.Contains(tmp.VegSurveyId))
            {
                seen.Add(tmp.VegSurveyId);
                VegSurvey e = this.helperBuilder.GetSurvey(tmp.VegSurveyId);
                if (e != null)
                {
                    got.Add(tmp.VegSurveyId);
                }
            }

            if (!got.Contains(tmp.VegSurveyId))
            {
                return(null);
            }

            return(tmp);
        }