예제 #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_OsrsLegacy
        public SensorType Build(DbDataReader reader)
        {
            CompoundIdentity parentId   = null;
            Guid             parentGuid = DbReaderUtils.GetGuid(reader, 3);

            if (!Guid.Empty.Equals(parentGuid))
            {
                parentId = new CompoundIdentity(Db.DataStoreIdentity, parentGuid);
            }

            SensorType sensorType = new SensorType(new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 0)), DbReaderUtils.GetString(reader, 1), DbReaderUtils.GetString(reader, 2), parentId);

            string s = DbReaderUtils.GetString(reader, 4);
            JToken t = JRaw.Parse(s);

            if (t is JArray)
            {
                JArray a = (JArray)t;
                HashSet <CompoundIdentity> ids = Db.ToIds(a);
                foreach (CompoundIdentity id in ids)
                {
                    sensorType.InstrumentFamilies.Add(id);
                }
            }

            return(sensorType);
        }
예제 #3
0
        public Role Build(DbDataReader reader)
        {
            Guid   id   = DbReaderUtils.GetGuid(reader, 0);
            string name = DbReaderUtils.GetString(reader, 1);

            return(new Role(name, id));
        }
예제 #4
0
 private bool getContactInfoForPerson(Person p)
 {
     if (p != null && this.CanGet())
     {
         NpgsqlCommand cmd = Db.GetCmd(Db.ConnectionString);
         cmd.CommandText = Db.SelectPersonConatactInfoById;
         cmd.Parameters.AddWithValue("pid", p.Identity.Identity);
         NpgsqlDataReader rdr = Db.ExecuteReader(cmd);
         try
         {
             while (rdr.Read())
             {
                 string name  = DbReaderUtils.GetString(rdr, 1);
                 string email = DbReaderUtils.GetString(rdr, 2);
                 if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(email))
                 {
                     p.Contacts.Add(name, new EmailAddress(email));
                 }
             }
             if (cmd.Connection.State == System.Data.ConnectionState.Open)
             {
                 cmd.Connection.Close();
             }
             return(true);
         }
         catch
         { }
         finally
         {
             cmd.Dispose();
         }
     }
     return(false);
 }
예제 #5
0
파일: Db.cs 프로젝트: OSRS/Oncor_Base
        internal static List <FilestoreFile> GetExpired(DateTime abs)
        {
            try
            {
                NpgsqlCommand cmd = Db.GetCmd(Db.ConnectionString);
                cmd.CommandText = Db.SelectSql + " WHERE \"Expires\" < :d";
                cmd.Parameters.AddWithValue("d", abs);

                NpgsqlDataReader     rdr   = ExecuteReader(cmd);
                List <FilestoreFile> items = new List <FilestoreFile>();
                while (rdr.Read())
                {
                    Guid     id = DbReaderUtils.GetGuid(rdr, 0);
                    DateTime cr = DbReaderUtils.GetDate(rdr, 1);
                    DateTime u  = DbReaderUtils.GetDate(rdr, 2);
                    DateTime a  = DbReaderUtils.GetDate(rdr, 3);
                    DateTime e  = DbReaderUtils.GetDate(rdr, 4);
                    bool     t  = DbReaderUtils.GetBoolean(rdr, 5);
                    string   fn = DbReaderUtils.GetString(rdr, 6);
                    if (DateTime.MinValue == e)
                    {
                        e = DateTime.MaxValue;
                    }

                    items.Add(new FilestoreFile(id, cr, u, a, e, t, fn));
                }

                return(items);
            }
            catch
            { }

            return(null);
        }
예제 #6
0
        public Permission Build(DbDataReader reader)
        {
            Guid   id   = DbReaderUtils.GetGuid(reader, 0);
            string name = DbReaderUtils.GetString(reader, 1);

            return(new Permission(name, id));
        }
예제 #7
0
        //"Id", "OwnerSystemId", "OwnerId", "Name", "DataType"
        public EntityBundle Build(DbDataReader reader)
        {
            EntityBundle tmp = new EntityBundle(DbReaderUtils.GetGuid(reader, 0), DbReaderUtils.GetString(reader, 3),
                                                new CompoundIdentity(DbReaderUtils.GetGuid(reader, 1), DbReaderUtils.GetGuid(reader, 2)), (BundleDataType)((int)(reader[4])));

            Fill(tmp);
            return(tmp);
        }
