Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
 public ProjectInformation Build(DbDataReader reader)
 {
     return(new ProjectInformation(new CompoundIdentity(DbReaderUtils.GetGuid(reader, 0), DbReaderUtils.GetGuid(reader, 1)), DbReaderUtils.GetGuid(reader, 2),
                                   DbReaderUtils.GetString(reader, 3), DbReaderUtils.GetNullableDateTime(reader, 4), DbReaderUtils.GetNullableDateTime(reader, 5)));
 }