Example #1
0
        public DObjectCollection Copy()
        {
            DObjectCollection clone = new DObjectCollection();

            foreach (DObject c in base.List)
            {
                clone.Add(c);
            }
            return(clone);
        }
Example #2
0
        public DObjectCollection Select(string sql)
        {
            DObjectCollection list = null;

            OleDbDataReader dbData = _database.DoQuery(sql);

            if (dbData != null)
            {
                list = new DObjectCollection();
                foreach (DbDataRecord record in dbData)
                {
                    DObject obj = ObjectType.Assembly.CreateInstance(ObjectType.ToString()) as DObject;
                    if (obj == null || obj.LoadData(record))
                    {
                        list.Add(obj);
                    }
                    obj.SetDataManager(this);
                }
            }
            _database.CloseDBConnection();

            return(list);
        }