예제 #8
0
        public FieldTeamMemberRole Build(DbDataReader reader)
        {
            Guid   sid  = DbReaderUtils.GetGuid(reader, 0);
            Guid   id   = DbReaderUtils.GetGuid(reader, 1);
            string name = DbReaderUtils.GetString(reader, 2);
            string desc = DbReaderUtils.GetString(reader, 3);

            return(new FieldTeamMemberRole(new CompoundIdentity(sid, id), name, desc));
        }
        //\"Id\", \"OwnerType\", \"Payload\", \"Token\", \"IsLocked\", \"ValidFrom\", \"ValidTo\"
        internal PersistedCredential Create(NpgsqlDataReader rdr)
        {
            Guid id = DbReaderUtils.GetGuid(rdr, 0);

            if (!Guid.Empty.Equals(id))
            {
                PersistedCredential cred = this.Create(id, DbReaderUtils.GetString(rdr, 2), DbReaderUtils.GetString(rdr, 3), DbReaderUtils.GetDate(rdr, 5), DbReaderUtils.GetDate(rdr, 6));
                this.Update(cred, DbReaderUtils.GetBoolean(rdr, 4));
                return(cred);
            }
            return(null);
        }
예제 #10
0
        public ProjectStatus Build(DbDataReader reader)
        {
            CompoundIdentity statTypeId = null;

            if (!DBNull.Value.Equals(reader[4]))
            {
                statTypeId = new CompoundIdentity(DbReaderUtils.GetGuid(reader, 4), DbReaderUtils.GetGuid(reader, 5));
            }

            return(new ProjectStatus(new CompoundIdentity(DbReaderUtils.GetGuid(reader, 0), DbReaderUtils.GetGuid(reader, 1)), DbReaderUtils.GetGuid(reader, 2),
                                     statTypeId, DbReaderUtils.GetString(reader, 6), DbReaderUtils.GetDate(reader, 3)));
        }
예제 #11
0
        public FieldTeam Build(DbDataReader reader)
        {
            Guid   sid  = DbReaderUtils.GetGuid(reader, 0);
            Guid   id   = DbReaderUtils.GetGuid(reader, 1);
            string name = DbReaderUtils.GetString(reader, 2);
            string desc = DbReaderUtils.GetString(reader, 3);

            FieldTeam ft = new FieldTeam(new CompoundIdentity(sid, id), name, desc);

            PgFieldTeamProvider.FillMembers(ft);
            return(ft);
        }
예제 #12
0
        //Guid uid, UserType type, UserState state, DateTime? ExpiresAt, string name
        public PostgresUser Build(DbDataReader reader)
        {
            Guid         id    = DbReaderUtils.GetGuid(reader, 0);
            UserType     type  = (UserType)DbReaderUtils.GetInt32(reader, 1);
            UserState    state = (UserState)DbReaderUtils.GetInt32(reader, 2);
            DateTime?    exp   = DbReaderUtils.GetNullableDateTime(reader, 3);
            string       name  = DbReaderUtils.GetString(reader, 4);
            PostgresUser user  = new PostgresUser(id, type, name, state);

            user.ExpiresAt = exp;
            return(user);
        }
예제 #13
0
파일: Db.cs 프로젝트: OSRS/Oncor_OsrsLegacy
        public Sensor Build(DbDataReader reader)
        {
            CompoundIdentity manufId    = null;
            Guid             manufSysId = DbReaderUtils.GetGuid(reader, 8);

            if (!Guid.Empty.Equals(manufSysId))
            {
                manufId = new CompoundIdentity(manufSysId, DbReaderUtils.GetGuid(reader, 9));
            }

            return(new Sensor(new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 0)), new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 1)),
                              new CompoundIdentity(DbReaderUtils.GetGuid(reader, 2), DbReaderUtils.GetGuid(reader, 3)), DbReaderUtils.GetString(reader, 4), new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 5)),
                              DbReaderUtils.GetString(reader, 6), DbReaderUtils.GetString(reader, 7), manufId));
        }
