Beispiel #1
0
 public int Update(TnfValueDomain tnfValueDomain)
 {
     return(Update(new object[]
     {
         tnfValueDomain.Oid,
         tnfValueDomain.CatalogueOid,
         tnfValueDomain.ValueDomainType,
         tnfValueDomain.Name,
         tnfValueDomain.ShortName,
         tnfValueDomain.Description,
         tnfValueDomain.DataType,
         tnfValueDomain.NrDec,
         tnfValueDomain.IsUnion,
         tnfValueDomain.Unit,
         tnfValueDomain.NrChar
     }));
 }
Beispiel #2
0
 public void Add(TnfValueDomain tnfValueDomain)
 {
     Add(new object[]
     {
         tnfValueDomain.Oid,
         tnfValueDomain.CatalogueOid,
         tnfValueDomain.ValueDomainType,
         tnfValueDomain.Name,
         tnfValueDomain.ShortName,
         tnfValueDomain.Description,
         tnfValueDomain.DataType,
         tnfValueDomain.NrDec,
         tnfValueDomain.IsUnion,
         tnfValueDomain.Unit,
         tnfValueDomain.NrChar
     });
 }
Beispiel #3
0
        private static TnfValueDomain ReadObject(IDataRecord reader)
        {
            var tnfValueDomain = new TnfValueDomain();

            tnfValueDomain.Oid             = reader["oid"].ToInt();
            tnfValueDomain.CatalogueOid    = reader["catalogue_oid"].ToInt();
            tnfValueDomain.ValueDomainType = reader["value_domain_type"].FromDbString();
            tnfValueDomain.Name            = reader["name"].FromDbString();
            tnfValueDomain.ShortName       = reader["shortname"].FromDbString();
            tnfValueDomain.Description     = reader["description"].FromDbString();
            tnfValueDomain.DataType        = reader["datatype"].FromDbString();
            tnfValueDomain.NrDec           = reader["nr_dec"].ToInt32();
            tnfValueDomain.IsUnion         = reader.ReadIfExists("is_union").ToBoolean() ?? false;
            tnfValueDomain.Unit            = reader["unit"].FromDbString();
            tnfValueDomain.NrChar          = reader["nr_char"].ToInt32();

            return(tnfValueDomain);
        }
Beispiel #4
0
        private List <TnfValueDomain> GetAll(int catalogueOid, int fromDate, int toDate, bool bTimeInterval)
        {
            var    valueDomains = new List <TnfValueDomain>();
            string commandText  = String.Format("SELECT * FROM {0} WHERE catalogue_oid = {1}", TnfValueDomainTableName, catalogueOid);

            if (bTimeInterval)
            {
                commandText += " AND valid_from >= " + fromDate + " AND valid_to <= " + toDate;
            }

            using (IDataReader idataReader = Db.ExecuteReader(commandText))
            {
                while (idataReader != null && idataReader.Read())
                {
                    TnfValueDomain valueDomain = ReadObject(idataReader);
                    valueDomains.Add(valueDomain);
                }
            }

            return(valueDomains);
        }