Exemple #1
0
        public InnerConcreteComponent retrieve(int id_concrete, string id_inner, int id_index)
        {
            InnerConcreteComponent c     = null;
            IDbConnection          dbcon = Connector.DBcon;
            IDbCommand             dbcmd = dbcon.CreateCommand();
            string sql =
                "SELECT id_concrete, id_inner, id_index, id_concrete_actual " +
                "FROM innerconcrete " +
                "WHERE id_concrete=" + id_concrete + " AND " +
                "id_inner like '" + id_inner + "' AND " +
                "id_index=" + id_index;

            dbcmd.CommandText = sql;
            IDataReader reader = dbcmd.ExecuteReader();

            if (reader.Read())
            {
                c                    = new InnerConcreteComponent();
                c.Id_concrete        = (int)reader["id_concrete"];
                c.Id_inner           = (string)reader["id_inner"];
                c.Id_index           = (int)reader["id_index"];
                c.Id_concrete_actual = (int)reader["id_concrete_actual"];
            }//if
            // clean up
            reader.Close();
            reader = null;
            dbcmd.Dispose();
            dbcmd = null;
            return(c);
        }
Exemple #2
0
        public IList <InnerConcreteComponent> retrieveEnumeration(int id_concrete, string id_inner)
        {
            InnerConcreteComponent         c     = null;
            IDbConnection                  dbcon = Connector.DBcon;
            IDbCommand                     dbcmd = dbcon.CreateCommand();
            IList <InnerConcreteComponent> l     = new List <InnerConcreteComponent>();
            string sql =
                "SELECT id_concrete, id_inner, id_index, id_concrete_actual " +
                "FROM innerconcrete " +
                "WHERE id_concrete=" + id_concrete + " AND " +
                "id_inner like '" + id_inner;

            dbcmd.CommandText = sql;
            IDataReader reader = dbcmd.ExecuteReader();

            while (reader.Read())
            {
                c                    = new InnerConcreteComponent();
                c.Id_concrete        = (int)reader["id_concrete"];
                c.Id_inner           = (string)reader["id_inner"];
                c.Id_index           = (int)reader["id_index"];
                c.Id_concrete_actual = (int)reader["id_concrete_actual"];

                l.Add(c);
            }//while
            // clean up
            reader.Close();
            reader = null;
            dbcmd.Dispose();
            dbcmd = null;
            return(l);
        }
Exemple #3
0
        public void insert(InnerConcreteComponent ac)
        {
            String sql =
                "INSERT INTO innerconcrete (id_concrete, id_inner, id_index, id_concrete_actual)" +
                " VALUES (" + ac.Id_concrete + ",'" + ac.Id_inner + "'," + ac.Id_index + "," + ac.Id_concrete_actual + ")";

            Connector.performSQLUpdate(sql);
        }