示例#1
0
        internal static CollectorCollection SortedByName()
        {
            var dataTable  = DatabaseController.ExecuteSelectQuery("SELECT * FROM Collectors ORDER BY CollectorName");
            var collection = new CollectorCollection();

            foreach (DataRow dataRow in dataTable.Rows)
            {
                var item = new Collector();
                item.SetPropertiesFromDataRow(dataRow);
                collection.Add(item);
            }
            return(collection);
        }
示例#2
0
        internal static CollectorCollection CollectAll()
        {
            var dataTable  = DatabaseController.ExecuteSelectQuery("SELECT * FROM " + TABLE_NAME);
            var collection = new CollectorCollection();

            foreach (DataRow dataRow in dataTable.Rows)
            {
                var item = new Collector();
                item.SetPropertiesFromDataRow(dataRow);
                collection.Add(item);
            }
            return(collection);
        }