예제 #14
0
파일: Db.cs 프로젝트: OSRS/Oncor_Base
        internal static FilestoreFile Open(Guid id)
        {
            if (!Guid.Empty.Equals(id))
            {
                NpgsqlCommand cmd = Db.GetCmd(Db.ConnectionString);
                cmd.CommandText = Db.SelectSql + " WHERE \"Id\"=:id";
                cmd.Parameters.AddWithValue("id", id);
                NpgsqlDataReader rdr = Db.ExecuteReader(cmd);
                FilestoreFile    tmp = null;
                try
                {
                    if (rdr.Read())
                    {
                        DateTime cr = DbReaderUtils.GetDate(rdr, 1);
                        DateTime u  = DbReaderUtils.GetDate(rdr, 2);
                        DateTime a  = DbReaderUtils.GetDate(rdr, 3);
                        DateTime e  = DbReaderUtils.GetDate(rdr, 4);
                        bool     t  = DbReaderUtils.GetBoolean(rdr, 5);
                        string   fn = DbReaderUtils.GetString(rdr, 6);
                        if (DateTime.MinValue == e)
                        {
                            e = DateTime.MaxValue;
                        }

                        tmp = new FilestoreFile(id, cr, u, a, e, t, fn);
                    }
                    if (cmd.Connection.State == System.Data.ConnectionState.Open)
                    {
                        cmd.Connection.Close();
                    }
                }
                catch
                { }
                finally
                {
                    cmd.Dispose();
                }

                if (DateTime.Now >= tmp.ExpiresAt) //just handle last minute deletes
                {
                    Delete(id);
                    tmp = null;
                }
                return(tmp);
            }
            return(null);
        }
예제 #15
0
        public Project Build(DbDataReader reader)
        {
            CompoundIdentity parentId    = null;
            Guid             parentSysId = DbReaderUtils.GetGuid(reader, 5);

            if (!Guid.Empty.Equals(parentSysId))
            {
                parentId = new CompoundIdentity(parentSysId, DbReaderUtils.GetGuid(reader, 6));
            }

            Project p = new Project(new CompoundIdentity(DbReaderUtils.GetGuid(reader, 0), DbReaderUtils.GetGuid(reader, 1)),
                                    DbReaderUtils.GetString(reader, 2), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 3), DbReaderUtils.GetGuid(reader, 4)),
                                    parentId, DbReaderUtils.GetString(reader, 7));

            Db.LoadAffiliates(p);
            return(p);
        }
예제 #16
0
        public SamplingEvent Build(DbDataReader reader)
        {
            Guid sid   = DbReaderUtils.GetGuid(reader, 0);
            Guid id    = DbReaderUtils.GetGuid(reader, 1);
            Guid ftsid = DbReaderUtils.GetGuid(reader, 2);
            Guid ftid  = DbReaderUtils.GetGuid(reader, 3);
            Guid osid  = DbReaderUtils.GetGuid(reader, 4);
            Guid oid   = DbReaderUtils.GetGuid(reader, 5);
            //Guid stsid = DbReaderUtils.GetGuid(reader, 6);
            //Guid stid = DbReaderUtils.GetGuid(reader, 7);
            string   name  = DbReaderUtils.GetString(reader, 6);
            string   desc  = DbReaderUtils.GetString(reader, 7);
            DateTime start = Db.SafeGetDate(reader, 8, DateTime.MinValue);
            DateTime end   = Db.SafeGetDate(reader, 9, DateTime.MaxValue);

            return(new SamplingEvent(new CompoundIdentity(sid, id), name, new CompoundIdentity(ftsid, ftid), new CompoundIdentity(osid, oid), new Numerics.ValueRange <DateTime>(start, end), desc));
        }
예제 #17
0
파일: Db.cs 프로젝트: OSRS/Oncor_OsrsLegacy
        //\"SystemId\", \"Id\", \"OwnerSystemId\", \"OwnerId\", \"Name\", \"Description\", \"Geom\", \"AltGeom\", \"StartDate\", \"EndDate\"
        public Site Build(DbDataReader reader)
        {
            Site tmp = new Site(new CompoundIdentity(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));

            if (!DBNull.Value.Equals(reader[6]))
            {
                tmp.Location = Osrs.Numerics.Spatial.Postgres.NpgSpatialUtils.ToGeom((NpgsqlTypes.PostgisGeometry)reader[6]);
            }

            if (!DBNull.Value.Equals(reader[7]))
            {
                tmp.LocationMark = Osrs.Numerics.Spatial.Postgres.NpgSpatialUtils.ToGeom((NpgsqlTypes.PostgisGeometry)reader[7]) as Point2 <double>;
            }

            return(tmp);
        }
        public override IEnumerable <PasswordHistory <UsernamePassword> > Get(Guid userId)
        {
            if (!Guid.Empty.Equals(userId))
            {
                NpgsqlCommand cmd = Db.GetCmd(Db.ConnectionString);
                cmd.CommandText = Db.Select;
                cmd.Parameters.AddWithValue("id", userId);
                NpgsqlDataReader rdr = Db.ExecuteReader(cmd);
                List <PasswordHistory <UsernamePassword> > permissions = new List <PasswordHistory <UsernamePassword> >();
                try
                {
                    PasswordHistory <UsernamePassword> o;
                    while (rdr.Read())
                    {
                        string user = DbReaderUtils.GetString(rdr, 1);
                        if (!string.IsNullOrEmpty(user))
                        {
                            string payload = DbReaderUtils.GetString(rdr, 2);
                            if (!string.IsNullOrEmpty(payload))
                            {
                                o = ToHistory(payload);
                                if (o != null)
                                {
                                    permissions.Add(o);
                                }
                            }
                        }
                    }
                    if (cmd.Connection.State == System.Data.ConnectionState.Open)
                    {
                        cmd.Connection.Close();
                    }
                }
                catch
                { }
                finally
                {
                    cmd.Dispose();
                }

                return(permissions);
            }
            return(null);
        }
예제 #19
0
        public WaterQualityDeployment Build(DbDataReader reader)
        {
            WaterQualityDeployment tmp = new WaterQualityDeployment(new CompoundIdentity(DbReaderUtils.GetGuid(reader, 0), DbReaderUtils.GetGuid(reader, 1)), DbReaderUtils.GetString(reader, 2),
                                                                    new CompoundIdentity(DbReaderUtils.GetGuid(reader, 3), DbReaderUtils.GetGuid(reader, 4)), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 5), DbReaderUtils.GetGuid(reader, 6)),
                                                                    new CompoundIdentity(DbReaderUtils.GetGuid(reader, 7), DbReaderUtils.GetGuid(reader, 8)), DateRange.Create(Db.FixDate(DbReaderUtils.GetNullableDateTime(reader, 9)), Db.FixDate(DbReaderUtils.GetNullableDateTime(reader, 10))),
                                                                    DbReaderUtils.GetString(reader, 11), DbReaderUtils.GetBoolean(reader, 12));

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

            return(tmp);
        }
예제 #20
0
        public FieldTrip Build(DbDataReader reader)
        {
            Guid     sid   = DbReaderUtils.GetGuid(reader, 0);
            Guid     id    = DbReaderUtils.GetGuid(reader, 1);
            Guid     fasid = DbReaderUtils.GetGuid(reader, 2);
            Guid     fid   = DbReaderUtils.GetGuid(reader, 3);
            Guid     osid  = DbReaderUtils.GetGuid(reader, 4);
            Guid     oid   = DbReaderUtils.GetGuid(reader, 5);
            string   name  = DbReaderUtils.GetString(reader, 6);
            string   desc  = DbReaderUtils.GetString(reader, 7);
            DateTime start = Db.SafeGetDate(reader, 8, DateTime.MinValue);
            DateTime end   = Db.SafeGetDate(reader, 9, DateTime.MaxValue);

            if (start > DateTime.MinValue)
            {
                return(new FieldTrip(new CompoundIdentity(sid, id), name, new CompoundIdentity(fasid, fid), new CompoundIdentity(osid, oid), new Numerics.ValueRange <DateTime>(start, end), desc));
            }
            else
            {
                return(new FieldTrip(new CompoundIdentity(sid, id), name, new CompoundIdentity(fasid, fid), new CompoundIdentity(osid, oid), null, desc));
            }
        }
예제 #21
0
        //\"Id\", \"CatchEffortId\", \"MetricType\", \"Value\", \"Description\"
        public CatchMetric Build(DbDataReader reader)
        {
            CatchMetric tmp = new CatchMetric(DbReaderUtils.GetGuid(reader, 0), new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 1)),
                                              DbReaderUtils.GetSingle(reader, 3), DbReaderUtils.GetString(reader, 2), DbReaderUtils.GetString(reader, 4));

            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);
        }
예제 #22
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);
        }
예제 #23
0
        //\"Id\", \"CatchEffortId\", \"TaxaSystemId\", \"TaxaId\", \"Count\", \"Description\"
        public FishCount Build(DbDataReader reader)
        {
            FishCount tmp = new FishCount(DbReaderUtils.GetGuid(reader, 0), new CompoundIdentity(Db.DataStoreIdentity, DbReaderUtils.GetGuid(reader, 1)), new CompoundIdentity(DbReaderUtils.GetGuid(reader, 2), DbReaderUtils.GetGuid(reader, 3)),
                                          (uint)DbReaderUtils.GetInt32(reader, 4), DbReaderUtils.GetString(reader, 5));

            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);
        }
예제 #24
0
        //\"Id\", \"FishId\", \"TagCode\", \"TagType\", \"TagManufacturer\", \"Description\"
        public FishIdTag Build(DbDataReader reader)
        {
            FishIdTag tmp = new FishIdTag(DbReaderUtils.GetGuid(reader, 0), DbReaderUtils.GetGuid(reader, 1), DbReaderUtils.GetString(reader, 2), DbReaderUtils.GetString(reader, 3),
                                          DbReaderUtils.GetString(reader, 4), DbReaderUtils.GetString(reader, 5));

            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);
        }
예제 #25
0
        public override IArchetype Get(CompoundIdentity instrumentId)
        {
            if (instrumentId != null && this.CanGet())
            {
                NpgsqlCommand cmd = Db.GetCmd(Db.ConnectionString);
                cmd.CommandText = Db.SelectInstrumentArchetypeInstance + " WHERE \"InstrumentId\"=:iid";
                cmd.Parameters.AddWithValue("iid", instrumentId.Identity);
                NpgsqlDataReader rdr = Db.ExecuteReader(cmd);
                if (rdr != null)
                {
                    while (rdr.Read())
                    {
                        string archetype = this.GetArchetypeType(new CompoundIdentity(new Guid("{5F297502-B620-42BF-80BC-A4AF5A597267}"), DbReaderUtils.GetGuid(rdr, 1)));
                        string s         = DbReaderUtils.GetString(rdr, 2);
                        JToken t         = JRaw.Parse(s);
                        if (t is JObject)
                        {
                            JObject a = (JObject)t;
                            switch (archetype)
                            {
                            case "SimpleTrapDredge":
                                return(Db.ToSimpleTrapDredge(a));

                            case "StandardMeshNet":
                                return(Db.ToStandardMeshNet(a));

                            case "StandardPlanktonNet":
                                return(Db.ToStandardPlanktonNet(a));

                            case "WingedBagNet":
                                return(Db.ToWingedBagNet(a));
                            }
                        }
                    }
                }
            }
            return(null);
        }
예제 #26
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);
        }
예제 #27
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);
        }
예제 #28
0
 public Taxonomy Build(DbDataReader reader)
 {
     return(new Taxonomy(new CompoundIdentity(Db.SysId, DbReaderUtils.GetGuid(reader, 0)), DbReaderUtils.GetString(reader, 1), DbReaderUtils.GetString(reader, 2)));
 }
예제 #29
0
 public TaxaUnit Build(DbDataReader reader)
 {
     return(new TaxaUnit(new CompoundIdentity(Db.SysId, DbReaderUtils.GetGuid(reader, 0)), DbReaderUtils.GetString(reader, 1), new CompoundIdentity(Db.SysId, DbReaderUtils.GetGuid(reader, 4)),
                         new CompoundIdentity(Db.SysId, DbReaderUtils.GetGuid(reader, 5)), new CompoundIdentity(Db.SysId, DbReaderUtils.GetGuid(reader, 6)),
                         new CompoundIdentity(Db.SysId, DbReaderUtils.GetGuid(reader, 3)), DbReaderUtils.GetString(reader, 2)));
 }
예제 #30
0
 public OrganizationAliasScheme Build(DbDataReader reader)
 {
     return(new OrganizationAliasScheme(new CompoundIdentity(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)));
 }